google / fonts

Font files available from Google Fonts, and a public issue tracker for all things Google Fonts
https://fonts.google.com
18.2k stars 2.61k forks source link

Diacritics compositions / dotted circle ligatures #2974

Open dy opened 3 years ago

dy commented 3 years ago

To be able to support diacritics compositions, google fonts need to include support for dotted circle + * ligatures (type 4 in GSUB) image Afaik there's no that feature yet.

Ref https://docs.microsoft.com/en-us/typography/opentype/spec/gsub, https://docs.microsoft.com/en-us/typography/script-development/arabic

That can be done as a separate tool, but having that in google fonts would enable so many world uses, like vedabase.io etc

Originally posted by @dy in https://github.com/google/fonts/issues/1808#issuecomment-766894187

tiroj commented 3 years ago

A font really shouldn’t require ligatures of the dotted circle (U+25CC) as a generic mark holder with either individual marks or combinations of marks, since this can be handled using mark GPOS. The shaping engine should automatically produce the result shown in the image if the font includes handling for the two-mark sequence—either with a mark ligature or using mkmk positioning—and mark positioning on the U+25CC base.

Not all shaping engines automatically insert a dotted circle base glyph before unsupported marks (I think Apple’s CoreText engine does not), so results from fonts will vary depending on platform.

dy commented 3 years ago

You're right. Combining marks can be added automatically-ish via feature file:

lookup diacritics {
  markClass [gravecomb acutecomb] <anchor 160 512> @TOP_MARKS;

  # ш м т
  pos base [\uni0448 \uni043C \uni0442] <anchor 500 512> mark @TOP_MARKS;
  # ...rest of glyphs
} diacritics;

feature mark {
  lookup diacritics;
} mark;

# compile as 
# makeotf -ff diacritics.fea -f source.ttf -o result.otf
dy commented 3 years ago

Temporarily there's a fix for Lora/Noto fonts https://krishnized.com/fonts