Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional Harfbuzzy-backed text shaping path while keeping Pixie as the default text backend. The branch moves FigDraw text layout toward glyph-id-first rendering, adds source-range and caret mapping helpers for shaped text, and includes a Windy demo for Arabic/Hebrew shaping using bundled OFL Noto fonts.
Changes
figdrawTextBackendcompile-time backend selection:pixieremains the default.hybriduses Harfbuzzy layout with Pixie-compatible rasterization.harfbuzzyuses Harfbuzzy shaping plus glyph-id rasterization.FontGlyphIdGlyphSourceRangeArrangedGlyphGlyphArrangement.sourceRunesGlyphArrangement.arrangedGlyphsfontId + glyphId.docs/font_shaping.md.examples/windy_text_shaping_demo.nim, defaulted to Harfbuzzy viaexamples/windy_text_shaping_demo.nims.Testing
Ran:
nim r -d:figdrawTextBackend=harfbuzzy tests/tfontutils.nimnim r -d:figdrawTextBackend=hybrid tests/tfontutils.nimnim r tests/tfontutils.nimnim testnim r -d:figdraw.runOnce examples/windy_text_shaping_demo.nimAlso verified the demo sidecar
.nimsloads and reportsbackend=harfbuzzy.Notes
The Harfbuzzy integration is compile-time gated and does not expose HarfBuzz handles through FigDraw’s public node APIs. Pixie remains the default backend.