Fontforge Scripting how to add ligatures for a glyph

岁酱吖の 提交于 2019-12-05 05:52:22

You need to specify the Ligature substitution using a tuple of existing Glyph names. A contrived example:

ligature_name = 'f_l'
ligature_tuple = ('f', 'l')
font.AddLookup('ligatures','gsub_ligature', (),[['rlig',[['arab',['dflt']]]]])
font.AddLookupSubtable('ligatures', 'ligatureshi')
glyph = font.createChar(-1, ligature_name)
glyph.addPosSub('ligatureshi', ligature_tuple)

After you've added the lookup & subtable, do this:

Select("fl")
AddPosSub("LigatureSubtableName", "f l")

The above FontForge script will add a fl ligature.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!