mbutterick/quad

allow baseline adjustment to support superscript & subscript

Closed this issue · 7 comments

Maybe this would be a 'baseline-adjust used in conjunction with 'font-size-adjust? I don't know much about algorithmically typesetting super/subscript but I know enough to know every font is probably going to need different values.

Better-quality fonts already contain correctly scaled superscript & subscript figures (invoked as the OpenType layout features sups and subs). So I think the best way is just to use these features via the existing font-features attribute (?)

As for fonts that don’t have these features, you’re right that there’s no single algorithmic technique that will always work, so it starts to drift into the realm of hacky approximations. Moreover, these techniques were originally necessary only because fonts didn’t have the sups and subs features.

How widespread is support for sups/subs among fonts? For example I’m working with a font that supports it (Fabiol Pro), but only for digits. Supposing I wanted to use one of the other glyphs in superscript, I would have to find some other way to determine my own manual own scaling and bump it up from the baseline.

If you’re asking for a baseline-adjust attribute so you can make your own subscript / superscript styling, I don’t see any problem with that.

As for “how widespread is support” — widespread among paid fonts, not as widespread among free fonts, I’d suppose. You’re right that in most cases, it’s just figures (that’s all I do, in my fonts) and sometimes a subset of the lowercase (like aehilmorst)

OK yes, I agree baseline-adjust is the way to go. There are a number of non-numeric glyphs like asterisks and daggers that are often used in superscript, but some fonts don't scale/place the “normal” glyph as superscript and don’t support it with sups either.

It will henceforth be known as font-baseline-shift

(because -adjust connotes a delta to an existing attribute value)