summaryrefslogtreecommitdiff
path: root/build.zig.zon.nix
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2025-07-05 14:37:46 -0700
committerGitHub <noreply@github.com>2025-07-05 14:37:46 -0700
commitb799462745ef25153dbcbe79e67d170b5101fc6b (patch)
treef5383e5ac4a76181bafb35a137121057d5a3f99e /build.zig.zon.nix
parentd772b2ce39fe9e4d6364515ad6dd567130483af0 (diff)
parent9ff77a56226ad482ad4740726c8a85ca834d37fe (diff)
Better Glyph Constraint Logic (#7809)
This is a big'un. - **Glyph constraint logic is now done fully on the CPU** at the rasterization stage, so it only needs to be done once per glyph instead of every frame. This also lets us eliminate padding between glyphs on the atlas because we're doing nearest-neighbor sampling instead of interpolating-- which ever so slightly increases our packing efficiency. - **Special constraints for nerd font glyphs** are applied based roughly on the constraints they use in their patcher. It's a simplification of what they do, the largest difference being that they scale groups of glyphs based on a shared bounding box so that they maintain relative size to one another, but that would require loading all glyphs on the group and I'd want to do that on font load TBH and at that point I'd basically be re-implementing the nerd fonts patcher in Zig to patch fonts at load time which is way beyond the scope I want to have. (Fixes #7069) - These constraints allow for **perfectly sized and centered emojis**, this is very nice. - **Changed the default embedded fonts** from 4 copies (regular, italic, bold, bold italic) of a patched (and outdated) JetBrains Mono to a single JetBrains Mono variable font and a single Nerd Fonts Symbols Only font. This cuts the weight of those down from 9MB to 3MB! - **FreeType's `renderGlyph` is significantly reworked**, and the new code is, IMO, much cleaner- although there are probably some edge case behavior differences I've introduced. > [!NOTE] > One breaking change I definitely introduced is changing the `monochrome` freetype load flag config from its previous completely backwards meaning to instead the correct one (I also changed the default, so this won't affect any user who hasn't touched it, but users who set the `monochrome` flag will find their fonts quite crispy after this change because they will have no anti-aliasing anymore) ### Future work Following this change I want to get to work on automatic font size matching (a la CSS [`font-size-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust)). I set the stage for that quite some time ago so it shouldn't be too much work and it will be a big benefit for users who regularly use multiple writing systems and so have multiple fonts for them that aren't necessarily size-compatible.
Diffstat (limited to 'build.zig.zon.nix')
-rw-r--r--build.zig.zon.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/build.zig.zon.nix b/build.zig.zon.nix
index 9d50a6fc6..52260181e 100644
--- a/build.zig.zon.nix
+++ b/build.zig.zon.nix
@@ -170,6 +170,14 @@ in
};
}
{
+ name = "N-V-__8AAIC5lwAVPJJzxnCAahSvZTIlG-HhtOvnM1uh-66x";
+ path = fetchZigArtifact {
+ name = "jetbrains_mono";
+ url = "https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz";
+ hash = "sha256-xXppHouCrQmLWWPzlZAy5AOPORCHr3cViFulkEYQXMQ=";
+ };
+ }
+ {
name = "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD";
path = fetchZigArtifact {
name = "libpng";
@@ -194,6 +202,14 @@ in
};
}
{
+ name = "N-V-__8AAMVLTABmYkLqhZPLXnMl-KyN38R8UVYqGrxqO26s";
+ path = fetchZigArtifact {
+ name = "nerd_fonts_symbols_only";
+ url = "https://deps.files.ghostty.org/NerdFontsSymbolsOnly-3.4.0.tar.gz";
+ hash = "sha256-EWTRuVbUveJI17LwmYxDzJT1ICQxoVZKeTiVsec7DQQ=";
+ };
+ }
+ {
name = "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c";
path = fetchZigArtifact {
name = "oniguruma";