Fix font fallback by computing map_len in fill_cluster_in_place#566
Open
devunt wants to merge 1 commit intolinebender:mainfrom
Open
Fix font fallback by computing map_len in fill_cluster_in_place#566devunt wants to merge 1 commit intolinebender:mainfrom
devunt wants to merge 1 commit intolinebender:mainfrom
Conversation
map_len was hardcoded to 0, which caused Mapper::map() to short-circuit and return 1.0 (complete match) for every font candidate. This effectively disabled all font fallback — the first candidate always won regardless of actual glyph coverage. Emoji sequences, for example, would be shaped with the primary text font (.notdef glyphs) instead of falling back to an emoji font. Compute map_len as the count of characters where contributes_to_shaping is true, matching the semantics expected by Mapper::map().
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.
char_cluster.map_lenis hardcoded to0, which causesMapper::map()to short-circuit and return1.0(complete match) for every font candidate. This effectively disables all font fallback, as the first candidate always wins regardless of actual glyph coverage. For example, emoji sequences are shaped with the primary text font, producing.notdefglyphs instead of falling back to an emoji font.This fix computes
map_lenas the count of characters wherecontributes_to_shapingis true, matching the semantics expected byMapper::map().