Accents on discretionary ligatures

Raphael Daudelin's picture

I'm adding Opentype features to a font for the first time. I have already added two sets of alternates and a set of discretionary ligatures. Most of the ligatures I want are made and I would like to add accents on some of them using anchors. Here's an example:

When I look at the preview, everything seems to be ok, but when I'm trying to generate composite, it doesn't work as you can see in the next picture.

The accents are positioned correctly but the ligature are replaced by both glyphs.

When I'm trying to positioned the accent on the second letter within the ligature. The preview is still correct:

When I generate composite, the ligature is still replaced by both glyphs, the position of the accent is not above the right part of the ligature and is too low:

Anyone knows what I'm doing wrong
Thanks

Raphael

k.l.'s picture

As regards the wrongly placed accents (your last screenshot):
If you add a tilde before each accent name in your glyph composition text like
    C_A+~acute=C_Acute
this will prevent FLS5 from performing some positioning tricks. If you click the green button with a questionmark in it (bottom right of the Generate Glyphs ... dialog), a dialog will show some more information.

As regards decomposition of ligature into individual glyphs:
FLS5's glyph generation mechanism has a built-in trick that, if you provide a glyph name that involves underscores like
    C_A+dieresis
then FLS will ignore the part after the '=' and instead use the 'components' as found in the 'C_A' name, i.e. 'C' and 'A'. I have not found a way to avoid this -- except for, temporarily, replacing the underscore in the ligatures' glyph names by another character or string.

Raphael Daudelin's picture

I've tried to add the tilde before each accent name in the glyph composition text and it didn't work. But when I changed temporarily the glyph name for ’CA’ instead of ’C_A’ the composite were generated perfectly. Of course, it's not the best solution because I have to rename each composite but at least it works.

Thanks

k.l.'s picture

You could use a little script like:

sr = ("_","!!!")
#sr = ("!!!","_")
for g in fl.font.glyphs: g.name = str(g.name).replace(sr[0],sr[1])
fl.UpdateFont(fl.ifont)
print "done!"

Copy/paste into the Macros Panel. You'll need to replace typographic quotes by simple ones.
Before generating glyphs, run the script with the second "sr = ..." line commented out. After generating glyphs, run it again but with the first "sr = ..." line commented out. (Of course you'll need to do a search/replace in your glyph composition text too.)

paul d hunt's picture

this is why i actually prefer visually ligating contextual alternates rather than single glyphs to solve problems such as these.

Raphael Daudelin's picture

Regarding the script. I'm really not sure to get it, never worked with macros before. This script is made for renaming the font before generating composite and then renaming them again when the composite have been generated???

I paste it in the macro panel, but as soon as I replace the typographic quotes by simple quotes the first line:

sr = (“_”,”!!!”)

becomes red.

I'm not sure either of what you mean by saying to run the script with the second “sr = ...” line commented.

Well, I guess I still have a lot of reading to do about macros

twardoch's picture

This is a bug. We will need to correct it in FLS6.

Cheers,
Adam

Raphael Daudelin's picture

Ok Sorry about my last post. I may sounded really lost. After examining the script better I get it. It works!

Now I do understand that the first line of the script says to replace underscore in all glyph names by !!!, and that the second line is says to replace !!! by the underscore. I also get what meant first line commented out.

I'm still a bit lost when I try to understand what everything stands for in the last three lines of the script, but I'll try to sort it out.

Anyway, thanks for that scripting introduction. I understand that it can saves me a lot of time.

Raphael

k.l.'s picture

Good you found out how to make it work!

this is why i actually prefer visually ligating contextual alternates rather than single glyphs to solve problems such as these.

I prefer (individual) contextual alternates too, but because it is the more elegant solution on the font level (as to the ligatures shown above, the one-glyph solution is fine), not because of an editor's restrictions and so have my own method for glyph composition.

Syndicate content Syndicate content