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

Adjusted vertical metrics to font bounding boxes and GF requirements #47

Closed RosaWagner closed 1 year ago

RosaWagner commented 1 year ago

I think this is the last bit we need for Google Fonts. The idea of these vertical metrics is to avoid clipping and line clashes. Is it okay with you?

dy commented 1 year ago

There's a bit of trouble with these values. With current values we ensure selection range matches min/max bar and never clashes at line-height=1:

image

With adjusted values it spans outside:

image

Do you know the reason why we need these ascend/descend expanded limits?

dy commented 1 year ago

Ok, expanded ascender/descender to ±10%. (Fixed in master, so closing). It doesn't look good with line-height=1 in Safari, but well what to do:

image

(please check master branch, it passes fontbakery tests).

RosaWagner commented 1 year ago

The check was reporting you have a y-max at 1070 and a y-min at -35, so the Win metrics were to cover that. I'll check the font now and see. But I had also fixed a mistake I did with the last PR, I think I had put 35 in LineGap value instead of Descender value somewhere. Boh anyway, keeping you updated.

RosaWagner commented 1 year ago

I checked the font and it's alright. Look, if you think there is a better result with the winDescent=face.descender, let's go with it. This project is particular so it can be granted some exceptions.

You can also set the panose to "any", ie 0 everywhere (since it is not really a latin font), but this is not something important for GF.

dy commented 1 year ago

I was trying to find documentation on how panose is generated, but wasn't able to. It covers lating range... It could've been marked as monofont with symbols or something like that. Anyways - all fixed now, thanks!

RosaWagner commented 1 year ago

It wouldn't be a bad idea to set it to monospace, GF would expect this to pass the "monospace" check then : 2 0 0 9 0 0 0 0 0 0. But what would fit to your font would probably be this: 5 4 0 3 0 0 0 0 0 0 (latin symbol font with monospace width).

Everything about panose is documented there: https://learn.microsoft.com/en-us/typography/opentype/spec/os2#panose and there: https://monotype.github.io/panose/pan1.htm

dy commented 1 year ago

Thanks. 2009000000 worked, 5403000000 gave strange error. There're some warnings (report), I suspect less critical. Is workaround for them needed?

RosaWagner commented 1 year ago

The warning can be ignored, it's okay.

RosaWagner commented 1 year ago

Okay gonna ship the font, can you do all the same for Linefont ?

dy commented 1 year ago

Thanks. I was just thinking about that. Sure. I may need to ponder about special axis enabling monotone interpolation, because sine waves look jagged if rendered with linefont.

I also have an idea for "piano/midi" font, essentially wavefont caps only without bars. Can be useful for rendering piano rolls/midi sequences.

image image

I only wonder how multiple characters can be combined into "vertical stacks" - maybe something done via cursive feature or absolute offsets.

Would that be interesting for gfonts?

RosaWagner commented 1 year ago

Yes, very interesting. If you are looking for fundings, maybe send a mail directly to Dave with a quote, and cc me.