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

Intermediate/brace layers are not supported anymore #741

Closed
RosaWagner opened this issue Oct 27, 2021 · 34 comments · Fixed by #769 or #828
Closed

Intermediate/brace layers are not supported anymore #741

RosaWagner opened this issue Oct 27, 2021 · 34 comments · Fixed by #769 or #828
Assignees

Comments

@RosaWagner
Copy link

https://github.com/emmamarichal/league-spartan

fontmake.errors.FontmakeError: In 'LeagueSpartan.glyphs' -> 'master_ufo/LeagueSpartan.designspace': Generating fonts from Designspace failed: '{500}'

  • font is Glyphs version2
  • has intermediate layer at 500 for /e and /a.ss01
  • ufo2ft creates a source master at 500 in design space, which has the same name as the origin master at 200, which creates a conflict.

I don't know at which commit exactly the change occurred though. Maybe it's not even glyphsLib the issue.

  <sources>
    <source filename="LeagueSpartan-ExtraLight.ufo" name="League Spartan ExtraLight" familyname="League Spartan" stylename="ExtraLight">
      <lib copy="1"/>
      <groups copy="1"/>
      <features copy="1"/>
      <info copy="1"/>
      <location>
        <dimension name="Weight" xvalue="200"/>
      </location>
    </source>
    <source filename="LeagueSpartan-ExtraLight.ufo" name="League Spartan ExtraLight {500}" layer="{500}">
      <location>
        <dimension name="Weight" xvalue="500"/>
      </location>
    </source>

sources.zip

@simoncozens simoncozens self-assigned this Oct 29, 2021
@simoncozens
Copy link
Collaborator

I can't reproduce this. I get the same sources as you do in the designspace file, and the font builds fine with

fonttools==4.27.1
ufo2ft==2.24.0
fontmake==2.4.2

both using fontmake and gftools-builder.

@RosaWagner
Copy link
Author

I updated gftools again today and I can't reproduce anymore neither.
@emmamarichal can you try again on your side with upgrading gftools in your venv? maybe it was an issue with some dependency or something.

@RosaWagner
Copy link
Author

RosaWagner commented Nov 1, 2021

Ah no, doesn't work if I install the main branch of fontmake and glyphsLib.
git+https://github.com/googlefonts/fontmake@a949251d9f24b1cda74ae85e96b97ced0cbf0905

@weiweihuanghuang
Copy link

I’m having the same issue weiweihuanghuang/Work-Sans#67 (comment)

@kosbarts
Copy link

I am having the same issue with fontmake 3.1.2.

@RosaWagner
Copy link
Author

This issue is blocking the CI builds in multiple repositories, I have complains from several designers.

@simoncozens
Copy link
Collaborator

Sorry. I shall look at this today.

@simoncozens
Copy link
Collaborator

simoncozens commented Jan 25, 2022

Unfortunately I still can't reproduce this (at least from the test sources given above). :-/

I'm being an numpty. Reproduced it now. Working on it...

@simoncozens
Copy link
Collaborator

OK, the problem is in the "minimal" build idea.

simoncozens added a commit that referenced this issue Jan 25, 2022
simoncozens added a commit that referenced this issue Jan 25, 2022
simoncozens added a commit that referenced this issue Jan 25, 2022
@RosaWagner
Copy link
Author

thanks @simoncozens!
I just tried and I have this error (with Glyphs 3):

DesignSpace sources contain duplicate locations; varLib expects each master to define a unique location. Make sure that you used consistent 'brace layer' names in all the glyph layers that share the same location.
  ['Intermediate {390, 100}', '{390}'] => {'Weight': 390}

First I though it was because the intermediate layer was sharing the same location as the Regular instance, so I changed the location, but then I found a conflict between the layer's name and the actual location of the brace layer (cf video).
If I remove the layer name (empty), I have this error:

Generating fonts from Designspace failed: ''

If I rename the layer with the same value as the brace layer location, it works. Boh it is annoying but solvable, just wanted to report in case people have the same issue.

Enregistrement.de.l.ecran.2022-01-25.a.15.17.05.mov

@weiweihuanghuang
Copy link

@RosaWagner @simoncozens this is because in Glyphs 3, the location of a brace layer or alternate glyph is no longer in the layer’s name but a layer property. See https://docu.glyphsapp.com/#GSLayer.attributes

@weiweihuanghuang
Copy link

What’s the status?

@RosaWagner
Copy link
Author

the issue described in this comment #741 (comment) is still happening. @simoncozens shall we re-open that issue?

@kosbarts
Copy link

kosbarts commented Aug 8, 2022

Yes please! This is so annoying.

@anthrotype anthrotype reopened this Aug 14, 2022
@weiweihuanghuang
Copy link

Can we make this priority, a lot of projects need intermediate and alternate layers.

@anthrotype
Copy link
Member

I'd also like to know what's the status of this issue. @simoncozens earlier said he could repro and that the problem was 'in the "minimal" build idea.'
Maybe the title of the issue is perhaps too broad and should be renamed to narrow it down a bit?

@simoncozens
Copy link
Collaborator

Sorry, I'll try and take another look at this tomorrow. Obviously I thought I had fixed it. I suspect there's another issue that I haven't cracked. @RosaWagner is League Spartan still a good test case? Or shall I look at building Work Sans?

@RosaWagner
Copy link
Author

We probably fixed the layer names, but I see an attachment to my first comment, it is probably the buggy version

@emmamarichal
Copy link

I think it was about Playfair Display, that has on some letters, 3 values in the brace layers
https://github.com/clauseggers/Playfair

Capture d’écran 2022-08-31 à 16 10 17

@simoncozens
Copy link
Collaborator

I think with the current architecture it is very difficult to support alternate layers with both start and end stops.

@emmamarichal
Copy link

Hello,
I wanted to do a small "tutorial" to solve an issue I met.

  1. The original file was like this

Capture d’écran 2022-10-21 à 17 42 33

2) To get the good way of writing this, I did "+" to add them as Alternates layers

Capture d’écran 2022-10-21 à 17 42 41

3) At the end, we get this, that is the good structure to have.

Capture d’écran 2022-10-21 à 17 42 55

But it didn't export properly and I got this error:
TypeError: '<=' not supported between instances of 'int' and 'str'

To avoid that:

  • Save the drawing of your layers somewhere
  1. Start with your 2 masters

Capture d’écran 2022-10-21 à 17 49 24

2) Add a layer with "+"

Capture d’écran 2022-10-21 à 17 49 31

3) Right clic on it, select "Alternate"

Capture d’écran 2022-10-21 à 17 49 37

4) Fill with your values

Capture d’écran 2022-10-21 à 17 49 47

5) Then you have the same result, but with another process, and it works!

Capture d’écran 2022-10-21 à 17 50 03

I hope it will help if someone has the same kind of issue!

@schriftgestalt
Copy link
Collaborator

In the file from the first part, can you right click the default layer in the layer panel and see if the 'Alternate' is still checked? If so, uncheck it. Otherwise, can you send me that file?

@schriftgestalt
Copy link
Collaborator

schriftgestalt commented Oct 25, 2022

You can also do it like this (at least Glyphs supports it like this):
Screen Shot 2022-10-25 at 10 33 25
(the Light and the [] master are compatible/interpolating (full stroke) and the [550<wg] and Bold [550<wg] are compatible (two small strokes at the top and bottom).)

The advantage is that in the font view, the Bold master looks good as it has the alternate shape.

@schriftgestalt
Copy link
Collaborator

One thing that might cause the error is that the values in the "axisRules" settings in the layers are stored as string. So it might need an int() in the right place. (or float(), of course).

@weiweihuanghuang
Copy link

Thanks @simoncozens!

@emmamarichal
Copy link

Hi @simoncozens,
I'm working on Playfair, I managed to export the upright well, even with the complex alternates layers (#741 (comment))

However, I have this error for the italics, I think it has to do with some ligatures (pink glyphs in the sources). I'm on it since yesterday, I can't seem to solve it. Do you have any idea where this problem is coming from?

Lib/featureVars.py", line 168, in overlayFeatureVariations
    intersection, remainder = overlayBox(currBox, box)
  File "/Users/marichalemma/Google/env/lib/python3.9/site-packages/fontTools/varLib/featureVars.py", line 222, in overlayBox
    minimum = max(min1, min2)
TypeError: '>' not supported between instances of 'int' and 'str'

Repo: https://github.com/emmamarichal/Playfair/blob/master/sources/Playfair-Italic.glyphs

Thanks!

@simoncozens
Copy link
Collaborator

That shouldn't happen! I'll have a look.

@simoncozens
Copy link
Collaborator

OK, I've fixed the presenting problem, but there is still something not quite right here as the font is now failing compatibility checking; the layers look fine in Glyphs, but maybe when we work out the alternates one of layers has ended up in the wrong conditionset or something like that.

@emmamarichal
Copy link

Ok great, I'll take a look, thanks a lot!

@simoncozens
Copy link
Collaborator

I've found it. One of the layers does not have a name, so it is getting lost. But I am not sure bracket layers need to have names, since w make our own magic names for them.

@emmamarichal
Copy link

In which glyphs do you see that? I can't find it

@simoncozens
Copy link
Collaborator

You can't see it because Glyphs hides the user-supplied names of alternate layers and replaces them with the description of the conditions - so you see "[5<oz<410,80<wd<150]" but actually internally the layer is called "30 Jan 22, 11:43" or something like that. And because of that you can't easily fix it in the UI. (You can fix it with scripting, I suppose.)

So we should fix it by not skipping anonymous alternate layers.

@emmamarichal
Copy link

Aah ok I see, yes indeed we often had this problem.Thanks!

@schriftgestalt
Copy link
Collaborator

For Glyphs 3 source, the layer names have no meaning any more and should be ignored.

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