Let’s say I have a handwriting font with 5 variants per letter, and all possible combinations make sense. So, I’d not use Stylistic Sets (as that would go against the idea of sets); I’d use Character Variants instead. I’ll name them glyphs .cv01 to .cv05, use Glyphs’ auto-generated features and be done.
Glyphs will implement the features as sub ... by, i.e. lookup type 1.
However, the spec says that lookup type 3 would be the natural choice (unless there is only one variant). Would a user want to implement it like this manually, using sub ... from? Or, would a different font editor or a future version of Glyphs want to auto-implement Character Variants like this? In that case, we’d only have one feature, cv01 (never mind the glyph names), I assume? What’s the point of the spec defining 99 of them if it could (or even should) be implemented as alternate substitution?
I’m a bit confused. Am I missing something? Can someone clarify? Thanks!
Character variants push against what the glyph naming scheme can represent. If there is just a single alternative for each standard glyph, you can use the name suffixes:
a a.cv01
aacute aacute.cv01
...
g g.cv02
gacute gacute.cv02
...
If you want multiple alternatives per standard glyph, then you need to write the code manually:
# cv01:
sub a from [a.alt1 a.alt2 a.alt3];
sub aacute from [aacute.alt1 aacute.alt2 aacute.alt3];
# cv02:
sub g from [g.alt1 g.alt2 g.alt3];
sub gacute from [gacute.alt1 gacute.alt2 gacute.alt3];
My question was not necessarily from the perspective of a typical Glyphs user, I am simply trying to understand how cvXX is meant to work. Sorry if this was not clear.
What I don’t understand: Why would you group the letter and the accented versions in one feature, as in your examples? Why not simply put everything in one big feature (only using cv01)?
Say you want single-story glyphs of /a and /g. That could be a style set ss01 that changes /a and /g (and their precomposed glyphs).
If a user just wants the single-story style for the /a but not for /g, they cannot do that with a style set.
A character variant changes just glyph of a specific character (and its precomposed/otherwise related glyphs). So, a user could enable cv01 to get a single-story /a but keep the default double-story /g. The single-story /g could then be activated separately as cv02, for example.
Now, for some glyphs, you want to offer multiple styles. Your handwritten font has five different styles for each glyph. You could make a cv## for each glyph (and it’s precomposed glyphs) so the user can pick the exact /a, /b, /c and so on that they want, like:
cv01=1
cv02=3
cv03=0
…
This works well when applying a single configured font to a text. If the user instead selects each glyph individually and then wants to choose an alternative glyph, the salt feature might be what you are after (but that can break kerning, as now different font configurations apply to different text ranges).
\subsubsection{Character Variant 9: Single-storey a}
Switches between different combinations of double- and single-storey a in Upright and Italic.
\begin{quote}
Coal \emph{Coal} (Default)\\
{\addfontfeature{RawFeature={+cv09=0}} Coal \emph{Coal} (Variant 1)}\\
{\addfontfeature{RawFeature={+cv09=1}} Coal \emph{Coal} (Variant 2)}\\
{\addfontfeature{RawFeature={+cv09=2}} Coal \emph{Coal} (Variant 3)}
\end{quote}
(There are only two variants of a in this typeface, but I kind of liked the hack that you can coordinate the upright and italic styles by offering 4 options (including the default).
For CSS, selecting the 2nd alternate would work like this:
As an example, showing a table and the corresponding Character Variant entries in the Affinity panel may be useful. Note that one of the Lycian Letter R is in the third position under cv16.
If there are no variants, obviously, there is no need to assign a character variant definition. If there is a variant, then you should be OK with using cvXX suffixes only. More than one variant requires cvXX/1 (alt1), cvXX/2 (alt2), cvXX/3 (alt3)… scheme and manual coding.
I’m not sure if this will be of any help, and sorry for such an uncommon use case.
Will have to wrap my head around this a bit more. My (obviously incomplete) understanding was, Stylisic Sets are used whenever we have dependent alternates whereas Character Variants imply that all alternates are independent, and we don’t have any sets at all. That’s not quite true, as it seems.
Seems like a single cvXX feature is more like a 2D version of ssXX, and a cvXX feature could be “serialized” into multiple ssXX features with equivalent functionality and behaviour?
Could we also put it this way: The Stylistic Set is used to group different characters that are the similar in some way, while the Character Variant is used to specify or group same characters that are different in some way — though, of course, not a rule.
In the example above, I had also grouped the glyphs using the Stylistic Set (regardless of their forms), but solely based on their inclusion in the Variant 1, Variant 2, … sequence — in my case, by examining the paleographic identifiers of the same character, it was also possible to estimate which region and/or period they belonged to, based on a sequence ranging from the more commonly used to the rarer ones.
While on the CV subject…how would naming of Variants within a particular CV work so it shows up with a name/description in programs and on tooltip hover etc.
Not sure if G4 has it already but Georg mentioned at one point there would be an easier way to add naming to CVs (similar to how they are added with SS).
I’ve used this format but that was only for one variant. What would be needed if more is than one variant?
cvParameters { FeatUILabelNameID { name 3 1 0x0409 "Ayb Alternate"; }; FeatUITooltipTextNameID { name 3 1 0x0409 "Alternate form of Armenian uppercase letter Ayb"; }; SampleTextNameID { name 3 1 0x0409 "Ա"; }; ParamUILabelNameID { name 3 1 0x0409 "Default"; }; ParamUILabelNameID { name 3 1 0x0409 "Alternate"; }; Character 0x0531; };