typemytype / drawbot

http://www.drawbot.com
Other
408 stars 63 forks source link

fontVariations() or fontVariation()? #403

Closed ori-bendor closed 3 years ago

ori-bendor commented 4 years ago

The fontVariations() function(s?) picks just a single variation. Consider changing its name to fontVariation().

justvanrossum commented 4 years ago

I understand your point. But it simply refers to how the mechanism is called: https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview (fontVariations() gives you control over the font's variations). In addition to that, you can choose values for multiple variation axes. I'm not sure if I find the singular fontVariation() an improvement at all, but even if people do consider it an improvement, I question whether it is significant enough to change the drawing API.

ori-bendor commented 4 years ago

Hi Just, thank you for this comment. I understand that the mechanism is called Font Variations, but while for the mechanism as a whole it makes sense to use the plural form, for a function that picks a single variation – not so much. Correct me if I'm wrong, but the arguments are used for specifying a coordinate on each axis, and then the function sets the variation which corresponds to the unique, single point with those coordinates in the design space. So while there are multiple axes/coordinates involved, there's only one point/variation. I'd admit that not wanting to change an existing API is a strong argument against my suggestion. What about changing the name and adding the old one as an alias? I'm not sure that's a good practice, though.

justvanrossum commented 4 years ago

You're not necessarily wrong, but I don't think the function name is wrong enough to warrant a change.

FWIW, it's called similarly in HarfBuzz: https://harfbuzz.github.io/harfbuzz-hb-font.html#hb-font-set-variations

ori-bendor commented 4 years ago

Fair enough.