Guess glyph string for placeholder glyphs without code points - #2010
Conversation
7d8e70c to
5b939de
Compare
|
Thank you very much! I wonder if the same can be achieved with the "associatedCodePoints" feature. This does roughly the same (including the "_" split), except it also takes the font's cmap/glyphMap into account, and only falls back to glyphs-data if the font doesn't define the base glyph name. I think we can add Alternatively, we could consider decoupling the making of the placeholder string from the GlyphCell completely, and pass the placeholder string as an additional argument to the GlyphCell constructor. As for the placeholder string in the canvas: let's indeed focus on the GlyphCell first, and I'll try to figure out what we need to do to make it work in the canvas, too. |
5b939de to
01a4a14
Compare
The main difference between Take for example the four glyphs Is there is a way to achieve this with |
3e9ce97 to
ef62a08
Compare
c4e779c to
ed23009
Compare
|
(Thanks for keeping this up to date, I'll try to continue reviewing this soon. I am eager to land this feature.) |
ed23009 to
bb3b0ae
Compare
justvanrossum
left a comment
There was a problem hiding this comment.
This is looking very good, thank you. I left some minor notes, and a suggestion how to maybe fix the context.direction = "rtl"; line.
Guess placeholder string from glyph name for glyphs without code points. Checks for the extensions used for Arabic positional forms and add Zero Width Joiner as appropriate to force the desired positional form. The glyph-shape-placeholder div needs dir="auto" as ZWJ gets ignored at string boundaries if text direction is LTR (which is the default in HTML). With dir="auto", the direction will be resolved based on the string, so it will be RTL for Arabic text.
bb3b0ae to
3ffe090
Compare
If one of the ligature components is an unknown glyph name, don’t return a partial string covering the other components only.
See the discussion in #2005
This works in the font overview, but I didn’t manage to find the relevant code in editor, so editing such glyphs still does not shows blank placeholder.