Closed dscorbett closed 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?
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.
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.
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.
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.
@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
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