googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

Vertical kerning #668

Open madig opened 2 years ago

madig commented 2 years ago

Needed for some CJK/SEA scripts. How to implement?

khaledhosny commented 2 years ago

Vertical as in vertical layout or something else?

anthrotype commented 2 years ago

vertical layout

yeah, what else? We'd have to enhance the kern feature writer to emit vkrn I guess. One problem is kerning.plist doesn't say anything about vertical layout, only LTR or RTL are mentioned in https://unifiedfontobject.org/versions/ufo3/kerning.plist/#writing-direction How do we know if a pair has to go in the vkrn feature? Is it sufficient to check the script associated with the glyphs? Or if it's conceivable that the same glyphs be kerned in either horizontal or vertical layout then we can't infer this only based on the glyph unicode properties. I'm not sure because I'm not familiar with engineering fonts for vertical layout.

As to how to encode pairs in FEA, a single metric value means y advance adjustment when it appears inside vkrn block, that I believe should be enough to support top-to-bottom writing direction: http://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#2eiv-value-record

(how common is bottom-to-top?)

anthrotype commented 2 years ago

the proposed vkerning.plist didn't make any progress, maybe it's time to revive that..

https://github.com/unified-font-object/ufo-spec/issues/97 https://github.com/unified-font-object/ufo-spec/issues/96

khaledhosny commented 2 years ago

yeah, what else?

I’m wondering because SEA scripts are mentioned and these are horizontal scripts.

Is it sufficient to check the script associated with the glyphs

Vertical glyphs can also be laid out horizontally and vice versa.