I am trying to write a feature to avoid the hyphenation of certain digraphs in Basque language (e.g. tx, tz, dd, tt...). Hyphenation plug-ins don't work very well for Basque and disconnecting those digraphs is considered unacceptable in a formal text. I thought it could be solved through localized substitutions (locl) of these combinations by their respective ligatures. Apparently I was wrong. Ligatures seem to substitute the digraphs at a presentation level, but they are still coded as two letters (which make sense on the other hand) and they remain subject to hyphenation when the edge of the column is close enough.
I also considered using wordjoiner (U2060) or zerowidthjoiner (200D) to keep the two letters together but a) It would involve a third glyph and I don't know if such substitution is posible (I mean, substituting two glyphs by three), and b) if the former is possible, would it remain the same word, a different word or two distinct words?
Comments
@Kent Lew
"rlig" does not solve the problem. Not in inDesign at least, which is the software we are using to test the font, and the one that will be more likely to be used by potential users here. It behaves the same way other kind of ligatures do in this respect.
@Kent Lew @John Hudson
I agree, this issue should be addressed at a character processing and line-layout level. There are actually some attempts but, besides not being reliable enough the range of software they cover is pretty short (e.g inDesign versions from CS6 on are not covered). I was looking for a provisional solution to circumvent a very common problem among graphic designers laying out Basque texts.
As John anticipated, the trick of inserting the wordjoiner U+2060 did not work. It seems the solution will have to come from the developers of the plug-ins and a good management and implementation of hyphenation dictionaries.
Anyway, thank you very much for your comprehensive and informative replays
Sounds pretty damn smart to me
I will definitely try and let you know the result :-) Many thanks!
Character style:
Paragraph style:
(As InDesign interface does not shows the whole GREP code, I copied it in red.)
The GREP code means: find a digraph (dd or ll or rr or ts or tt or tx or tz) preceeded by a vowel (?<=) and followed by a vowell (?=) and attribute the Nobreak style to it.
I build it supposng that digraphs in Basque are always preceeded and followed by vowels. If this is not true, the GREP code could be improved, but the idea is the same and so you don't need to edit the font.
Now, not being a native Basque speaker, I am uncertain how well it works in wider usage than I have done (everything gets run past editors and I don't always see the results of edits).
If you want a Zipped bundle, let me know and I can get it to you.
Mike
But then I tried something else. I made a stylistic set with much smaller letters. But the line breaks are calculated from the default glyphs and not from the shorter alternates. In my case, the stylistic alternates would have made the word fit the line easily bit it would still break. I know that this is very difficult to compute because the opentype feature changes the context that was is basis. But it is still disappointing.
The trick is to give both the default left letter glyph and the default hyphen extra wide right sidebearings.
I’m not sure how robust this method is in other applications, or what the optimum width of the super-wide glyphs should be.