Skip to content

Commit

Permalink
only embed fonts the current themes are using
Browse files Browse the repository at this point in the history
This brings down web-test.wasm to 2.2M
  • Loading branch information
david-vanderson committed Jan 13, 2025
1 parent ef44876 commit bfad947
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Font.zig
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,27 @@ pub const TTFBytes = struct {
pub const Aleo = @embedFile("fonts/Aleo/static/Aleo-Regular.ttf");
pub const AleoBd = @embedFile("fonts/Aleo/static/Aleo-Bold.ttf");
pub const Vera = @embedFile("fonts/bitstream-vera/Vera.ttf");
pub const VeraBI = @embedFile("fonts/bitstream-vera/VeraBI.ttf");
//pub const VeraBI = @embedFile("fonts/bitstream-vera/VeraBI.ttf");
pub const VeraBd = @embedFile("fonts/bitstream-vera/VeraBd.ttf");
pub const VeraIt = @embedFile("fonts/bitstream-vera/VeraIt.ttf");
pub const VeraMoBI = @embedFile("fonts/bitstream-vera/VeraMoBI.ttf");
pub const VeraMoBd = @embedFile("fonts/bitstream-vera/VeraMoBd.ttf");
pub const VeraMoIt = @embedFile("fonts/bitstream-vera/VeraMoIt.ttf");
//pub const VeraIt = @embedFile("fonts/bitstream-vera/VeraIt.ttf");
//pub const VeraMoBI = @embedFile("fonts/bitstream-vera/VeraMoBI.ttf");
//pub const VeraMoBd = @embedFile("fonts/bitstream-vera/VeraMoBd.ttf");
//pub const VeraMoIt = @embedFile("fonts/bitstream-vera/VeraMoIt.ttf");
pub const VeraMono = @embedFile("fonts/bitstream-vera/VeraMono.ttf");
pub const VeraSe = @embedFile("fonts/bitstream-vera/VeraSe.ttf");
pub const VeraSeBd = @embedFile("fonts/bitstream-vera/VeraSeBd.ttf");
//pub const VeraSe = @embedFile("fonts/bitstream-vera/VeraSe.ttf");
//pub const VeraSeBd = @embedFile("fonts/bitstream-vera/VeraSeBd.ttf");
pub const Pixelify = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-Regular.ttf");
pub const PixelifyBd = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-Bold.ttf");
pub const PixelifyMe = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-Medium.ttf");
pub const PixelifySeBd = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-SemiBold.ttf");
pub const Hack = @embedFile("fonts/hack/Hack-Regular.ttf");
pub const HackBd = @embedFile("fonts/hack/Hack-Bold.ttf");
pub const HackIt = @embedFile("fonts/hack/Hack-Italic.ttf");
pub const HackBdIt = @embedFile("fonts/hack/Hack-BoldItalic.ttf");
//pub const PixelifyBd = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-Bold.ttf");
//pub const PixelifyMe = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-Medium.ttf");
//pub const PixelifySeBd = @embedFile("fonts/Pixelify_Sans/static/PixelifySans-SemiBold.ttf");
//pub const Hack = @embedFile("fonts/hack/Hack-Regular.ttf");
//pub const HackBd = @embedFile("fonts/hack/Hack-Bold.ttf");
//pub const HackIt = @embedFile("fonts/hack/Hack-Italic.ttf");
//pub const HackBdIt = @embedFile("fonts/hack/Hack-BoldItalic.ttf");
pub const OpenDyslexic = @embedFile("fonts/OpenDyslexic/compiled/OpenDyslexic-Regular.otf");
pub const OpenDyslexicBd = @embedFile("fonts/OpenDyslexic/compiled/OpenDyslexic-Bold.otf");
pub const OpenDyslexicIt = @embedFile("fonts/OpenDyslexic/compiled/OpenDyslexic-Italic.otf");
pub const OpenDyslexicBdIt = @embedFile("fonts/OpenDyslexic/compiled/OpenDyslexic-Bold-Italic.otf");
//pub const OpenDyslexicIt = @embedFile("fonts/OpenDyslexic/compiled/OpenDyslexic-Italic.otf");
//pub const OpenDyslexicBdIt = @embedFile("fonts/OpenDyslexic/compiled/OpenDyslexic-Bold-Italic.otf");
};

pub fn initTTFBytesDatabase(allocator: std.mem.Allocator) !std.StringHashMap([]const u8) {
Expand Down

0 comments on commit bfad947

Please sign in to comment.