googlefonts / roboto-classic

Development of a Roboto Variable font
SIL Open Font License 1.1
151 stars 15 forks source link

[designspaces] weight axis values need to be mapped from 1-1000 #12

Closed m4rc1e closed 6 years ago

m4rc1e commented 6 years ago

According to Microsoft Weight Axis tag spec

Valid numeric range: Values must be in the range 1 to 1000.

We're inheriting the values from the old build process which have a range of -1-1.125

Unfortunately these values are not css friendly (font-weight is broke)

screen shot 2018-06-27 at 16 19 05 Setting ccs font-weight does not match previous family instances

To fix this, we update the weight axis in each designspace file to.

        <axis default="525.294118" maximum="900" minimum="250" name="weight" tag="wght">
            <labelname xml:lang="en">Weight</labelname>
            <map input="250" output="-1" />
            <map input="525.294118" output="-0.1" />
            <map input="900" output="1.125" />
        </axis>

We're now assigning a map input to each output val.

We should now get a better result

screen shot 2018-06-27 at 16 30 22 Appearance is still off because fonts lack avar table

To get a 100% match, I need to work out why the avar tables are not being generated.

@cjdunn I wouldn't worry about this. I'll update update it myself once I get a working avar table as well.

cjdunn commented 6 years ago

@m4rc1e OK great, thanks for the update. Please let me know if there's anything you need me to do here, thanks.

m4rc1e commented 6 years ago

For a perfect fit, we need to replace the weight axis in the designspaces with:

        <axis default="400" maximum="900" minimum="250" name="weight" tag="wght">
            <labelname xml:lang="en">Weight</labelname>
            <map input="250" output="-1" />
            <map input="300" output="-0.550000" />
            <map input="400" output="-0.1" />
            <map input="500" output="0.350000" />
            <map input="700" output="0.730000" />
            <map input="900" output="1.125" />
        </axis>

Each master and instance also needs their xvalues updated. I'll send a pr when I'm done.

screen shot 2018-06-28 at 13 52 40

davelab6 commented 6 years ago

@m4rc1e this will be resolved when #13 is merged, correct?

m4rc1e commented 6 years ago

Yes

m4rc1e commented 6 years ago

Closing. This is solved in #15.