alerque / libertinus

The Libertinus font family
Other
950 stars 57 forks source link

Add Support for Stacking Diacritics #429

Open Rithaniel opened 3 years ago

Rithaniel commented 3 years ago

Hi, I recently started using Libertinus, specifically for the support it has for IPA symbols. However, I ran into an issue where I tried to use the symbol n̪̩ (a syllabic dental nasal) and the two diacritics merged. While it might be a niche situation, support for stacked diacritics like this would be great to see.

alerque commented 3 years ago

Thanks for the report. There are a handful of marker locations for stacking diacritics, but it's only a smattering of the total needed for full support. If the ones you need are limited we can probably pick away at them on a request basis and get a few of them going. Long term mark placement needs a serious overhaul.

Funny you should ask though, some chap named Felix (@kopeckyf) turned up just this week with a Pull Request in progress (see #426) in which he is fixes a bunch of combining placement marks. I don't think your specific request is covered there yet but there is hope!

Other outstanding requests along the same lines include #131, #157, and #338.

Rithaniel commented 3 years ago

Ah, yes, that is indeed some interesting timing. Two related topics brought up so close to each other. Should I perhaps post some suggestions over there as well? It seems that he is focusing mainly on ascending diacritics, but my focus is mainly on descending diacritics (at least at the moment).

To give perhaps more direction to this particular issue, so far the diacritics I've personally encountered which I would need to mark simultaneously have been few and far between, and most issues I've encountered would be solved by simply having the syllabic and non-syllabic diacritics (U+0329/U+032F) placed below other diacritics. This is because most diacritics mark articulatory differences, but these two diacritics mark how sounds behave in the word. Many consonant sounds can potentially be syllabic, with little concern for articulatory specifics. The same applies to vowels being non-syllabic.

If you would like more things to focus on, I can certainly come up with other diacritic combinations that might rarely come up.

alerque commented 3 years ago

Lets give that PR it's own space and keep it on topic to just reviewing the work that is being contributed. I assume the contribution there is motivated directly by their own publishing needs and I want to make it as easy as possible to keep that work on track. It's okay to let them know there are other related requests out here in case they run across an easy chance to address them in the course of their work but since they are volunteering their efforts (just as I and all other current contributors are) I don't want to create any more roadblocks than necessary to getting their improvements integrated.

Lets collect more information about what's needed here. You mention two diacritic marks U+0329 and U+032F that you'd like to use, but the issue here is that the glyphs that need work are all the base glyph shapes (or in this case the composed glyph shapes with one other mark) that need the extra placement marks added to them. I understand the technical side of how these are done but since I don't actually use any of them in my own work I don't have a good feel for which ones are needed. Is there any way we could come up with a prioritized list of which glyph combinations would be most useful and work our way down it, or is this a case of needing "all of them to be any good at all"?

Rithaniel commented 3 years ago

Fair enough. This is my first time opening an issue on github, so I'm still exploring the proper code of conduct.

So, we're looking for the specific glyphs which would potentially need U+0329 and U+032F more than others. It would probably be prudent to mention that, in the IPA, only lowercase letters are used. So uppercase might not need the same attention.

U+032F is easy enough. It only really makes sense to appear on vowels, and there is a list of 28 symbols that are used to represent vowels in the IPA. Now, some of these sounds, while less common, are more likely to be seen with descending diacritics already present. Also, with the three most common non-syllabic vowels, it is more common to represent them with entirely different symbols (semivowels) instead of using the non-syllabic diacritic. So, I'll go ahead and list the sounds by global occurrence, but lead with the ones I think are most prudent to focus on:

Most commonly to be paired with U+031E: e (U+0065), ø (U+00F8), o (U+006F), ɤ (U+0264)

Most common: i (U+0069), u (U+0075), a (U+0061) Common: e (U+0065), o (U+006F) Uncommon: ɨ (U+0268), ə (U+0259), ɛ (U+025B), ɔ (U+0254) Rare: ɯ (U+026F), ɪ (U+026A), ʊ (U+028A), ʌ (U+028C), æ (U+00E6), ɑ (U+0251) Extra Rare: y (U+0079), ʉ (U+0289), ʏ (U+028F), ø (U+00F8), ɘ (U+0258), ɵ (U+0275), ɤ (U+0264), œ (U+0153), ɜ (U+025C), ɞ (U+025E), ɐ (U+0250), ɶ (U+0276), ɒ (U+0252)

U+0329 is a little bit more complex. There are a lot more consonant symbols than vowel symbols, so I can't give a full list of symbols by their occurrence. So, instead, I'll skip to a list of symbols that I feel are more likely to appear with particular diacritics, therefore being more likely to have a conflict with U+0329.

With U+032A: n (U+006E), d (U+0064), t (U+0074), l (U+006C), s (U+0073), z (U+007A), ɾ (U+027E) With U+0320: n (U+006E), d (U+0064), t (U+0074), ɹ (U+0279), l (U+006C), ʟ (U+029F) With U+031D: ɹ (U+0279), ɭ (U+026D), ʎ (U+028E), ʟ (U+029F) With U+031E: β (U+03B2), ð (U+00F0), ʁ (U+0281)

Not having worked on fonts, myself, I don't know if this is a short list or a long one. I hope I've provided you with a short list.

kopeckyf commented 3 years ago

@alerque, a general question about this, hope here's the right place. I was wondering what your opinions/experiences would be about automatic placement of diacritic anchors. To be honest, I don't even know of any workflow that could be used for automation here, I always calculate the coordinate on a gylph-by-glyph basis and then place them by hand in FontForge. If the coordinates could be determined automatically, this would make this process so much faster!