Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Broken fonts: Noto Looped Thai and Noto Looped Lao #377

Closed
ohbendy opened this issue May 27, 2021 · 12 comments
Closed

Broken fonts: Noto Looped Thai and Noto Looped Lao #377

ohbendy opened this issue May 27, 2021 · 12 comments

Comments

@ohbendy
Copy link
Contributor

ohbendy commented May 27, 2021

Unfortunately the FontMake build process failed to build the mark positioning correctly for our Noto Looped fonts, and every mkmk combination is broken:

Thai:
Screenshot 2021-05-27 at 19 42 05
Lao:
Screenshot 2021-05-27 at 19 42 29

Likewise, two marks below fail:

Lao:
Screenshot 2021-05-27 at 19 45 08

These combinations work fine when exporting directly from Glyphs, but the mkmk feature seems to have gone awry. My suspicion is that it failed because we used a 'replace feature' custom parameter on the KERN and MKMK features, to be able to input different values in each instance. Perhaps FontMake didn't know what to do with that and then didn't write any code at all for those features. (IIRC Marek had also asked us to copy those custom parameters to the Master settings as well as the instances, but I can't remember the thinking there.)

Marek has now removed the broken fonts from the repo until we can fix this issue, as we don't want broken versions of them to start circulating.

@marekjez86
Copy link
Contributor

@simoncozens : @ohbendy said you might look at it

@marekjez86
Copy link
Contributor

@ohbendy : I believe it also applies to the UI font versions ( NotoLooped{Lao,Thai}UI ) but please confirm

@ohbendy
Copy link
Contributor Author

ohbendy commented May 27, 2021

Indeed it does, those are broken in the same way.

@simoncozens
Copy link
Contributor

Will take a look tomorrow. Replace Feature sounds a likely culprit.

@behdad
Copy link
Contributor

behdad commented May 27, 2021

What does Glyphs "replace feature" do?

@twardoch
Copy link

In a custom parameter, you can provide a different feature definition for a given instance than the one defined in the main definitions (which are per font project).

@simoncozens
Copy link
Contributor

OK, I see the problem. Replace feature is fine as far as I can see. The problem is with ufo2ft's handling of a manual mkmk. Not the issue mentioned above, which is just about how ufo2ft orders mark classes, but the order of the mark/mkmk features.

You specified a manual mkmk feature. ufo2ft then added (1) an automatic mark feature and (2) an automatic mkmk feature. It put (2) in the correct place before your manual mkmk. However, it put (1) at the end of the feature file. Because features are processed in the order of lookups, the mkmk gets done first and then the mark, with predictably wrong results.

A simple workaround is to add a manual mark feature just containing automatic code. I'll provide a PR to do this. A better fix is to ensure that ufo2ft outputs its automatic features in the right order.

(An even better fix is for ufo2ft to use fontFeatures, which was actually designed for this kind of thing. ;-)

@ohbendy
Copy link
Contributor Author

ohbendy commented May 28, 2021

Thank you so much Simon. That explains why the manual 'replace feature' for KERN was still working while the MKMK was not.

marekjez86 added a commit that referenced this issue May 31, 2021
@simoncozens
Copy link
Contributor

@ohbendy, I'm just testing the Lao now and I want to confirm the correct text sequence:

  • ກ່ຼຸ (ko, mai-ek, lo, u) now shapes with the u under the lo.
  • ກຸ່ຼ (ko, mai-ek, u, lo) forms a collision.

I'm presuming that the first sequence (lo-u) is how the text should be keyboarded, and you don't expect to have swap lookups so that u-lo gets automatically changed to the right order?

@ohbendy
Copy link
Contributor Author

ohbendy commented Jun 14, 2021

Tonemarks always come after vowel marks above and below in Thai and Lao so the correct ordering would be <consonant> <coeng Lo> <vowel> <tonemark> or for these sequences ko, lo, u, mai ek. There's no reordering for those sequences, but we did put in reordering with the phinthu and combining macron below in the Thai fonts because the canonical order of combining marks gives the wrong sequences.

@simoncozens
Copy link
Contributor

That would explain the dotted circles in my github post, then. :) Great, I will add ກຼຸ່ to the regression test. (It passes, now that my fix has been applied.)

moyogo added a commit to notofonts/Noto-Thai that referenced this issue Jun 14, 2021
Add regression tests for shaping issues described in notofonts/noto-source#377
@ohbendy
Copy link
Contributor Author

ohbendy commented Oct 11, 2021

The Noto Looped Thai fonts are published again at https://fonts.google.com/noto. No sign of the Looped Lao there.

Still broken however.
Screenshot 2021-10-11 at 13 03 32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants