Page 1 of 2

Kerning for Greek

Posted: Fri Dec 02, 2016 10:11 am
by Bhikkhu Pesala
I have added kerning classes for Greek, and pair adjustment values in the kerning table. However, the Preview Toolbar and Glyph Edit Window do not show the pairs as kerned.

If I test the font, then use the test font in PagePlus, the kerning works as expected. Why does FontCreator not show kerning for Greek? Does it work for Cyrillic?

Kerning Enabled in PagePlus
Greek Kerning.png
Greek Kerning.png (8.12 KiB) Viewed 3222 times
Preview Toolbar in FontCreator
Kerning Preview.png
Kerning Preview.png (15.21 KiB) Viewed 3220 times

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 10:18 am
by Erwin Denissen
Maybe it is related to the bug you reported earlier.

Can you please send the font project file along with some sample text?

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 10:22 am
by Bhikkhu Pesala
The Font Project is attached to the bug report thread.

This is the sample text that I used in the preview toolbar.

Code: Select all

ΑΤΔΥΛΨ ATAYAT

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 10:56 am
by Erwin Denissen
I'm not sure why a web browser would use Latin script for Greek kerning, as Greek kerning should be added to the Greek script.
GreekKerning.png
GreekKerning.png (119.29 KiB) Viewed 3215 times

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 11:13 am
by Erwin Denissen
I've done some testing, and as mentioned in this topic OpenType Layout Engines work slightly different :roll:

I'll add these findings there as well.

Firefox uses Latin as fallback script in case the correct script is not available.

Microsoft Word (on windows at least) uses a similar approach, but will also use other scripts in case the correct script is missing.

Maybe FontCreator should support this too, but then also make clear it isn't by the rules...

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 11:24 am
by Bhikkhu Pesala
I was going to ask about how this ought to be implemented, but then no one follows the rules.

Most of my fonts only contain Basic Greek, which is not for Greek text but for Maths and similar uses in English text.

Perhaps fonts with a full Greek Extended character set should have a Greek script and a separate kerning table for Greek. It's all a bit much to be honest. I prefer to have no more scripts and languages than really necessary as it makes fonts harder to maintain.

I think FontCreator should kern Greek with Latin kerning tables if adjustment pairs are included in the kerning table for the Latin script.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 12:22 pm
by Erwin Denissen
It seems Sitka is one of a few Windows fonts that has correctly (at least the way we think it should be) defined the OpenType layout features. It contains different pair positioning lookups for each script, but all have a mutual pair positioning lookup for digits:
OpenTypeFeaturesSitka.png
OpenTypeFeaturesSitka.png (117.39 KiB) Viewed 3199 times
Most other fonts that include both Latin and Greek characters, just put them all in one huge pair adjustment lookup which is added to both Latin and Greek script.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 12:38 pm
by Bhikkhu Pesala
I can get it to work for Greek or Latin, but not both. How does Sitka manage that?

You have the Preview Toolbar set to Auto, and so do I, but the Greek text only kerns if I select the Greek script which automatically selects the ELL language.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 12:57 pm
by Erwin Denissen
It should work, so please send me the updated project file.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 1:03 pm
by Bhikkhu Pesala
Here it is:

The plot thickens. If I select the Latin Script, the kerning is applied twice to the Greek Text.

If I delete the Greek kerning feature from the Latin script, and just leave it in the Greek script, selecting Auto still does nothing, but selecting Latin kerns both Greek and Latin text.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 1:28 pm
by Erwin Denissen
I see. You added Greek script (grek) with Greek language (ELL).

With your current implementation, even in Firefox you need to provide the corresponding language (el) to make it work:
GreekLanguage.png
GreekLanguage.png (32.5 KiB) Viewed 3192 times
All fonts I've seen only use the default language, which does work with the Auto script/language option in FontCreator too. So I suggest you change the language tag from ELL to DFLT.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 1:48 pm
by Bhikkhu Pesala
Erwin Denissen wrote:All fonts I've seen only use the default language, which does work with the Auto script/language option in FontCreator too. So I suggest you change the language tag from ELL to DFLT.
Thanks. That does work. If it's the only method that works, I may have to do it that way.

If I add the KerningGreek feature to the Latin Script, the Greek text is kerned twice as it is in your screen shot.
Doubled Kerning.png
Doubled Kerning.png (16.6 KiB) Viewed 3178 times
However, if I delete the adjustment pairs for Greek from the Latin Kerning table, the Preview text is kerned correctly when the script is set to Latin. Testing in Vivaldi and Firefox, only the Latin text is kerned.

This is too complex for my brain at the moment, it is time for a nap.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 1:53 pm
by Erwin Denissen
Bhikkhu Pesala wrote:
Erwin Denissen wrote:All fonts I've seen only use the default language, which does work with the Auto script/language option in FontCreator too. So I suggest you change the language tag from ELL to DFLT.
Thanks. That does work. If it's the only method that works, I may have to do it that way.
I'm not sure if it is the only or best way, but I think it comes closest to what was meant when the OpenType layout feature specs were defined.
Bhikkhu Pesala wrote:If I add the KerningGreek feature to the Latin Script, the Greek text is kerned twice as it is in your screen shot.
It isn't applied twice here; I deliberately changed the kern value so I can more easily see work.
Bhikkhu Pesala wrote:However, if I delete the adjustment pairs for Greek from the Latin Kerning table, the Preview text is kerned correctly when the script is set to Latin. Testing in Vivaldi and Firefox, only the Latin text is kerned.
If a page contains content in another language than the default language, you need to explicitly add a language attribute to an element surrounding that content.

The Web Test Page as provided by FontCreator only has one such language attribute for the whole preview text.

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 10:32 pm
by Bhikkhu Pesala
I found that PagePlus was not kerning the Greek text (not even with the language set to Greek) with the kerning table in the Greek Script, so I added it to the Latin Script too. That works and is not hard to maintain. By moving the kern features to the top they are accessible without any scrolling or collapsing/expanding of the feature trees.
Greek Kerning 2.png
Greek Kerning 2.png (18.69 KiB) Viewed 3173 times

Re: Kerning for Greek

Posted: Fri Dec 02, 2016 10:50 pm
by Erwin Denissen
Bhikkhu Pesala wrote:I found that PagePlus was not kerning the Greek text (not even with the language set to Greek) with the kerning table in the Greek Script, so I added it to the Latin Script too. That works and is not hard to maintain.
I'm glad to know you found a way that works, but now we are totally lost about what is the best approach for adding non-Latin kerning :cry: