How can I adjust the bearings of narrow glyphs, like e.g. l or ismallcapital with wide diacritics or marks that extend over the lsb or rsb of the base, in ad hoc combinations? Say I need to place ismallcapital+dieresiscomb, ismallcapital+overlinecomb, ismallcapital+tildecomb - how do I stop the combinations from overlapping one another?
I include narrow diacritics in my fonts for use with idotless and lowercase l or t.
I think that is a better solution than adjusting the advance widths to avoid clashes.
OK, thank you. That would solve part of the problem.
There are some marks that are supposed to be placed to the left or right of the base - what should I do then?
Plus not all marks can be shrunk that way
Diaeresis can be made narrower by spacing the dots more tightly. Which others cannot have a narrow form?
If the diacritic needs to be placed right or left, use the regular size diacritic.
Which others cannot have a narrow form?
20DB, 20DC, 1DCB, 1DCC, plus whichever of the combining letters happens to be wider than the base.
If the diacritic needs to be placed right or left, use the regular size diacritic.
Yes, and how do I deal with the overlap?
Maybe contextual positioning, but that makes it all rather complex.
Do you maybe have an example that I could work it out from?
I am not sure if this is the way to go, but this works for:
/a/gravecomb/a/gravecomb/a/threedotscomb/a/threedotscomb/i/gravecomb/i/gravecomb/i/threedotscomb/i/threedotscomb
languagesystem latn dflt; # Latin default
@base_all = [a-z idotless];
@base_ij_todotless = [i j jbar];
@mark_top = [gravecomb doubleoverlinecomb threedotscomb];
@mark_wide = [doubleoverlinecomb threedotscomb];
markClass gravecomb <anchor 53 448> @top;
markClass threedotscomb <anchor 0 502> @top;
lookup ccmp_todotless_ref { # GSUB lookup type SingleSubstitution
sub i by idotless;
} ccmp_todotless_ref;
lookup SingleAdjustment1 { # GPOS lookup type SingleAdjustment
pos a 100;
pos idotless 200;
} SingleAdjustment1;
feature ccmp { # Glyph Composition / Decomposition
sub @base_ij_todotless' lookup ccmp_todotless_ref @mark_top;
} ccmp;
feature kern { # Kerning
pos @base_all' lookup SingleAdjustment1 @mark_top @base_all @mark_wide;
pos @base_all' lookup SingleAdjustment1 @mark_wide @base_all @mark_top;
pos @base_all' lookup SingleAdjustment1 @mark_wide @base_all @mark_wide;
} kern;
feature mark { # Mark Positioning
pos base a <anchor 245 450> mark @top;
pos base idotless <anchor 163 587> mark @top;
} mark;
Great, thank you - I’ll give it a go
Maybe contextual positioning, but that makes it all rather complex.
I’ve tested it and worked out how it works, and indeed it’s complex to implement well for all the various combinations. A nice trick would be to be able to make use of base(), lsb(…), rsb(…). E.g. to keep LSB/RSB set to base() for those marks that don’t extend beyond the original glyph, but to have an OT rule to apply lsb(…), rsb(…) to combinations that do. It might be tricky to implement for ad hoc, but less so for composites with code-points. What do you think?
I am afraid this is getting too specialized for us to implement. We have spent a lot of time and resources in making the OpenType Designer, so you can manually add these kinds of features.
So it’s not possible to define and pass a variable instead of specific number to the GPOS lookup type SingleAdjustment from your example? When I try to input sth else than a number in the CodeEditor, I get an error saying “Named value record … not found” - can I create such a named value?
No, that is not possible.