typemytype / drawbot

http://www.drawbot.com
Other
406 stars 63 forks source link

Cannot use font’s .notdef glyph in FormattedString #532

Open frankrolf opened 1 year ago

frankrolf commented 1 year ago

I would like to use a font’s built-in .notdef glyph in a FormattedString – however, it seems that DrawBot explicitly disallows this:

newPage()
fs = FormattedString(
    fontSize=120,
    font='Menlo'
    )

fs.appendGlyph('Adieresis')  # append by glyph name
fs.appendGlyph(100)  # append by GID
fs.appendGlyph('.notdef')  # does not work
fs.appendGlyph(0)  # does not work

text(fs, (100, 100))

The workaround I am currently using is a fallback font to represent the .notdef glyph (Adobe NotDef), but I’d be curious to find out if there’s a way to use the built-in glyph instead.

Thanks!