font-maker icon indicating copy to clipboard operation
font-maker copied to clipboard

Vertical variants of glyphs using HarfBuzz

Open wipfli opened this issue 11 months ago • 0 comments

Some Japanese characters like for example the Long Vowel Mark "ー" U+30FC https://www.compart.com/en/unicode/U+30FC have different appearance for horizontal and vertical text layout.

Instead of getting glyph indices with FreeType for a given character in

https://github.com/maplibre/font-maker/blob/main/main.cpp#L21

We could use HarfBuzz with direction set to top-to-bottom. I tried this with the cli tool of harfbuzz and found it indeed returns different glyphs:

hb-shape NotoSansJP-Regular.ttf "ー" 
[gid1387=0+1000]

hb-shape --direction=ttb NotoSansJP-Regular.ttf "ー"
[gid17662=0@-500,-880+0,-1000]

Motivated by https://github.com/maplibre/maplibre-gl-js/issues/5259

wipfli avatar Dec 25 '24 20:12 wipfli