Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Contrast Axis #3

Open
felipesanches opened this issue Mar 9, 2022 · 18 comments
Open

Add Contrast Axis #3

felipesanches opened this issue Mar 9, 2022 · 18 comments
Labels
--new-axis New variable axis definition

Comments

@felipesanches
Copy link
Member

felipesanches commented Mar 9, 2022

Fonts to be onboarded that have this axis:


@yanone originally posted this at google/fonts#4355:


I'm proposing the inclusion of a "contrast" axis (CNTR) into the axis registry.
https://github.com/tallchai/akshar-type has one, that I’m currently onboarding.

tag: "CNTR"
display_name: "Contrast"
min_value: 0.0
default_value: 0.0
max_value: 100.0
precision: 1
fallback {
  name: "Low"
  value: 0.0
}
fallback {
  name: "High"
  value: 100.0
}
description:
  "Stroke contrast describes the stroke width difference"
  " between the thick and thin parts of a pen stroke."
  " Traditionally, a Redis pen nib would yield a low contrast stroke"
  " (monolinear) while a broad nib or pointed nib pen would"
  " yield a high contrast stroke."

Bildschirmfoto 2022-03-09 um 17 02 53

Bildschirmfoto 2022-03-09 um 17 03 02

cc @m4rc1e @davelab6 @rsheeter

@davelab6 davelab6 changed the title Track google/fonts issue #4355: "Inclusion of contrast axis" Add contrast axis" Mar 9, 2022
@davelab6 davelab6 changed the title Add contrast axis" Add Contrast axis Mar 9, 2022
@davelab6
Copy link
Member

davelab6 commented Mar 9, 2022

@rsheeter asked how this related to the opaque (YOPQ, XOPQ) parametric axes by @dberlow, and I responded:

One of the key idea of parametric axes is that they are "deconstructions" or "isolated forms", and are intended to be used in concert just as much as by themselves, to "construct" desired forms; when 2+ axes are used at once, the result is a "blending" (to use an oil painting metaphor).

Since we lack the long-promised and behdad-hasn't-delivered avar2 table, blending isn't as precise as it ought to be, limiting but not negating the utility of blending parametric axes. Therefore it is convenient to offer "pre-blended" axes - like weight, width, optical size, and grade.

So a "contrast" axis is, like grade, fine to onboard. I am happy @yanone has been listening to our general recommendations and his proposal is already pretty solid, I think. Yet, there's a few details to confirm, as @twardoch has said in #4 - since there are already quite a few fonts out there with similar axes, we should review them and see if there are ideas worth adopting, starting with the best 4 char axis tag string :)

@felipesanches
Copy link
Member Author

@twardoch originally posted this at google/fonts#4355 (comment):


The Contrast axis exists by many names already, as per #4 :

cntr: 2 fonts, CONT: 5 fonts, ctrs: 1 font, CTST: 1 font, CNTR: 10 fonts

@felipesanches
Copy link
Member Author

@twardoch originally posted this at google/fonts#4355 (comment):


I think the registered range should be from -100 to 100:

min_value: -100.0
default_value: 0.0
max_value: 100.0

The universalized meaning should be something like the "dominance of the thick parts over the thin parts, expressed in percent" or the "difference between 100% and the division between the thickness of the thin parts and the thickness of the thick parts". For example if the thin parts are 30 units and the thick parts are 230 units, the division yields 13% so the CONT value should be 100%–13% = 87.

Positive values should be used if the contrast follows the traditional contrast axis of the dominant writing system, and negative values should be used if the contrast follows the reversed contrast axis of the dominant writing system.

So 0 should stand for "no contrast", 100 should stand for "thin strokes are invisible and the contrast axis is traditional", and -100 should stand for "thin strokes are invisible and the contrast axis is reversed". This way, some design could go from fully reversed contrast to fully traditional contrast.

@davelab6
Copy link
Member

davelab6 commented Mar 9, 2022

cntr: 2 fonts, ctrs: 1 font,

These are not a valid tag as MS reserved lowercase tags, but we can consider CTRS also...

CONT: 5 fonts, CTST: 1 font, CNTR: 10 fonts

but CNTR seems a clear popularity winner on a rote basis. However, without seeing what the typefaces are, what the min/def/max are, and who made them, its hard to parse further.

For @twaroch's proposed negative range, that is an improvement over Yanone's original proposal; clearly negative contrast is "a thing."

These proposals also can deal with eg Latin + Devanagari that have 2 scripts with different (inverted) contrast traditions, which is nice.

@twardoch
Copy link

twardoch commented Mar 9, 2022

I’ll provide examples

@felipesanches
Copy link
Member Author

@tiroj said at google/fonts#4355 (comment):


The universalized meaning should be something like the "dominance of the thick parts over the thin parts, expressed in percent" or the "difference between 100% and the division between the thickness of the thin parts and the thickness of the thick parts". For example if the thin parts are 30 units and the thick parts are 230 units, the division yields 13% so the CONT value should be 100%–13% = 87.

I’m not sure that math would make a lot of sense to a font maker or user. I think I would favour the axis scale expressed as the percentage relationship of thin stroke to thick stroke. So in your example the value would be 13, and the contrast approaches monolinear by increasing the thickness of the thin strokes until the value reaches 100. I think most font makers will think of increasing contrast in terms of making some parts thinner, rather than in terms of making some parts thicker, and the relationship between the value and the glyph appearance is easier if thinner = smaller value.

@yanone
Copy link
Contributor

yanone commented Mar 10, 2022

-100 is good. Reverse contrast is definitely a thing :)
Would a third fallback needed called "Reversed" for -100?

@davelab6
Copy link
Member

davelab6 commented Mar 10, 2022 via email

@twardoch
Copy link

I think most font makers will think of increasing contrast in terms of making some parts thinner

Yes, but the user values are not for font makers, but for users. The dominating concept in the language is that you have "no contrast" or "little contrast" (and for it the logic dictates a value close to 0), and you have "high contrast" or "lots of contrast" (so for simplicity, you’d expect something akin to a percentage, with a hypothetical "full contrast" being something around 100%). Basically, the percentage expresses "the amount of contrast" — which is a natural interpretation of what the term "contrast" means.

My proposed "formula" (1 – thin/thick, expressed as percentage) is compatible with the linguistic interpretation, plus it still offers a solution for universalization. And the reversed vs. traditional approach takes care of actual cases, and is world-ready.

@twardoch
Copy link

For width, the spec says:

"Percentage of normal width is a comparitive scale that will depend on the specific items being compared. The width of a line of text very much depends on the content of the text. No specific reference string is specified here as the basis for comparisons; a font designer can choose what they consider to be representative strings assigning a 'wdth' value to a design variant. Ideally, the 'wdth' value should provide a good estimate for most strings in the target languages of how the width of the string formatted with that 'wdth' variant compares to the width of the same string when formatted with the “normal” variant."

Without avar2, it’s not possible to do width axis that is sensible across optical size, for example. Roboto Flex rightly varies much more in width in the high opsz, but varies much less in the low opsz. So to pick the right width scale, the vendor needs to make some compromise.

The same would be true for contrast. To provide a contrast scale in a multi-axis font, the vendor should use the stroke thickness proportions of the instance that the vendor considers the primary use case.

It’s not sensible / possible to provide fool-proof mandate on the universal scale for contrast, but I still think it’s reasonable to provide sensible directional guidance.

@twardoch
Copy link

Then the software engineers developed wording for the OT spec, they originally always thought about some neat numeric stuff. This was true for PANOSE, for OS/2.usWidthClass, and to some extent for the descriptions of the var axes like wdth. In case of wdth, they fortunately added some softening language, though still not enough. It’s clear that cases like "the visual scale of width changes as opsz changes" were not really considered, or perhaps were dismissed as "exotic ideas". But they’re at the core of type design.

Overall, I’m not a great friend of "universal scales" that are based on strict measuring. But on the other hand, vendors like some guidance, and contrast is common enough that some common interpretation of the numbers would be desirable — just so that the implementations don’t differ wildly. They will differ if we don’t provide guidance. So the "simple" interpretation is to go from optionally -100 via 0 to 100 and see this is just a "percentage" (0 is "low", 100 is "high") within your own design, but the slightly smarter scale is along the lines I proposed — so -100 and 100 are "objectively extreme" contrasts, while values in-between are based on simple measuring (1 – thin/thick as percentage, based on a "most representative" instance of the design, with the font vendor having freedom to pick how they choose the most representative thing).

The most representative thing does not have to be "Regular". The vendor should have some freedom there. For example a vendor may have developed a high optical size first (think Playfair Display) and if there were a contrast axis, the vendor could use that high opsz to base the scale — also because the contrast typically varies most and is largest at high opsz. And then, if the vendor adds lower opsz (as is happening with Playfair), the scale would be propagated. This is the compromise, because without avar2 it’s not really possible to do differently.

@twardoch
Copy link

Re YOPQ and XOPQ — the parametric axes are used for synthesizing certain typographic effects by combining values on them. They’re intended for advanced users, and David Berlow’s idea is also that they ultimately may be hidden from the end-user UIs. The *OPQ axes are specifically tied to purely-vertical and purely-horizontal contrast.

The CNTR axis is intended for end-users, and provides an intuitive scale that is universal to some extent, so switching or mixing fonts at the same contrast axis value would produce comparable results. It is up to the designer to decide where exactly the typographic contrast varies — this may be horizontal strokes in some letters, vertical strokes in other letters, and diagonal strokes in yet other letters. The proposal takes into account the notion of "traditional" contrast for a given writing system.

For example, in Latin fonts, the so-called "old-style" serif fonts typically have contrast that falls diagonally. In the letter "O", the thinnest parts are in the top-left and the bottom-right "corners". "Modern" serif fonts have contrast that increases horizontally, so the thinnest parts are in the top and bottom. But in Arabic, the traditional contrast is such that the thinnest parts are on the let and right, and the thickness increases vertically. This has to do with the way calligraphers traditionally hold a flat writing tool.

If a font increases contrast in the direction that is compatible with the traditional notion of contrast for a given writing system, the CNTR axis value increases from 0 up to 100. But if the font increases contrast in the "reversed" direction, the axis value changes towards -100.

@dberlow
Copy link

dberlow commented Mar 10, 2022 via email

@davelab6
Copy link
Member

There are 3 general benefits to variable fonts, to compress, to express, to finesse.

To me there's a clear distinction between parametric opaque axes and a contrast axis; the former are to finesse and the latter is to express. Similarly as @dberlow says, grade is to finesse and uniwidth is to express.

A contrast axis blends changes in both X and Y dimensions even more than parametric opaque axes do; XOPQ mainly focuses on the X dimension and YOPQ mainly focuses on the Y dimension, their main focus is what makes them essentially parametric; a single OPQ axis would inherently not be a parametric axis, since it isn't isolating a parameter.

The benefit for end users of such a single blend is its context of use for expressivity. I don't really see this as different to expressive weight or width axes on os/2 class value ranges; ideally (perhaps gated on an avar2 table) we could have fonts built without those axes and only parametric axes and recipes to use them in concert to access the styles that are available in fonts built with os2 axes.

But for now, we have fonts without parametric axes that are pre-blended, and that's OK.

@felipesanches felipesanches changed the title Add Contrast axis Add Contrast Axis Mar 11, 2022
@yanone
Copy link
Contributor

yanone commented May 19, 2022

But in Arabic, the traditional contrast is such that the thinnest parts are on the let and right, and the thickness increases vertically. This has to do with the way calligraphers traditionally hold a flat writing tool.

For the sake of smart-assing, I need to correct this: Arabs and everyone else hold the pen the same way. But the Arabic broad nib reed pens were cut at an angle inverse to the Latin reed pens (or, possibly, Latin pens where cut straight). If you hold the below pen in the correct way, it produces a horizontal-emphasis stroke. I could only find pictures that show pens from underneath, so imagine it mirrored.

6043a098f4bb4da20672aa32_DSC00126

To add to the actual discussion, or rather, confirm what's been said:
We need -100 to 100 range for this axis, and 100 should yield a contrast axis that's the dominant one for each font’s dominant writing script.
Meaning: The contrast for Arabic and Latin is typically inverse as we've discussed, but both cases should carry positive CNTR values.

@chrissimpkins chrissimpkins added the --new-axis New variable axis definition label Sep 21, 2022
@tallchai
Copy link

tallchai commented Mar 8, 2023

Hi, checking if there is an update on this. It's been open since a year.

@dberlow
Copy link

dberlow commented Mar 9, 2023 via email

@tiroj
Copy link

tiroj commented Mar 9, 2023

In calligraphic fonts, as well as any font with contrast, it is fine with me if XOPQ is the long side of the tool, YOPQ is the short side of the tool, and whatever angle that tool is held at, the marks of the form left by the short end, are YOPQ, and those left by the long side are XOPQ, and the stuff in between is in the hands of the tool holder.

To be sure I understand correctly: are you saying that in ‘any font with contrast’ the meaning of XOPQ and YOPQ is disassociated from X,Y directionality, and instead reflects the dynamics of a notional writing tool as applied to different scripts? So ‘X’ is always whatever is conventionally heaviest, and ‘Y’ is always what is conventionally thinnest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--new-axis New variable axis definition
Projects
None yet
Development

No branches or pull requests

8 participants