Modifying Charis SIL with FontForge

yaoziyuan's picture

Hi All,

I'm new to FontForge and font editing in general. I simply want to modify the outlines of certain glyphs in Charis SIL. FontForge is the font editor I'm currently trying because it's free.

My problem is, after modifying the font in FontForge and saving, the resulting font no longer has Graphite features such as stacking combining diacritics. Apparently the Graphite tables in the font are lost in the new font.

Can anyone tell me the proper way to modify and save Charis SIL with FontForge (or any other free font editor)?

Regards,
Ziyuan Yao

George Thomas's picture

You might have better luck with your question if you join the FontForge List at sourceforge.net. There is a User List there and the FontForge developers read it as well.

Karl Stange's picture

You may also find the Graphite support pages on the SIL website useful:

http://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=gra...

Michel Boyer's picture

Here is a suggestion that may work, if you want to keep all tables intact: try ttx. It comes with AFDKO, the Adobe Font Development Kit for OpenType (which provides other tools to manipulate font tables).

Once ttx is installed, I suggest you decompile only the glyf and the name table with the line command:

   ttx -t name -t glyf CharisSIL-R.ttf

This creates the file CharisSIL-R.ttx (if you repeat, a version number is added to the name).

If you already designed your modified glyph, you apply ttx -t glyf on that font; for example, if the glyph you modified is ccedilla, then replace the text in CharisSIL-R.ttx between

<TTGlyph name="ccedilla" xMin="66" yMin="-457" xMax="825" yMax="1012">

and the closing

</TTGlyph>

with the new description of ccedilla figuring in the ttx file of your new set of glyphs. You also change the font names according to your needs (and the EULA) in the name table.

You finally apply

   ttx -m CharisSIL-R.ttf CharisSIL-R.ttx

to obtain your new font file CharisSIL-R#1.ttf which is likely to work better than the font you generated with fontforge.

I used a variation of that method with AAT fonts and it saved me many calls to the standard tool to generate AAT fonts. If it works fine for you with Graphite tables, please keep us informed.

Here, I presume you keep the character width intact as well as its position in the bounding box (else you will need to work harder).

yaoziyuan's picture

Hi Michel,

Your method works great.

Actually, I want to stretch
uni0351 (COMBINING LEFT HALF RING ABOVE),
uni0357 (COMBINING RIGHT HALF RING ABOVE) and
uni030D (COMBINING VERTICAL LINE ABOVE),
so that they can be viewed more easily at small font sizes.

Now it seems this also involves changing these glyphs' bounding boxes. What else should I do to achieve this?

Regards,
Ziyuan Yao

yaoziyuan's picture

Hi Michel,

Now I figured out how to change a glyph's width too: the glyph's "mtx" attribute in the "hmtx" table has to be changed accordingly.

The project in question is "Phonetically Intuitive English" (https://sites.google.com/site/phoneticallyintuitiveenglish/). I will mention you in its Acknowledgments :-)

Regards,
Ziyuan Yao

Michel Boyer's picture

Great! Here is something faster (and that worked for me). Instead of text editing (or xml parsing) the file CharisSIL-R.ttx generated from CharisSIL-R.ttf, you can merge full tables of the new font generated by FontForge into CharisSIL-R.ttf ; choose "Reencode > Glyph Order" in FontForge before generating the new font and then execute ttx -m CharisSIL-R.ttf newfont.ttx with newfont.ttx containing just the replacement tables from the new font (the ttf that is generated is named newfont... ).

Michel Boyer

Michel Boyer's picture

I think this thread should be moved from "general discussion" to the build forum

yaoziyuan's picture

Is "Reencode > Glyph Order" necessary? Why?

Michel Boyer's picture

I just checked with Charis in the present context, with ttx and fontforge, and the reordering does not seem necessary. The other tools I was using required it. That is something I experimented about 18 months ago (during my summer vacations) and that was left undocumented.

Syndicate content Syndicate content