dy / wavefont

Typeface for rendering waveform/data
https://dy.github.io/wavefont/scripts/
SIL Open Font License 1.1
416 stars 7 forks source link

Remove wdth axis #43

Closed dy closed 1 year ago

dy commented 1 year ago
dy commented 1 year ago

Ok, removed wdth.

dy commented 1 year ago

The reason for internal width axis is these images:

image image image

It's quite problematic to adjust that via relative letter-spacing (measured relatively to char width). It's easier to set fixed char advance width and adjust weight within its bounds. Letter-spacing can also be used to regulate space between chars, but essentially the font becomes monontonic, in sense axes variation doesn't change characters distance. The problem is if we fix chars width to max width then thin chars will always be spaced.

We should match linefont:

The coef between each is 2 ** (1/3)

There's a problem with log relation: wght=100 is not mapped to minimal weight of 5. Besides, intermediate values are a bit hard to guess.
A better alternative is linear range: 100:1, 200:25, 300:50, 400:75, 500:100, 600:125, 700:150, 800:175, 900:200. That's a bit hard to guess though as well, also it's non-linear for min-weight.

Factor of 4 would work better: 40:10, 100:25, 200:50, 300:75, 400:100, 500:125, 600:150, 700:175, 800:200, 900:225, 1000:250. It perfectly gives width=100 for font-weight=400. It gives very predictable results. But very meaningless for manual linefont entry: values are very localized around ~50..200. Also it underutilizes mapping: we could've just left designspace coords.

An alternative is sqrt2 non-linearity:

Note that weight span is 1..1000, not 100..900 https://github.com/googlefonts/axisregistry/blob/main/Lib/axisregistry/data/weight.textproto#L4.

dy commented 1 year ago

@RosaWagner I am going to need to readjust linefont/wavefont weight mapping to better match 2 ** (1/3) coef. Also I am going to reintroduce wdth axis for wavefont - turns out it's very practical to have that - considering weight is limited to 5..200, wdth can be 25..200 safely as well without growing font size much. Also I am going to redo the first promo image, it must be more inspirational / showcase, rather than features list.

RosaWagner commented 1 year ago

@dy wavefont is already onboarded and live, we can't change the weight axis anymore otherwise it's going to break all website using it.

dy commented 1 year ago

@RosaWagner the change just better maps intermediate weights 800, 700, 500, 400, 300, 200, 100 to more precise log values (within 15%), because current values are handpicked and not precise. Would that be a breaking? Can we make a major iteration of font? In current form it's not as useful. New version will also look better in font tester - because wdth axis will introduce natural spacing between bars.

RosaWagner commented 1 year ago

If the wdth axis only adds space, with have a registered spacing axis

dy commented 1 year ago

I see. In wavefont wght and wdth play same role, if following axis definitions. But wdth would match linefont. So it's either linefont should use spacing instead of wdth or wavefont should use wdth and not spacing. Otherwise it would be difficult to match these two fonts - spacing has relative percentage units -100..+100, wdth has absolute-ish units 25..200. Besides wdth range nicely matches design-space wght range 5..200, so that these two axes play well, unlike spacing+wght.

One anticipated change introduced by wght: figma displays wavefont the following way:

image

With wdth it would look more like this:

image

So yes, it could be a breaking change

RosaWagner commented 1 year ago

Okay, please do the changes, better breaking sooner than later

dy commented 1 year ago

@RosaWagner I've just released v4. It includes wdth axis. .woff2 size didn't change, .ttf got +7kb, not +30% as I expected. Now font has way nicer default look, so everyone wins from that:

image

Also it has properly mapped typographic-scale widths.

I am going to come up with poster design using the new version. Looking forward to your feedback. Sorry for the post-changes.

dy commented 1 year ago

Cold shower from using new wdth axis.

dy commented 1 year ago

Ok, linearized wght axis, removed wdth axis. It must be a good balance of simplicity / predictability now. No big damage introduced, in fact existing designs must be improved.

RosaWagner commented 1 year ago

Are you able to keep the default weight at 100 like before?

dy commented 1 year ago

It's a bit problematic - I'd need to add extra master, which increases font-size/source size. Is min value not desirable?

RosaWagner commented 1 year ago

Not this min value that can't be attached to any existing instance, it can create rendering issue and naming conflict in an environment that doesn't support variable fonts. What would be the size increase?

dy commented 1 year ago

Ok, I will add a master for default value. It won't be significant, just minor performance tax and /source increase up to 30%.

dy commented 1 year ago

Added default as 100. .ttf size increased from 77kb to 100kb, .woff2 size didn't change.

RosaWagner commented 1 year ago

it's a very acceptable increase ;)