lcdf-typetools icon indicating copy to clipboard operation
lcdf-typetools copied to clipboard

Generate pre-composed glyphs using advanced OpenType features.

Open krfkeith opened this issue 8 years ago • 3 comments

Often times, there is a glyph one might want that doesn't exist with it's own slot in the font itself. Unfortunately, using LaTeX to create accented characters has serious drawbacks: not the least of which is that it's impossible to create characters with double diacritics without extra packages and manual tweaking. Furthermore, this doesn't take advantage of OpenType's advanced positioning features to achieve optimal results. What I am looking for is some sort of feature wherein you specify a character and one or more combining characters, and otftotfm would then synthesize this character and put it in whatever slot specified.

krfkeith avatar Jan 05 '17 17:01 krfkeith

Can you give a specific example of how this might work, or a font that lacks a specific glyph?

kohler avatar Jan 06 '17 20:01 kohler

A good example would be letter with double diacritics. For example, the capital A with macron and acute accent doesn't exist as a precomposed glyph in Unicode, and as such it doesn't have a slot in most fonts. Nevertheless, OpenType fonts can specify how to place accents in such scenarios. For example, here is how the character is supposed to look in Libertine:

screenshot_117

However, since this character doesn't exist precomposed in the Libertine font, there's no way to access the advanced placement features from within pdfTeX. The only way to even sort of getting anything approximating this character is the \twoacc command from the covington package, and even that doesn't work very well:

screenshot_118

As you can see, the accent is way too high up, but even if it weren't it doesn't look as good as the former. Ideally, there we would be a way to "synthesize" these missing glyphs on the fly, using the OpenType rules. Something maybe like:

% SYNTHESIZE Amacron acute := Amacronacute

where the generated glyph would be available under the name Amacronacute. In addition, this would prove useful for generating pseudo-ligatures in place of opentype contextual substitutions. For example, many fonts will substitute an 'f' character which is less wide before characters like 'ä'

% SYNTHESIZE f.short adieresis := f_adieresis
% LIGKERN f adieresis := f_adieresis

krfkeith avatar Jan 10 '17 21:01 krfkeith

It might simply work to add a character such as “Amacron_acute” to the encoding. Have you tried something like that?

kohler avatar Feb 23 '18 16:02 kohler