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

Examples with more axis and usage of colon and equal sign #4

Open
schriftgestalt opened this issue Oct 15, 2024 · 5 comments
Open

Examples with more axis and usage of colon and equal sign #4

schriftgestalt opened this issue Oct 15, 2024 · 5 comments

Comments

@schriftgestalt
Copy link

there are examples like this:
(50 wght=0:47 wght=1000:54)
but none with more than one axis:
(50 wght=0 wdth=67:47 wght=1000 wdth=67:54 wght=1000 wdth=150:124)
Just to be able to judge the readability.

For me it would look better like this:
(50 wght:0 wdth:67=47 wght:1000 wdth:67=54 wght:1000 wdth:150=124)
That would kind of look like a python dict used as a key that is assigned a value. That way the pos vales are a bit more prominent.

@skef
Copy link
Contributor

skef commented Oct 15, 2024

There are multi-axis examples sprinkled around the variable feature guide and the specification. There are commas between axis position specifiers, and these are needed for unambiguous parsing. You've also left off the axis units (although I've noticed a couple places in the Guide where they're missing too, I'll fix those.)

(It's true that there aren't many examples outside of named location definitions, mostly because of the encouragement to use named locations.)

As for where ":" vs "=" are used, I think the current arrangement was part of the earlier 2021 (and now very outdated) draft proposal from before I started at Adobe: adobe-type-tools/afdko#1350 . I can't speak to that in detail, but I would say that in common usage across contexts "=" tends to "bind" more directly to its arguments than ":" (e.g. when a colon connects one phrase to another to suggest implication in English and other languages). So given that both are needed (when not using named locations), your example, and in particular the instances of things like "67=47", looks strange to me. It de-emphasizes the grouping of the elements in the axis position list, and it's basic to "parsing" the variable value to see that those to together and pair with the associated value as a whole.

@skef
Copy link
Contributor

skef commented Oct 15, 2024

Here's a sample of a variable value with two axes and no named locations (expanded out from the sources in the example repository), both as a single line and with better formatting:

pos B AE (-50 wght=0d, opsz=8d:-40 wght=394d, opsz=8d:-20 wght=1000d, opsz=8d:-30 wght=0d, opsz=20d:-50 wght=1000d, opsz=20d:-40 wght=0d, opsz=60d:-40 wght=394d, opsz=60d:-40 wght=1000d, opsz=60d:-40);

pos B AE (                         -50
           wght=    0d, opsz= 8d : -40
           wght=  394d, opsz= 8d : -20
           wght= 1000d, opsz= 8d : -30
           wght=    0d, opsz=20d : -50
           wght= 1000d, opsz=20d : -40
           wght=    0d, opsz=60d : -40
           wght=  394d, opsz=60d : -40
           wght= 1000d, opsz=60d : -40
         );

Or this single-line alternative that emphasizes the grouping:

pos B AE (-50 wght=0d,opsz=8d:-40 wght=394d,opsz=8d:-20 wght=1000d,opsz=8d:-30 wght=0d,opsz=20d:-50 wght=1000d,opsz=20d:-40 wght=0d,opsz=60d:-40 wght=394d,opsz=60d:-40 wght=1000d,opsz=60d:-40);

@schriftgestalt
Copy link
Author

particular the instances of things like "67=47", looks strange to me.
the 67:54 looks even worse for me. The "=" is bigger and, for me, divides more than a colon. The wght=0, wdth=67 part is one thing and the value is another. So we should make those units as distinct as possible. It should be clear from the skimming over the code what is an axis position and what is a value.

@skef
Copy link
Contributor

skef commented Oct 15, 2024

Well, this may ultimately be a subjective matter, but in practice we hope that people will not have to deal with either of those cases because they will use named locations, which make the value much easier to read and don't have this two-level list problem.

@schriftgestalt
Copy link
Author

(this is more for my own reference)
The grouped syntax as above and with the colon and equal switched:

pos B AE (-50 wght=0d,opsz=8d:-40 wght=394d,opsz=8d:-20 wght=1000d,opsz=8d:-30 wght=0d,opsz=20d:-50 wght=1000d,opsz=20d:-40 wght=0d,opsz=60d:-40 wght=394d,opsz=60d:-40 wght=1000d,opsz=60d:-40);

pos B AE (-50 wght:0d,opsz:8d=-40 wght:394d,opsz:8d=-20 wght:1000d,opsz:8d=-30 wght:0d,opsz:20d=-50 wght:1000d,opsz:20d=-40 wght:0d,opsz:60d=-40 wght:394d,opsz:60d=-40 wght:1000d,opsz:60d=-40);

and this is the syntax currently supported in Glyphs:

pos B AE -50 (wght:0 opsz:8) -40 (wght:394 opsz:8) -20 (wght:1000 opsz:8) -30 (wght:0 opsz:20) -50 (wght:1000 opsz:20) -40 (wght:0 opsz:60) -40 (wght:394 opsz:60) -40 (wght:1000 opsz:60) -40;

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

2 participants