kreativekorp / bitsnpicas

Bits'N'Picas - Bitmap & Emoji Font Creation & Conversion Tools
323 stars 24 forks source link

Feature request: Add ligature support #49

Open D-u-c-k-s-e-l opened 7 months ago

D-u-c-k-s-e-l commented 7 months ago

I would love to be able to create ligatures with this app.

diaowinner commented 6 months ago

Bits'n'Picas doesn't support ligature and many other OT features. However, you can use feaLib in fonttools to add OT features.

# Generate ttf
bitsnpicas convertbitmap -f ttf -o FONT_base.ttf FONT.kbitx

# Generate otb
bitsnpicas convertbitmap -f otb -o FONT_base.otb FONT.kbitx

# Add OpenType features (Bits'n'Picas cannot do this itself)
fonttools feaLib -o FONT.ttf FONT.fea FONT_base.ttf
fonttools feaLib -o FONT.otb FONT.fea FONT_base.otb

rm *_base.ttf
rm *_base.otb

Here is a sample feature file which replaces yi into glyph u4e00 ():

feature rlig {
  lookup LigaTest {
    sub y i by u4e00;
  } LigaTest;
} rlig;

Here and here is the docs of the .fea file and the feaLib tool.