Code Monkey home page Code Monkey logo

Comments (11)

Lorp avatar Lorp commented on June 2, 2024

This font does not need Format 4 Axis values tables, as far as I can tell.

All your SemiBolds are at 600, all your UltraExpandeds are at 200, etc. In other words, the instances in the design space are on an orthogonal grid, and therefore Inconsolata is best served by 17 (=8+9) Axis values tables in format 1, 2 or 3 (see table), rather than 72 (=8*9) in format 4. You in fact have 76 Axis value tables including 4 duplicates (e.g. AxisValue indices 2 and 70, both UltraExpanded ExtraLight).

axisIndex name value
0 ExtraLight 200
0 Light 300
0 (Regular) 400
0 Medium 500
0 SemiBold 600
0 Bold 700
0 ExtraBold 800
0 Black 900
1 UltraCondensed 50
1 ExtraCondensed 62.5
1 Condensed 75
1 SemiCondensed 87.5
1 (Regular) 100
1 SemiExpanded 112.5
1 Expanded 125
1 ExtraExpanded 150
1 UltraExpanded 200

BTW you mean format v1.2, which is the latest on the Microsoft STAT spec and in your font.

In any case, Samsa GUI should still support Format 4 :)

from samsa.

Lorp avatar Lorp commented on June 2, 2024

Do you know if MS Office rejects all format v1.2 STAT tables, or only the Format 4 Axis value tables inside them? /cc @robmck-ms

from samsa.

Lorp avatar Lorp commented on June 2, 2024

The samsa-core.js STAT parser does work with Format 4, in case you want to hack. Type GLOBAL.vf.tables["STAT"].data into the console to see the data. Here’s an extract from Inconsolata[wdth,wght].ttf:

Screenshot 2020-03-24 at 18 50 39

from samsa.

Lorp avatar Lorp commented on June 2, 2024

Related, a couple of weeks ago @twardoch wrote an interesting post about non-orthogonality and STAT, googlefonts-discuss, Re: Variable fonts: Do we really need so many instances, referring to @typoland’s nice diagram in his repo Instances Calculator.

exp01

from samsa.

robmck-ms avatar robmck-ms commented on June 2, 2024

On Windows, I recommend using FontSetViewer (https://github.com/fdwr/FontSetViewer) to see how the various APIs are enumerating the font. I agree that this font doesn't need format 4 - that format was created for something like DecoVar where the instances don't really group in any particular way, and the axes are more visual parameters.

Regarding office: The responsibility for STAT is below Office. For font enumeration, Office calls GDI, which relies on DirectWrite for much of the work, but also does it's own STAT table parsing. DWrite supports format 4; GDI doesn't yet.

from samsa.

robmck-ms avatar robmck-ms commented on June 2, 2024

Ugh. I can't keep up with all the threads on all the discussion forums. The intention of the weight axis user coordinates is that they are orthogonal and you use avar to map them to whatever normalized coordinate you want to get the right interpolation you want. Unfortunately, avar has it's problems... (cue XVARr/ avar2, all of which I wanted to get into the original v1.8 spec, but...)

from samsa.

m4rc1e avatar m4rc1e commented on June 2, 2024

Thank you both for your answers.

Apologies, I've been a complete idiot. After rereading the spec

The axis record provides information about a single design axis.

I always assumed the STAT wasn't for each axis but for all axes that make up an individual style. @Lorp I'll adopt your suggestion and yes I meant v1.2.

@robmck-ms thank you for the link to FontSetviewer. I'll check it out.

Feel free to close this issue if supporting format 4 lookups is out of scope.

from samsa.

Lorp avatar Lorp commented on June 2, 2024

All good. The check of what Samsa was doing with Format 4, using your sample font, made me see a bug where it wasn’t being parsed correctly :) Fixed in 75d313f.

Here are the first two records from Inconsolata in Samsa’s font.tables["STAT"].data. In formats 1, 2 and 3 the axisIndex and value properties are numeric, in format 4 they are arrays of numerics.

Screenshot 2020-03-24 at 20 14 52

I’ll leave the issue open until Samsa GUI supports Format 4.

from samsa.

davelab6 avatar davelab6 commented on June 2, 2024

The intention of the weight axis user coordinates is that they are orthogonal and you use avar to map them to whatever normalized coordinate you want to get the right interpolation you want.

Should this clarification be added to the ot spec?

Unfortunately, avar has it's problems...

Where are these documented? :)

from samsa.

robmck-ms avatar robmck-ms commented on June 2, 2024

The intention of the weight axis user coordinates is that they are orthogonal and you use avar to map them to whatever normalized coordinate you want to get the right interpolation you want.

Should this clarification be added to the ot spec?

Perhaps. It's broader than the wght axis. All axes are supposed to be independent axes (e.g. you can hold all axes constant and move one and only the feature that one controls should move). With wght, there's the added constraint that the numbers correspond to specific semantics. 400 is Regular, 700 is Bold, etc. So, if you set to wght=700, that should be the bold for whatever you have the rest of the axes set to. (or, flipside: if you keep wght=700, and move other stuff, you should always get the Bold of whatever the other axes are set to, and moving wght to 400 gives you the corresponding Regular).

So, my what I described in my previous message is implicit in the details, but this is clearly something people are stumbling on. (I've seen wdth axes that have 100 as bold and 0 as light).

Unfortunately, avar has it's problems...

Where are these documented? :)

https://github.com/Microsoft/OpenType-XVAR-proposal#the-problem plus discussions in several places about XVAR & avar2.

from samsa.

Lorp avatar Lorp commented on June 2, 2024

Samsa GUI now supports format 4 axisValueTables, from this commit d8830ee

Also in that commit, the STAT panel now gets amended as you move around the designspace.

from samsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.