notofonts / javanese

Noto Javanese
SIL Open Font License 1.1
6 stars 1 forks source link

U+A9BF JAVANESE CONSONANT SIGN CAKRA does not reorder around non-letters #30

Closed dscorbett closed 2 years ago

dscorbett commented 3 years ago

Font

NotoSansJavanese-Regular.otf

Where the font came from, and when

Site: https://github.com/googlefonts/noto-fonts/blob/cd893f64662fb641d3e75aa5914444bad2a19024/unhinted/otf/NotoSansJavanese/NotoSansJavanese-Regular.otf Date: 2021-09-04

Font version

Version 2.000

Issue

U+A9BF JAVANESE CONSONANT SIGN CAKRA is supposed to be placed to the left of its base. In this font, when its base is not a letter, it does not reorder. This is a problem because it makes it look like the cakra is associated with the following cluster, which may hide typos; for example, the examples in the screenshot below misleadingly appear to containing the cluster kra. It is also a problem because it is convenient to use a dotted circle as a base when discussing combining marks, this font makes <U+25CC, U+A98F> look wrong.

Character data

ꦿꦏ U+00A0 NO-BREAK SPACE U+A9BF JAVANESE CONSONANT SIGN CAKRA U+A98F JAVANESE LETTER KA ◌ꦿꦏ U+25CC DOTTED CIRCLE U+A9BF JAVANESE CONSONANT SIGN CAKRA U+A98F JAVANESE LETTER KA ꧘ꦿꦏ U+A9D8 JAVANESE DIGIT EIGHT U+A9BF JAVANESE CONSONANT SIGN CAKRA U+A98F JAVANESE LETTER KA

Screenshot

 ꦿꦏ ◌ꦿꦏ ꧘ꦿꦏ

simoncozens commented 2 years ago

This feels like a shaper bug. For example, if you have a Myanmar medial ra on its own, I would expect the shaper to insert a dotted circle after the medial ra - which is indeed what it does. But a Javanese cakra on its own has the dotted circle insert before it.

These days Javanese is sent through the Universal Shaping Engine. I would have expected the cakra to have USE category MPre (prebase medial consonant). But in Harfbuzz it has the category MBlw - see last entry in https://github.com/harfbuzz/harfbuzz/blob/903cf8cfce631e5e0a5c8941d207dff3e3a59b82/src/hb-ot-shape-complex-use-table.hh#L523 :

  /* A9B0 */     B,     B,     B, CMAbv,  VPst,  VPst,  VAbv,  VAbv,  VBlw,  VBlw,  VPre,  VPre,  VAbv,  MBlw,  MPst,  MBlw,

Perhaps this is what is causing the lack of reordering?

simoncozens commented 2 years ago

So apparently cakra gets USE category MBlw because its IPC is Bottom_and_Left, while other medial ras get MPre because their IPC is Top_and_Bottom_and_Left. If I wrote shaping engines then anything which needed to start on the left of the base would get reordered before it, but presumably there’s a good reason why I don’t. So we have to reorder it ourselves.

dscorbett commented 2 years ago

U+A9BF gets USE subclass MBlw because it is explicitly overridden. Classifying it as MBlw prevents U+A9BD and U+A9BF from occurring in the same cluster, which might have been the point. MPre would certainly be more convenient though.

NorbertLindenberg commented 2 years ago

See https://docs.microsoft.com/en-us/typography/script-development/use#glyph-reordering, in particular the section “Feature-based reordering”. Cakra reordering needs to be requested through a “pref” feature, no matter whether it’s MBlw or MPre.

simoncozens commented 2 years ago

Thanks, @dscorbett and @NorbertLindenberg, for your input. I have worked on a new version of the font, making use of pref reordering instead of the older manual approach. I've done some preliminary testing on it and things seem to work, but I only have limited test strings. The font is attached; if you notice any problems, please let me know.

NotoSansJavanese-Regular.ttf.gz

r12a commented 2 years ago

@simoncozens Not sure what kind of test strings you need, but if it's words containing the cakra sign you can find 32 at https://r12a.github.io/scripts/javanese/jv_vocab?q=%EA%A6%BF