Fix bar's ranks
This commit is contained in:
parent
e719992f2c
commit
f0262ba5f8
6 changed files with 18 additions and 17 deletions
|
@ -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-connected'`, `cv54 = 3`: Percent `%`, Per-mille `‰` and basis point `‱` using rings and continuous bar.
|
||||
- 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 `<=`, `>=`:
|
||||
+ `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.
|
||||
|
|
|
@ -1569,15 +1569,13 @@ sampler = '|'
|
|||
tag = 'cv55'
|
||||
|
||||
[prime.bar.variants.natural-slope]
|
||||
tag = "VXCY"
|
||||
sampler = '|'
|
||||
rank = 1
|
||||
description = 'Bar punctuations (`|`) has a natural slope under italics and oblique'
|
||||
selectorUpright.bar = "naturalSlope"
|
||||
selectorItalic.bar = "naturalSlope"
|
||||
|
||||
[prime.bar.variants.force-upright]
|
||||
tag = "VXCZ"
|
||||
sampler = '|'
|
||||
rank = 2
|
||||
description = 'Bar punctuations (`|`) is forced upright under italics and oblique'
|
||||
selectorUpright.bar = "naturalSlope"
|
||||
selectorItalic.bar = "forceUpright"
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<tbody>
|
||||
<%_ for(const group of ligation.sets) { _%>
|
||||
<%_ 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">
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -52,13 +52,13 @@ async function processCv() {
|
|||
const defaults = figureOutDefaults(variantsData, gr);
|
||||
for (const config of gr.variants) {
|
||||
if (!config.rank) continue;
|
||||
let selectorText = `\`${gr.key} = '${config.selector}'\``;
|
||||
let selectorText = `\`${gr.key} = '${config.key}'\``;
|
||||
if (gr.tag && config.rank) {
|
||||
selectorText += `, \`${gr.tag} = ${config.rank}\``;
|
||||
}
|
||||
md.log(
|
||||
` + ${selectorText}: ` +
|
||||
`${config.description}${formatDefaults(config.selector, defaults)}.`
|
||||
`${config.description}${formatDefaults(config.key, defaults)}.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -120,32 +120,32 @@ function figureOutDefaults(variantsData, gr) {
|
|||
desc: "Sans Upright",
|
||||
mask: 1,
|
||||
result: null,
|
||||
selector: [...variantsData.defaults.sansUpright.composition]
|
||||
keys: [...variantsData.defaults.sansUpright.composition]
|
||||
},
|
||||
{
|
||||
desc: "Sans Italic",
|
||||
mask: 2,
|
||||
result: null,
|
||||
selector: [...variantsData.defaults.sansItalic.composition]
|
||||
keys: [...variantsData.defaults.sansItalic.composition]
|
||||
},
|
||||
{
|
||||
desc: "Slab Upright",
|
||||
mask: 4,
|
||||
result: null,
|
||||
selector: [...variantsData.defaults.slabUpright.composition]
|
||||
keys: [...variantsData.defaults.slabUpright.composition]
|
||||
},
|
||||
{
|
||||
desc: "Slab Italic",
|
||||
mask: 8,
|
||||
result: null,
|
||||
selector: [...variantsData.defaults.slabItalic.composition]
|
||||
keys: [...variantsData.defaults.slabItalic.composition]
|
||||
}
|
||||
];
|
||||
|
||||
for (const variant of gr.variants) {
|
||||
for (const dc of defaultConfigs)
|
||||
for (const selector of dc.selector)
|
||||
if (variant.fullSelector === selector) dc.result = variant.selector;
|
||||
for (const selector of dc.keys)
|
||||
if (variant.fullKey === selector) dc.result = variant.key;
|
||||
}
|
||||
return defaultConfigs;
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ module.exports = async function getLigationData() {
|
|||
|
||||
function buildLigationSet(ligData, getKey) {
|
||||
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) {
|
||||
const comp = ligData.composite[sel];
|
||||
|
@ -259,6 +259,7 @@ function buildLigationSet(ligData, getKey) {
|
|||
}
|
||||
item = {
|
||||
tag: comp.tag,
|
||||
rank: 1,
|
||||
ligSets: [...ligSets],
|
||||
tagName: comp.tag,
|
||||
desc: comp.desc,
|
||||
|
|
|
@ -45,8 +45,8 @@ function getCvData(parsed) {
|
|||
}
|
||||
for (const variant of prime.variants.values()) {
|
||||
gr.variants.push({
|
||||
selector: variant.key,
|
||||
fullSelector: getSelectorKey(prime, variant),
|
||||
key: variant.key,
|
||||
fullKey: getSelectorKey(prime, variant),
|
||||
rank: variant.rank,
|
||||
description: variant.description
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue