Fix bar's ranks

This commit is contained in:
be5invis 2020-10-27 22:41:51 -07:00
parent e719992f2c
commit f0262ba5f8
6 changed files with 18 additions and 17 deletions

View file

@ -485,6 +485,8 @@ Subsection `variants` is used to configure character variants in the font. Prope
+ `percent = 'rings'`, `cv54 = 2`: Percent `%` with rings and broken bar; Per-mille `‰` and basis point `‱` with rings (default). + `percent = 'rings'`, `cv54 = 2`: Percent `%` with rings and broken bar; Per-mille `‰` and basis point `‱` with rings (default).
+ `percent = 'rings-connected'`, `cv54 = 3`: Percent `%`, Per-mille `‰` and basis point `‱` using rings and continuous bar. + `percent = 'rings-connected'`, `cv54 = 3`: Percent `%`, Per-mille `‰` and basis point `‱` using rings and continuous bar.
- Styles for `|`: - Styles for `|`:
+ `bar = 'natural-slope'`, `cv55 = 1`: Bar punctuations (`|`) has a natural slope under italics and oblique (default).
+ `bar = 'force-upright'`, `cv55 = 2`: Bar punctuations (`|`) is forced upright under italics and oblique.
- Styles for `<=`, `>=`: - Styles for `<=`, `>=`:
+ `lig-ltgteq = 'flat'`, `cv56 = 1`: The lower bar of `<=` and `>=` ligation is flat. + `lig-ltgteq = 'flat'`, `cv56 = 1`: The lower bar of `<=` and `>=` ligation is flat.
+ `lig-ltgteq = 'slanted'`, `cv56 = 2`: The lower bar of `<=` and `>=` ligation is slanted. + `lig-ltgteq = 'slanted'`, `cv56 = 2`: The lower bar of `<=` and `>=` ligation is slanted.

View file

@ -1569,15 +1569,13 @@ sampler = '|'
tag = 'cv55' tag = 'cv55'
[prime.bar.variants.natural-slope] [prime.bar.variants.natural-slope]
tag = "VXCY" rank = 1
sampler = '|'
description = 'Bar punctuations (`|`) has a natural slope under italics and oblique' description = 'Bar punctuations (`|`) has a natural slope under italics and oblique'
selectorUpright.bar = "naturalSlope" selectorUpright.bar = "naturalSlope"
selectorItalic.bar = "naturalSlope" selectorItalic.bar = "naturalSlope"
[prime.bar.variants.force-upright] [prime.bar.variants.force-upright]
tag = "VXCZ" rank = 2
sampler = '|'
description = 'Bar punctuations (`|`) is forced upright under italics and oblique' description = 'Bar punctuations (`|`) is forced upright under italics and oblique'
selectorUpright.bar = "naturalSlope" selectorUpright.bar = "naturalSlope"
selectorItalic.bar = "forceUpright" selectorItalic.bar = "forceUpright"

View file

@ -4,9 +4,9 @@
<tbody> <tbody>
<%_ for(const group of ligation.sets) { _%> <%_ for(const group of ligation.sets) { _%>
<%_ const tagSet = new Set(group.ligSets); _%> <%_ const tagSet = new Set(group.ligSets); _%>
<%_ const featureSettings = group.tag === 'calt' ? `style="font-feature-settings:'${group.tag}' ${group.switch||'on'}"` : `style="font-feature-settings: 'calt' off, '${group.tag}' ${group.switch||'on'}"` _%> <%_ const featureSettings = group.tag === 'calt' ? `style="font-feature-settings:'${group.tag}' ${group.rank}"` : `style="font-feature-settings: 'calt' off, '${group.tag}' ${group.rank}"` _%>
<tr class="note"> <tr class="note">
<td><%= group.tagName || group.tag %><%= group.switch ? ' ' + group.switch : ''%></td> <td><%= group.tagName || group.tag %><%= group.rank === 1 ? '' : group.rank === 0 ? ' off' : ' ' + rank %></td>
<td><%= group.desc %></td> <td><%= group.desc %></td>
</tr> </tr>
<tr> <tr>

View file

@ -52,13 +52,13 @@ async function processCv() {
const defaults = figureOutDefaults(variantsData, gr); const defaults = figureOutDefaults(variantsData, gr);
for (const config of gr.variants) { for (const config of gr.variants) {
if (!config.rank) continue; if (!config.rank) continue;
let selectorText = `\`${gr.key} = '${config.selector}'\``; let selectorText = `\`${gr.key} = '${config.key}'\``;
if (gr.tag && config.rank) { if (gr.tag && config.rank) {
selectorText += `, \`${gr.tag} = ${config.rank}\``; selectorText += `, \`${gr.tag} = ${config.rank}\``;
} }
md.log( md.log(
` + ${selectorText}: ` + ` + ${selectorText}: ` +
`${config.description}${formatDefaults(config.selector, defaults)}.` `${config.description}${formatDefaults(config.key, defaults)}.`
); );
} }
} }
@ -120,32 +120,32 @@ function figureOutDefaults(variantsData, gr) {
desc: "Sans Upright", desc: "Sans Upright",
mask: 1, mask: 1,
result: null, result: null,
selector: [...variantsData.defaults.sansUpright.composition] keys: [...variantsData.defaults.sansUpright.composition]
}, },
{ {
desc: "Sans Italic", desc: "Sans Italic",
mask: 2, mask: 2,
result: null, result: null,
selector: [...variantsData.defaults.sansItalic.composition] keys: [...variantsData.defaults.sansItalic.composition]
}, },
{ {
desc: "Slab Upright", desc: "Slab Upright",
mask: 4, mask: 4,
result: null, result: null,
selector: [...variantsData.defaults.slabUpright.composition] keys: [...variantsData.defaults.slabUpright.composition]
}, },
{ {
desc: "Slab Italic", desc: "Slab Italic",
mask: 8, mask: 8,
result: null, result: null,
selector: [...variantsData.defaults.slabItalic.composition] keys: [...variantsData.defaults.slabItalic.composition]
} }
]; ];
for (const variant of gr.variants) { for (const variant of gr.variants) {
for (const dc of defaultConfigs) for (const dc of defaultConfigs)
for (const selector of dc.selector) for (const selector of dc.keys)
if (variant.fullSelector === selector) dc.result = variant.selector; if (variant.fullKey === selector) dc.result = variant.key;
} }
return defaultConfigs; return defaultConfigs;
} }

View file

@ -245,7 +245,7 @@ module.exports = async function getLigationData() {
function buildLigationSet(ligData, getKey) { function buildLigationSet(ligData, getKey) {
const ligationSets = new Map([ const ligationSets = new Map([
["*off", { tag: "calt", switch: "off", desc: "Ligation Off", brief: "Off", ligSets: [] }] ["*off", { tag: "calt", rank: 0, desc: "Ligation Off", brief: "Off", ligSets: [] }]
]); ]);
for (const sel in ligData.composite) { for (const sel in ligData.composite) {
const comp = ligData.composite[sel]; const comp = ligData.composite[sel];
@ -259,6 +259,7 @@ function buildLigationSet(ligData, getKey) {
} }
item = { item = {
tag: comp.tag, tag: comp.tag,
rank: 1,
ligSets: [...ligSets], ligSets: [...ligSets],
tagName: comp.tag, tagName: comp.tag,
desc: comp.desc, desc: comp.desc,

View file

@ -45,8 +45,8 @@ function getCvData(parsed) {
} }
for (const variant of prime.variants.values()) { for (const variant of prime.variants.values()) {
gr.variants.push({ gr.variants.push({
selector: variant.key, key: variant.key,
fullSelector: getSelectorKey(prime, variant), fullKey: getSelectorKey(prime, variant),
rank: variant.rank, rank: variant.rank,
description: variant.description description: variant.description
}); });