ad hoc narrow base + wide mark combos, overlap

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Post Reply
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

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?
ismallcapital.png
ismallcapital.png (3.99 KiB) Viewed 2175 times
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9877
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: ad hoc narrow base + wide mark combos, overlap

Post by Bhikkhu Pesala »

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.
Narrow diacritics.png
Narrow diacritics.png (6.47 KiB) Viewed 2173 times
Combining Diacritics.png
Combining Diacritics.png (9.65 KiB) Viewed 2171 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

Re: ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

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 :(
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9877
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: ad hoc narrow base + wide mark combos, overlap

Post by Bhikkhu Pesala »

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.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

Re: ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

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?
Erwin Denissen
Moderator
Moderator
Posts: 11158
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: ad hoc narrow base + wide mark combos, overlap

Post by Erwin Denissen »

NinnaD wrote: Mon May 30, 2022 6:21 am
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.
Erwin Denissen
High-Logic
Proven Font Technology
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

Re: ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

Do you maybe have an example that I could work it out from?
Erwin Denissen
Moderator
Moderator
Posts: 11158
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: ad hoc narrow base + wide mark combos, overlap

Post by Erwin Denissen »

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

Code: Select all

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;
widemarks.png
widemarks.png (144.87 KiB) Viewed 2143 times
Erwin Denissen
High-Logic
Proven Font Technology
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

Re: ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

Great, thank you - I'll give it a go :)
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

Re: ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

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?
Erwin Denissen
Moderator
Moderator
Posts: 11158
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: ad hoc narrow base + wide mark combos, overlap

Post by Erwin Denissen »

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.
Erwin Denissen
High-Logic
Proven Font Technology
NinnaD
Posts: 200
Joined: Mon Feb 15, 2021 8:06 pm

Re: ad hoc narrow base + wide mark combos, overlap

Post by NinnaD »

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?
Erwin Denissen
Moderator
Moderator
Posts: 11158
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: ad hoc narrow base + wide mark combos, overlap

Post by Erwin Denissen »

No, that is not possible.
Erwin Denissen
High-Logic
Proven Font Technology
Post Reply