Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of manual mkmk and automatic mark #506

Open
simoncozens opened this issue May 28, 2021 · 12 comments
Open

Order of manual mkmk and automatic mark #506

simoncozens opened this issue May 28, 2021 · 12 comments

Comments

@simoncozens
Copy link
Contributor

This is similar to notofonts/latin-greek-cyrillic#177 but different. Noto Loopless Thai has a manual mkmk feature but a "fully automatic" (i.e. not in the Glyphs source at all) mark feature. ufo2ft generates the mark code and, because there is no insert point, places it at the end of the feature file. It therefore gets compiled and processed after the mkmk code, and everything is broken.

Since there is (except perhaps in some truly pathological cases) a hard dependency on mkmk being processed after mark, we should do the right thing in the default case and ensure that automatic mark code gets inserted before any mkmk code in the feature file.

@anthrotype
Copy link
Member

yeah, I guess it'd make more sense to insert mark before this hand-written mkmk instead of appending at the end when no explicit insertion marker is present.

@simoncozens
Copy link
Contributor Author

I think that notofonts/latin-greek-cyrillic#274 only partially fixed this bug. I'm still seeing problems with a manual mkmk and fully automatic mark. Investigating.

@khaledhosny
Copy link
Collaborator

khaledhosny commented Dec 10, 2021

FWIW, I fix these ordering issues by having an empty mark (or mkmk) feature that only contains the insert automatic code comment.

@simoncozens
Copy link
Contributor Author

Yeah, I do that too but it's a workaround.

@anthrotype
Copy link
Member

I think that #512 only partially fixed this bug... Investigating

@simoncozens is this still an issue?

@simoncozens
Copy link
Contributor Author

simoncozens commented Apr 23, 2022

Yes, it's causing notofonts/lepcha#1

@simoncozens
Copy link
Contributor Author

...and when I tried to fix it by adding an empty mark feature, I got

fontmake: Error: In 'src/NotoSansLepcha.glyphs' -> 'master_ufo/NotoSansLepcha-Regular.designspace' -> 'master_ufo/NotoSansLepcha-Regular.ufo': Compiling UFO failed: <features>:95:35: Unknown markClass @MC_Anchor10

This is because Lepcha uses abvm/blwm, and ufo2ft had generated the following erroneous code:

feature abvm {
    lookup abvm_mark2base {
        pos base uni1C23
            <anchor 305 583> mark @MC_Anchor10;
...
} abvm;

markClass uni1C2D_1C36 <anchor 0 583> @MC_Anchor10;
...
feature mark {
    lookup mark2base {
        pos base uni25CC
            <anchor 253 583> mark @MC_Anchor10
            <anchor 253 0> mark @MC_Anchor12;
    } mark2base;

} mark;

@anthrotype
Copy link
Member

I'm closing tabs -- is this still open?

@simoncozens
Copy link
Contributor Author

Yep.

@anthrotype
Copy link
Member

Yes, it's causing googlefonts/noto-fonts#2321

@simoncozens mind updating this url, it points nowhere -- thanks

@simoncozens
Copy link
Contributor Author

This is now causing Noto Sans Devanagari (plus Latin subset) to fail to build:

feature abvm {
# Automatic Code Start

} abvm;

feature blwm {
# Automatic Code Start

} blwm;

is turning into:

} vatu;

feature abvm {
    lookup abvm_mark2base {
        pos base udeva
            <anchor 299 0> mark @MC_Anchor8;
...

markClass nuktadeva <anchor -283 0> @MC_Anchor8;
...

@simoncozens
Copy link
Contributor Author

Swapping the order of abvm/blwm in the feature file somehow managed to make things worse:

feature blwm {
    # Automatic Code Start
} blwm;

feature abvm {
    lookup abvm_mark2base {

...
} abvm;

markClass binducandradeva <anchor -130 622> @MC_Anchor2;
markClass candrabindudeva <anchor -130 622> @MC_Anchor2;
markClass anusvaradeva <anchor -126 622> @MC_Anchor2;

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

No branches or pull requests

3 participants