mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00

Most emoji fonts are massive glyphs (128x128, 256x256, etc.). This means the texture we need to store emoji is also massive. For a 128x128 emoji font (both Apple and Noto), we can only store 12 emoji before resizing prior to this commit. This commit now threads through a max height through to the font face and resizes the bitmap in memory before putting it in the atlas. This results in significant savings. The max height is the cell height. We allow the glyphs to be as wide as necessary due to double (and more) wide glyphs. For the unicode emoji test file, the atlas size before and after: Before: 262 MB After: 16 MB
8 lines
116 B
Zig
8 lines
116 B
Zig
pub usingnamespace @cImport({
|
|
@cInclude("stb_image_resize.h");
|
|
});
|
|
|
|
test {
|
|
// Needed to not crash on test
|
|
}
|