inter icon indicating copy to clipboard operation
inter copied to clipboard

Support IPA or other complex diacritics by mark positioning features

Open be5invis opened this issue 6 years ago • 22 comments

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

be5invis avatar May 09 '19 08:05 be5invis

IPA is a great example of using combining diacritics: image

be5invis avatar Aug 05 '19 03:08 be5invis

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

be5invis avatar Aug 05 '19 03:08 be5invis

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?

rsms avatar Aug 06 '19 06:08 rsms

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

schriftgestalt avatar Aug 06 '19 10:08 schriftgestalt

“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).

be5invis avatar Aug 07 '19 03:08 be5invis

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

schriftgestalt avatar Aug 07 '19 06:08 schriftgestalt

@schriftgestalt

mark lookups do not support subtables.

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

be5invis avatar Aug 07 '19 06:08 be5invis

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

be5invis avatar Aug 07 '19 06:08 be5invis

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.

schriftgestalt avatar Aug 07 '19 08:08 schriftgestalt

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

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

anthrotype avatar Aug 07 '19 08:08 anthrotype

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?

KrasnayaPloshchad avatar Aug 08 '19 18:08 KrasnayaPloshchad

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 avatar Sep 07 '19 21:09 rsms

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 avatar Sep 07 '19 21:09 rsms

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)

rsms avatar Sep 07 '19 21:09 rsms

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

schriftgestalt avatar Sep 08 '19 00:09 schriftgestalt

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 avatar Sep 08 '19 05:09 KrasnayaPloshchad

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

KrasnayaPloshchad avatar Sep 08 '19 14:09 KrasnayaPloshchad

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

KrasnayaPloshchad avatar Mar 01 '21 18:03 KrasnayaPloshchad

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

VladWinner avatar Jul 01 '21 21:07 VladWinner

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 avatar Jul 26 '21 09:07 KrasnayaPloshchad

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

KrasnayaPloshchad avatar Aug 27 '21 05:08 KrasnayaPloshchad

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

image

bluebear94 avatar Jan 30 '22 22:01 bluebear94