Skip to content

Commit

Permalink
Add a new tiny font
Browse files Browse the repository at this point in the history
  • Loading branch information
hubol committed Jan 16, 2024
1 parent 35f3c25 commit 2d5ed8d
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 17 deletions.
3 changes: 3 additions & 0 deletions raw/textures/font/flaccid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions src/assets/fonts/bitmap/Flaccid.fnt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
info face="Flaccid" size=12 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
common lineHeight=7 base=10 scaleW=160 scaleH=34 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0
page id=0 file="erotix.png"
info NeedsPreprocessing
chars count=200
char id=32 x=0 y=0 width=3 height=1 xoffset=0 yoffset=3 xadvance=4 page=0 chnl=15
char id=@a x=0 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@b x=4 y=0 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@c x=8 y=1 width=2 height=3 xoffset=0 yoffset=1 xadvance=3 page=0 chnl=15
char id=@d x=11 y=0 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@e x=15 y=0 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@f x=19 y=0 width=2 height=4 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@g x=22 y=1 width=3 height=4 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@h x=26 y=0 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@i x=30 y=0 width=1 height=4 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@j x=32 y=0 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@k x=35 y=0 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@l x=39 y=0 width=1 height=4 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@m x=41 y=1 width=5 height=3 xoffset=0 yoffset=1 xadvance=6 page=0 chnl=15
char id=@n x=47 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@o x=51 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@p x=55 y=1 width=3 height=4 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@q x=59 y=1 width=3 height=4 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@r x=63 y=1 width=2 height=3 xoffset=0 yoffset=1 xadvance=3 page=0 chnl=15
char id=@s x=66 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@t x=70 y=0 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@u x=74 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@v x=78 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@w x=82 y=1 width=5 height=3 xoffset=0 yoffset=1 xadvance=6 page=0 chnl=15
char id=@x x=88 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@y x=92 y=1 width=3 height=4 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@z x=96 y=1 width=3 height=3 xoffset=0 yoffset=1 xadvance=4 page=0 chnl=15
char id=@A x=0 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@B x=4 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@C x=8 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@D x=11 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@E x=15 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@F x=18 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@G x=21 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@H x=25 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@I x=29 y=6 width=1 height=5 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@J x=31 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@K x=34 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@L x=38 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@M x=41 y=6 width=5 height=5 xoffset=0 yoffset=0 xadvance=6 page=0 chnl=15
char id=@N x=47 y=6 width=4 height=5 xoffset=0 yoffset=0 xadvance=5 page=0 chnl=15
char id=@O x=52 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@P x=56 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@Q x=60 y=6 width=4 height=5 xoffset=0 yoffset=0 xadvance=5 page=0 chnl=15
char id=@R x=65 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@S x=69 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@T x=72 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@U x=76 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@V x=80 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@W x=84 y=6 width=5 height=5 xoffset=0 yoffset=0 xadvance=6 page=0 chnl=15
char id=@X x=90 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@Y x=94 y=6 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@Z x=98 y=6 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@0 x=0 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@1 x=4 y=12 width=1 height=4 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@2 x=6 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@3 x=10 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@4 x=14 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@5 x=18 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@6 x=22 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@7 x=26 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@8 x=30 y=12 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@9 x=34 y=12 width=3 height=4 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@. x=38 y=15 width=1 height=1 xoffset=0 yoffset=3 xadvance=2 page=0 chnl=15
char id=@! x=40 y=12 width=1 height=4 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@? x=42 y=12 width=3 height=5 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@, x=46 y=15 width=1 height=2 xoffset=0 yoffset=3 xadvance=2 page=0 chnl=15
char id=@' x=48 y=12 width=1 height=2 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@; x=50 y=12 width=1 height=5 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@" x=52 y=12 width=3 height=2 xoffset=0 yoffset=0 xadvance=4 page=0 chnl=15
char id=@: x=56 y=12 width=1 height=4 xoffset=0 yoffset=0 xadvance=2 page=0 chnl=15
char id=@/ x=58 y=12 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@( x=61 y=12 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15
char id=@) x=64 y=12 width=2 height=5 xoffset=0 yoffset=0 xadvance=3 page=0 chnl=15

kerning first=@L second=@o amount=-1
kerning first=@L second=@e amount=-1
kerning first=@s second=@s amount=-1
kerning first=@r second=@s amount=-1
5 changes: 5 additions & 0 deletions src/assets/fonts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export const objText = {
Small(text = '', style: Style = {}) {
return new BitmapText(text, { fontName: Fonts.Atomix.font, ...style });
},
Small2(text = '', style: Style = {}) {
return new BitmapText(text, { fontName: Fonts.Flaccid.font, ...style });
},
Large(text = '', style: Style = {}) {
return new BitmapText(text, { fontName: Fonts.Acrobatix.font, ...style });
},
Expand All @@ -32,6 +35,7 @@ const Fonts = {
Diggit: Force<BitmapFont>(),
Erotix: Force<BitmapFont>(),
ErotixLight: Force<BitmapFont>(),
Flaccid: Force<BitmapFont>(),
};

type TxFontKey = keyof typeof Tx['Font'];
Expand All @@ -48,6 +52,7 @@ export async function loadFontAssets(progress: JobProgress) {
load("Diggit", require("./bitmap/Diggit.fnt"), "Diggit"),
load("Erotix", require("./bitmap/Erotix.fnt"), "Erotix"),
load("ErotixLight", require("./bitmap/ErotixLight.fnt"), "ErotixLight"),
load("Flaccid", require("./bitmap/Flaccid.fnt"), "Flaccid"),
]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/assets/generated/textures/atlas0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions src/assets/generated/textures/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is generated

const atlases = [{ url: require("./atlas0.png"), texturesCount: 21 }];
const atlases = [{ url: require("./atlas0.png"), texturesCount: 22 }];

interface TxData {
id: string;
Expand All @@ -17,26 +17,27 @@ function txs<T>(tx: (data: TxData) => T) {
Font: {
Acrobatix: tx({ id: "Font.Acrobatix", atlas: 0, x: 378, y: 52, width: 128, height: 128 }),
Atomix: tx({ id: "Font.Atomix", atlas: 0, x: 292, y: 139, width: 64, height: 64 }),
Diggit: tx({ id: "Font.Diggit", atlas: 0, x: 397, y: 9, width: 48, height: 8 }),
Diggit: tx({ id: "Font.Diggit", atlas: 0, x: 446, y: 25, width: 48, height: 8 }),
ErotixLight: tx({ id: "Font.ErotixLight", atlas: 0, x: 217, y: 87, width: 160, height: 34 }),
Erotix: tx({ id: "Font.Erotix", atlas: 0, x: 217, y: 52, width: 160, height: 34 }),
Flaccid: tx({ id: "Font.Flaccid", atlas: 0, x: 397, y: 0, width: 102, height: 24 }),
},
IguaRpgTitle: tx({ id: "IguaRpgTitle", atlas: 0, x: 0, y: 52, width: 216, height: 60 }),
Iguana: {
Club: tx({ id: "Iguana.Club", atlas: 0, x: 446, y: 0, width: 48, height: 12 }),
Club: tx({ id: "Iguana.Club", atlas: 0, x: 397, y: 34, width: 48, height: 12 }),
Crest: tx({ id: "Iguana.Crest", atlas: 0, x: 292, y: 122, width: 80, height: 16 }),
Eye: tx({ id: "Iguana.Eye", atlas: 0, x: 459, y: 38, width: 8, height: 8 }),
Eye: tx({ id: "Iguana.Eye", atlas: 0, x: 500, y: 0, width: 8, height: 8 }),
Foot: tx({ id: "Iguana.Foot", atlas: 0, x: 0, y: 142, width: 126, height: 12 }),
Head: tx({ id: "Iguana.Head", atlas: 0, x: 357, y: 146, width: 18, height: 18 }),
Horn: tx({ id: "Iguana.Horn", atlas: 0, x: 495, y: 0, width: 16, height: 8 }),
Mouth: tx({ id: "Iguana.Mouth", atlas: 0, x: 397, y: 0, width: 48, height: 8 }),
Horn: tx({ id: "Iguana.Horn", atlas: 0, x: 495, y: 25, width: 16, height: 8 }),
Mouth: tx({ id: "Iguana.Mouth", atlas: 0, x: 397, y: 25, width: 48, height: 8 }),
Nails: tx({ id: "Iguana.Nails", atlas: 0, x: 357, y: 139, width: 20, height: 6 }),
Pupil: tx({ id: "Iguana.Pupil", atlas: 0, x: 151, y: 113, width: 64, height: 8 }),
Tail: tx({ id: "Iguana.Tail", atlas: 0, x: 151, y: 122, width: 140, height: 22 }),
Torso: tx({ id: "Iguana.Torso", atlas: 0, x: 459, y: 13, width: 24, height: 24 }),
Torso: tx({ id: "Iguana.Torso", atlas: 0, x: 419, y: 181, width: 24, height: 24 }),
},
LockedDoor: tx({ id: "LockedDoor", atlas: 0, x: 428, y: 18, width: 30, height: 32 }),
OpenDoor: tx({ id: "OpenDoor", atlas: 0, x: 397, y: 18, width: 30, height: 32 }),
LockedDoor: tx({ id: "LockedDoor", atlas: 0, x: 388, y: 181, width: 30, height: 32 }),
OpenDoor: tx({ id: "OpenDoor", atlas: 0, x: 357, y: 181, width: 30, height: 32 }),
OversizedAngel: tx({ id: "OversizedAngel", atlas: 0, x: 0, y: 0, width: 396, height: 51 }),
};
}
Expand Down
12 changes: 6 additions & 6 deletions src/igua/scenes/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,13 @@ export function SceneTest() {
// for (let i = 0; i < 8; i += 1)
// makeIguanaPuppetArgsFromLooks(getDefaultLooks()).at(164, 128 + i * 8).flipV().show();

objText.Small('Hubol was here\nSwag!', { tint: 0x404080 }).at(65, 65).show();
objText.Small('Hubol was here\nSwag!', { tint: 0x404080 }).at(65, 64).show();
objText.Small('Hubol was here\nSwag!', { tint: 0xffffff }).at(64, 64).show();
objText.Large2Light('Hubol was here\n(Swag!*)...', { tint: 0xff0040 }).at(48, 96).show();
const o = objText.Large2Light(`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`, { tint: 0xff8040, maxWidth: 256 }).at(2, 189).show(scene.root);
objText.Small2('Hubol was here\nSwag!', { tint: 0x404080 }).at(65, 65).show();
objText.Small2('Hubol was here\nSwag!', { tint: 0x404080 }).at(65, 64).show();
objText.Small2('Hubol was here\nSwag!', { tint: 0xffffff }).at(64, 64).show();
objText.Large2Light('Hubol wagged here\n (Swag!*)...', { tint: 0xff0040 }).at(48, 96).show();
const o = objText.Small2(`Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`, { tint: 0xff8040, maxWidth: 256 }).at(2, 189).show(scene.root);
o.at(0, 0)
// objText.Large2(o.text.toUpperCase(), { tint: 0xff8040, maxWidth: 256 }).show();
// objText.Small(o.text, { tint: 0xff8040, maxWidth: 256 }).at(0, 128).show(scene.root);
objText.MediumDigits('0123456789', { tint: 0xdd7e95 }).at(64, 128).show();

// objText.Large2(`nnonnoonoo nnannooaoo nnbnnooboo nncnnoocoo nndnnoodoo nnennooeoo nnfnnoofoo nngnnoogoo nnhnnoohoo nninnooioo nnjnnoojoo nnknnookoo nnlnnooloo nnmnnoomoo nnpnnoopoo nnqnnooqoo nnrnnooroo nnsnnoosoo nntnnootoo nnunnoouoo nnvnnoovoo nnwnnoowoo nnxnnooxoo nnynnooyoo nnznnoozoo
Expand Down

0 comments on commit 2d5ed8d

Please sign in to comment.