Typophile

Fontlab ligatures with numbers not working

NoahVN

Hi everybody,
I'm new to font design. I just started following some Youtube tutorials and some posts in this website. but I have a few issues with ligatures. I apologize if this topic was already covered.

I wanted to make a font with ligatures of the 4 tones of chinese pin yin.
usually these tones are defined by numbers. from 1 to 4.
so I wanted them to appear when I type a vowel + number. something like this:
a + 1 = ā
a + 2 = á
a + 3 = ă
a + 4 = à
same thing with e i o u
I made new font with Fontlab, added the glyphs a_1, a_2, a_3 and a_4 of the ligatures ā á ă à just to try with these. after it works I will add other vowels. then I made a liga feature
feature liga {
sub a one by a_1;
sub a two by a_2;
sub a three by a_3;
sub a four by a_4;
} liga;

1- In the preview panel I noticed that it works fine in the "OpenType features" panel (left) but it doesn't work in the "preview" panel (middle). is this normal?

2- when I generate the font as otf and then install it in the font folder and try it in MS Word, it didn't work.
it shows a1a2a3a4 instead of āáăà
but when I change the liga feature (removing the numbers) into
feature liga {
sub a b by a_1;
sub a c by a_2;
sub a d by a_3;
sub a e by a_4;
} liga;

it works in MS Word when I type:
a + b = ā
a + c = á
a + d = ă
a + e = à
but this is not how I wanted it. I wanted it with the numbers 1,2,3,4.
so is it not possible to use the numbers (one, two, three...) in the ligatures? or is it an issue with MS Word?
I will be very grateful if anyone has any suggestions.

thank you for your time.

NoahVN

I made such a font and it works as expected in FireFox (I do not use Word).
I think your approach is against the rules of Unicode, but this is quite another problem. Technically there is nothing wrong with your code.

Thanks my friend JanekZ.
I just tried it in HTML document in Firefox and it worked without problems. now I'm confused. is the problem that MS Word doesn't accept ligatures with numbers in them?

could you please explain what you mean by "your approach is against the rules of Unicode"?
thanks a lot.

I think what he means is that you're trying to use OTL as a kludge for something which would be much better achieved through a keyboard layout which either maps the vowel + number sequences to precomposed glyphs or which maps numbers to combining accents.

The problem with what you're doing is that á isn't a ligature of a + 2. By treating it as such, your text stream is still going to consist of a2 even if á appears on screen which is going to interfere with search algorithms, etc., and which means that type entered in your font isn't going to work when you switch to another font.

If you prefer to enter pinyin characters this way, a keyboard layout is going to work with any font which contains the required glyphs, and isn't going to lead to problems with searching or displaying text.

André

Thanks André
"ā á ă à" are already glyphs in the font. so what you said could be right. but what if I make new glyphs that are totally different and want them to react as ligatures and appear when certain characters are accompanied with numbers. will that be possible to be made in the font itself and not in keyboard layout?

thanks a lot.

I cannot support too forcefully the notion that the font is the wrong place to address a matter better handled by input method: for example, if you want to type 2nd-tone "a" in MS Word, you could set its automated spell-checking to replace an "a" followed by a "2" with á. Alternatively, there used to be Word macros for this.

In addition it is worth noting that Unicode officially uses carons (a.k.a. hačeks) rather than breves to indicate pinyin's 3rd tone. Thus Unicode's official description for ǚ (U+01DA) is "Latin small letter u with diaeresis and caron." I wish it were an independent character, just in case I wanted to use a breve, as some folks do, but it isn't. So if I wanted to put 3rd-tone ü in a font with a breve instead of a caron I'd probably still encode it at U+01DA. But in fact I've given in and use carons when adding tone-marked pinyin vowels to a font: Unicode long since decided Chinese was "ideographic" (over sinologists' preferred "logographic"), in comparison with which haček vs. breve is small potatoes.

David

Captured from web.archive.org on 9 Aug 2014. view this capture