summaryrefslogtreecommitdiff
path: root/src/font/DeferredFace.zig
AgeCommit message (Collapse)Author
2025-08-21font: fix fontconfig leaks in unit testsMitchell Hashimoto
2025-05-26style: use decl literalsQwerasd
This commit changes a LOT of areas of the code to use decl literals instead of redundantly referring to the type. These changes were mostly driven by some regex searches and then manual adjustment on a case-by-case basis. I almost certainly missed quite a few places where decl literals could be used, but this is a good first step in converting things, and other instances can be addressed when they're discovered. I tested GLFW+Metal and building the framework on macOS and tested a GTK build on Linux, so I'm 99% sure I didn't introduce any syntax errors or other problems with this. (fingers crossed)
2025-05-01fix(tests): correctly deinit font facesQwerasd
2025-05-01font/freetype: introduce mutexes to ensure thread safety of Library and FaceQwerasd
For details see comments and FreeType docs @ https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_face tl;dr: FT_New_Face and FT_Done_Face require the Library to be locked for thread safety, and FT_Load_Glyph and FT_Render_Glyph and friends need the face to be locked for thread safety, since we're sharing faces across threads.
2024-11-05coretext: set variations on deferred face loadMitchell Hashimoto
This commit makes CoreText behave a lot like FreeType where we set the variation axes on the deferred face load. This fixes a bug where the `slnt` variation axis could not be set with CoreText with the Monaspace Argon Variable font. This was a bug found in Discord. Specifically, with the Monaspace Argon Variable font, the `slnt` variation axis could not be set with CoreText. I'm not sure _exactly_ what causes this but I suspect it has to do with the `slnt` axis being a negative value. I'm not sure if this is a bug with CoreText or not. What was happening was that with CoreText, we set the variation axes during discovery and expect them to be preserved in the resulting discovered faces. That seems to be true with the `wght` axis but not the `slnt` axis for whatever reason.
2024-08-24font: support variations for coretext_freetype backendMitchell Hashimoto
2024-08-05chore: clean up typosƁukasz Niemier
2024-05-28font: remove deferred face todo, note whyMitchell Hashimoto
2024-05-28font: handle presentation at glyph layerMitchell Hashimoto
2024-05-09fix point size typeQwerasd
2024-05-01font: noop shaperMitchell Hashimoto
2024-04-30build: add -Dfont-backend=coretext_harfbuzz to force Harfbuzz w/ CTMitchell Hashimoto
2024-04-05font: remove unused structMitchell Hashimoto
2023-11-17change unmodified `var`s to `const`s in anticipation of zig changesKrzysztof Wolicki
2023-10-05font: fix failing macos testsMitchell Hashimoto
2023-10-04font: modify font compiles for freetypeMitchell Hashimoto
2023-10-04font: wire up all the metric modifiersMitchell Hashimoto
2023-10-04font: rework font init to use a struct with modifiersets everywhereMitchell Hashimoto
2023-10-03font/fontconfig: adhere to correct function signatureMitchell Hashimoto
2023-10-03font/coretext: score discovered fontsMitchell Hashimoto
2023-09-24font: CoreText discovery searches monospace only by defaultMitchell Hashimoto
2023-09-13font: fallback search must verify presentationMitchell Hashimoto
2023-08-28font: freetype supports font variation settingsMitchell Hashimoto
2023-08-25font: fontconfig adaptations to new apiMitchell Hashimoto
2023-08-25font: DeferredFace.name takes a bufferMitchell Hashimoto
2023-08-25font: DeferredFace can no longer represent a loaded faceMitchell Hashimoto
2023-08-25font: move auto-italicization to GroupMitchell Hashimoto
2023-07-03font: share skew matrix for core textMitchell Hashimoto
2023-07-03font: support skew transform for auto-italicsMitchell Hashimoto
2023-06-30Update Zig (#164)Mitchell Hashimoto
* update zig * pkg/fontconfig: clean up @as * pkg/freetype,harfbuzz: clean up @as * pkg/imgui: clean up @as * pkg/macos: clean up @as * pkg/pixman,utf8proc: clean up @as * clean up @as * lots more @as cleanup * undo flatpak changes * clean up @as
2023-06-25Update zig, mach, fmtMitchell Hashimoto
2023-05-31font: if CoreText needs to allocate, stack allocate and logMitchell Hashimoto
2022-12-07font: web canvas face has to render to check presentation for cpMitchell Hashimoto
Since we have no way to detect our presentation (text/emoji), we need to actually render the glyph that is being requested to double-check that the glyph matches our supported presentation. We do this because the browser will render fallback fonts for a glyph if it can't find one in the named font.
2022-12-06font: web canvas can render emojiMitchell Hashimoto
2022-12-05font: DeferredFace is wasm-compatibleMitchell Hashimoto
2022-12-05font: begin making Group work with wasmMitchell Hashimoto
2022-12-01Start scaffolding web_canvas backendMitchell Hashimoto
2022-10-16Bring back freetype font bitmap conversionMitchell Hashimoto
Monaco on Mac is mono
2022-10-09font: deferred face can load core text backendMitchell Hashimoto
2022-10-08fix compilationMitchell Hashimoto
2022-10-08font: coretext face presentationMitchell Hashimoto
2022-10-08Make font face a compile time interface, stub for coretextMitchell Hashimoto
2022-10-02font: set "backend" enum vs booleansMitchell Hashimoto
2022-10-01Mac Font Discovery with CoreText (#17)Mitchell Hashimoto
This implements font discovery so the `--font-family` flag works for macOS. Fonts are looked up using the Core Text API so any installed font on the Mac system can be used. We still use FreeType for rendering, and CoreText doesn't _quite_ give us all the information we need to build the exact face in FreeType. So a TODO after this is to now implement glyph _rendering_ using Core Text and Core Graphics. Until then, a couple fonts don't quite work (i.e. Monaco, a big one!) but many do!
2022-09-29search for fonts on startupMitchell Hashimoto
2022-09-24font: test loading deferred face for fontconfigMitchell Hashimoto
2022-09-23src/font: working on initiaizing deferred fonts from fcMitchell Hashimoto
2022-09-23store requested size alongside deferred font for loadingMitchell Hashimoto
2022-09-23font group works with deferred faces exclusivelyMitchell Hashimoto
2022-09-23font discovery builds up a set of deferred facesMitchell Hashimoto