Open felipesanches opened 8 years ago
Same issue with:
Hi,
I'm implementing basic ligature support. I plan to keep the current behavior of Font.prototype.charToGlyph
and Font.prototype.charToGlyphIndex
(1:1 mapping), and to make glyph substitutions in Font.prototype.stringToGlyphs
.
What do you think ?
If it helps, here’s a test suite; feel free to use it: https://github.com/unicode-org/text-rendering-tests
You can also try fontkit, which has OpenType/AAT layout engines for complex scripts.
I think it's a good idea to keep charToGlyph
and charToGlyphIndex
, and add "plural" variants for complex scripts. (We have a similar approach with Glyph.unicode
and Glyph.unicodes
)
@brawer It'd be great to use your test suite with opentype.js . Are there any GSUB tests planned ?
// Convert the given character to a single Glyph object. // Note that this function assumes that there is a one-to-one mapping between // the given character and a glyph; for complex scripts this might not be the case. Font.prototype.charToGlyph = function(c) { ...