rsms / inter

The Inter font family
https://rsms.me/inter/
SIL Open Font License 1.1
17.72k stars 398 forks source link

Support IPA or other complex diacritics by mark positioning features #155

Open be5invis opened 5 years ago

be5invis commented 5 years ago

It would be great the Inter supports IPA and other scripts / notation systems that relies on combining marks. image

be5invis commented 5 years ago

IPA is a great example of using combining diacritics: image

be5invis commented 5 years ago

@schriftgestalt Glyphs should already support automatically export mark and mkmk lookups? I found this article → https://glyphsapp.com/tutorials/mark-attachment

rsms commented 5 years ago

It appears as glyphs only creates mark and mkmk tables when using the GUI export feature — Inter uses it’s own separate build system based on fontmake and glyphslib, so we don’t get this for free.

Further, when I export from the Glyphs app using its GUI, the OTF files are noticeably larger than the OTF files produces by Inter’s fontmake-based build system. Additionally, Glyphs presents the following error on export (but it succeeds in creating fully-validating OTF files) “In feature 'mark' lookup 'marklatn' mark to base positioning rules cause an offset overflow (0x10a68) to a lookup subtable”.

So, based on this, I think we need to manually create a mark table. Or, patch glyphslib to generate it for us. Either way, it seems to be a lot of work.

Perhaps worth it? What would be the primary upsides of this? Is IPA commonly used and would Inter be able to have a significant impact on IPA use?

schriftgestalt commented 5 years ago

As fare as I know, glyphsLib+fontMake should support automatic mark+mkmk feature generation.

be5invis commented 5 years ago

“In feature 'mark' lookup 'marklatn' mark to base positioning rules cause an offset overflow (0x10a68) to a lookup subtable”

@schriftgestalt Hmm I think you can try to bisect these mark positioning lookups subtables when they grow too large (like bisect at size > 32K).

schriftgestalt commented 5 years ago

mark lookups do not support subtables. Adding a "Use Extension Kerning" custom parameter in Font Info > Font should fix the problem.

be5invis commented 5 years ago

@schriftgestalt

mark lookups do not support subtables.

Source? I don't see the GPOS spec disallowed multiple-subtable mark lookup.

be5invis commented 5 years ago

@schriftgestalt At least SIL’s Arabic font Scheherazade Regular contains a mark-to-base lookup with two subtables.

schriftgestalt commented 5 years ago

You are right. But I don't think that a subtable break would help here. The mark feature itself is not the problem but the GPOS in total. Mostly the kerning is filling the 64k space and then the mark feature is just the last straw.

anthrotype commented 5 years ago

As fare as I know, glyphsLib+fontMake should support automatic mark+mkmk feature generation.

Correct. If you're having any issues let us know!

KrasnayaPloshchad commented 5 years ago

As fare as I know, glyphsLib+fontMake should support automatic mark+mkmk feature generation.

Wikipedia suggests the ccmp feature can also be used (see here). BTW what about AFDKO?

rsms commented 5 years ago

Made some progress today. Here’s what Safari now renders:

Screen Shot 2019-09-07 at 14 54 04

This is the input:

d U+030C U+0304 U+0323 U+0326
y U+030D U+0311 U+0310 U+0302 U+0301 U+0353 U+0347
n U+0306 U+0308 U+1DD8 U+0304 U+0307 U+032D U+0332 U+032B U+0323
a U+0363 U+0306 U+0309 U+0324 U+0330 U+032A
m U+0310 U+0318
i U+0304 U+1DCA
c U+0319 U+030B

d U+0325 U+0309
i U+030E U+1DC7
a U+1DC8 U+031E
c U+0348 U+0332
r U+0346 U+0332
i U+0313 U+036F
t U+032B U+0306
i U+1DC5 U+0307
c U+0368 U+0301
s U+031C U+1DCC
rsms commented 5 years ago

As fare as I know, glyphsLib+fontMake should support automatic mark+mkmk feature generation.

Wikipedia suggests the ccmp feature can also be used (see here). BTW what about AFDKO?

ccmp is used already: src/features/ccmp.fea :–)

rsms commented 5 years ago

There’s still a ton of work left to be done, adding input and output anchors to every combining mark. (Only some currently have anchors)

schriftgestalt commented 5 years ago

You get pretty good default anchors when you select all glyphs and press Cmd+U.

KrasnayaPloshchad commented 5 years ago

I have seen an example of double stacked marks with the same diacritics, for example, this page has an example of double stacked macron in an image, have you thought of adding such implementation?

KrasnayaPloshchad commented 5 years ago

The combining dot above right shouldn‘t break mark placing with other diacritics. You can see this article for more details.

KrasnayaPloshchad commented 3 years ago

Combining vertical line above should having more mark attachments to be aligned with base letter, and having small spacing with them. 图片 Combining diaerasis below failed to aligned with base letter. 图片 AE-monograph need more mark attachments 图片

See: https://en.wikipedia.org/wiki/Pha%CC%8Dk-fa-s%E1%B9%B3 https://en.wikipedia.org/wiki/Foochow_Romanized https://en.wikipedia.org/wiki/Hainan_Romanized https://en.wikipedia.org/wiki/Hinghwa_Romanized

VladWinner commented 3 years ago

Can something similar be implemented to align the diacritics of Cyrillic vowels? image Sample text:

Latin:   áéóý
Cyrillic: а́е́о́у́
А́а́, Е́е́, И́и́, О́о́, У́у́, Ы́ы́, Э́э́, Ю́ю́, Я́я́

Previous message: https://github.com/rsms/inter/issues/181#issuecomment-753516874

KrasnayaPloshchad commented 3 years ago

I found a variant of ỉ on the Dictionarium Annamiticum Lusitanum et Latinum (i.e. “Dictionary of Vietnamese, Portuguese and Latin”) that ratains the tittle, in this case the hook is placed at the right of character frame, and the altitude of hook is sightly lower. To implement this variant, you can just modify the mark attachment for 0069 0307 0309.

See: https://commons.wikimedia.org/wiki/File:Alexandre_de_Rhodes_-_Dictionarium_Annamiticum_(1651)_-_c.34_-_cropped_on_b%C3%AD_and_b%E1%BB%89.png

KrasnayaPloshchad commented 3 years ago

I found ầ, ề and ồ have a variant that placed grave accent at top right of circumflex, and I think it’s resonable to implement as character variant feature.

See: https://www.bilibili.com/video/BV1E54y1W7x1

bluebear94 commented 2 years ago

I’d also like for digits to be supported, so I can use things like N4̂te.

image