make release would now bundle web fonts (WOFF and WOFF2)
This commit is contained in:
parent
79a6f897d9
commit
815cf1ad1e
4 changed files with 28 additions and 14 deletions
24
maker.js
24
maker.js
|
@ -58,11 +58,11 @@ let definedBuildSeqs = {};
|
||||||
function createMake(mapping) {
|
function createMake(mapping) {
|
||||||
const { hives, dir, filename, cm, custom } = mapping;
|
const { hives, dir, filename, cm, custom } = mapping;
|
||||||
let tfname = `$(BUILD)/${filename}.0.otd`;
|
let tfname = `$(BUILD)/${filename}.0.otd`;
|
||||||
let target = `$(DIST)/${dir}/${filename}.ttf`;
|
|
||||||
let cmTarget = `$(BUILD)/${filename}.charmap`;
|
let cmTarget = `$(BUILD)/${filename}.charmap`;
|
||||||
|
|
||||||
let woffTarget = `$(DIST)/${dir}/web/${filename}.woff`;
|
let target = `$(DIST)/${dir}/ttf/${filename}.ttf`;
|
||||||
let woff2Target = `$(DIST)/${dir}/web/${filename}.woff2`;
|
let woffTarget = `$(DIST)/${dir}/woff/${filename}.woff`;
|
||||||
|
let woff2Target = `$(DIST)/${dir}/woff2/${filename}.woff2`;
|
||||||
|
|
||||||
let buf = "";
|
let buf = "";
|
||||||
if (!definedBuildSeqs[tfname]) {
|
if (!definedBuildSeqs[tfname]) {
|
||||||
|
@ -73,7 +73,7 @@ ${tfname} : ${custom || ''} $(SCRIPTS) | $(BUILD) $(DIST)/${dir}/
|
||||||
definedBuildSeqs[tfname] = true;
|
definedBuildSeqs[tfname] = true;
|
||||||
}
|
}
|
||||||
buf += `
|
buf += `
|
||||||
${target} : ${tfname} | $(DIST)/${dir}/
|
${target} : ${tfname} | $(DIST)/${dir}/ttf/
|
||||||
@echo Hinting and optimizing ${tfname} '->' $@
|
@echo Hinting and optimizing ${tfname} '->' $@
|
||||||
@otfccbuild ${tfname} -o $(BUILD)/${filename}.1.ttf --keep-average-char-width
|
@otfccbuild ${tfname} -o $(BUILD)/${filename}.1.ttf --keep-average-char-width
|
||||||
@ttfautohint $(BUILD)/${filename}.1.ttf $(BUILD)/${filename}.2.ttf
|
@ttfautohint $(BUILD)/${filename}.1.ttf $(BUILD)/${filename}.2.ttf
|
||||||
|
@ -82,11 +82,11 @@ ${target} : ${tfname} | $(DIST)/${dir}/
|
||||||
@rm $(BUILD)/${filename}.1.ttf $(BUILD)/${filename}.2.ttf $(BUILD)/${filename}.2.otd`;
|
@rm $(BUILD)/${filename}.1.ttf $(BUILD)/${filename}.2.ttf $(BUILD)/${filename}.2.otd`;
|
||||||
|
|
||||||
buf += `
|
buf += `
|
||||||
${woffTarget} : ${target} | $(DIST)/${dir}/web/
|
${woffTarget} : ${target} | $(DIST)/${dir}/woff/
|
||||||
sfnt2woff $<
|
sfnt2woff $<
|
||||||
mv $(subst .ttf,.woff,$<) $@`;
|
mv $(subst .ttf,.woff,$<) $@`;
|
||||||
buf += `
|
buf += `
|
||||||
${woff2Target} : ${target} | $(DIST)/${dir}/web/
|
${woff2Target} : ${target} | $(DIST)/${dir}/woff2/
|
||||||
woff2_compress $<
|
woff2_compress $<
|
||||||
mv $(subst .ttf,.woff2,$<) $@`;
|
mv $(subst .ttf,.woff2,$<) $@`;
|
||||||
|
|
||||||
|
@ -145,7 +145,13 @@ for (let dg of designGroups) {
|
||||||
$(DIST)/${groupMapping.dir}/ : | $(DIST)/
|
$(DIST)/${groupMapping.dir}/ : | $(DIST)/
|
||||||
-@mkdir -p $@`);
|
-@mkdir -p $@`);
|
||||||
makes.push(`
|
makes.push(`
|
||||||
$(DIST)/${groupMapping.dir}/web/ : | $(DIST)/${groupMapping.dir}/
|
$(DIST)/${groupMapping.dir}/ttf/ : | $(DIST)/${groupMapping.dir}/
|
||||||
|
-@mkdir -p $@`);
|
||||||
|
makes.push(`
|
||||||
|
$(DIST)/${groupMapping.dir}/woff/ : | $(DIST)/${groupMapping.dir}/
|
||||||
|
-@mkdir -p $@`);
|
||||||
|
makes.push(`
|
||||||
|
$(DIST)/${groupMapping.dir}/woff2/ : | $(DIST)/${groupMapping.dir}/
|
||||||
-@mkdir -p $@`);
|
-@mkdir -p $@`);
|
||||||
for (let weight of weights)
|
for (let weight of weights)
|
||||||
for (let slantness of slantnesses) {
|
for (let slantness of slantnesses) {
|
||||||
|
@ -170,8 +176,8 @@ $(DIST)/${groupMapping.dir}/web/ : | $(DIST)/${groupMapping.dir}/
|
||||||
makes.push(`fonts-${dg.name}-italic : ${groupTargets.italic.join(' ')}`);
|
makes.push(`fonts-${dg.name}-italic : ${groupTargets.italic.join(' ')}`);
|
||||||
makes.push(`fonts-${dg.name}-oblique : ${groupTargets.oblique.join(' ')}`);
|
makes.push(`fonts-${dg.name}-oblique : ${groupTargets.oblique.join(' ')}`);
|
||||||
makes.push(`web-${dg.name} : ${groupTargets.woff.join(' ')} ${groupTargets.woff2.join(' ')}`);
|
makes.push(`web-${dg.name} : ${groupTargets.woff.join(' ')} ${groupTargets.woff2.join(' ')}`);
|
||||||
makes.push(`$(ARCHIVEDIR)/${groupMapping.dir}-$(VERSION).zip : fonts-${dg.name} | $(ARCHIVEDIR)/
|
makes.push(`$(ARCHIVEDIR)/${groupMapping.dir}-$(VERSION).zip : fonts-${dg.name} web-${dg.name} | $(ARCHIVEDIR)/
|
||||||
cd $(DIST)/${groupMapping.dir}/ && 7z a -tzip -mx=9 ../../$@ ./*.ttf`);
|
cd $(DIST)/${groupMapping.dir}/ && 7z a -tzip -r -mx=9 ../../$@ ./`);
|
||||||
makes.push(`archive-${dg.name} : $(ARCHIVEDIR)/${groupMapping.dir}-$(VERSION).zip`);
|
makes.push(`archive-${dg.name} : $(ARCHIVEDIR)/${groupMapping.dir}-$(VERSION).zip`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
define-operator "~>" 880 'right' : syntax-rules
|
define-operator "~>" 880 'right' : syntax-rules
|
||||||
`(@l ~> @r) `{.left @l .right @r}
|
`(@l ~> @r) `{.left @l .right @r}
|
||||||
|
|
||||||
define progLigNameMap
|
export : define [progLigNameMap] : object
|
||||||
# language-specific tags
|
# language-specific tags
|
||||||
.XML_ {'brst', 'plusplus', 'logic', 'ml'}
|
.XML_ {'brst', 'plusplus', 'logic', 'ml'}
|
||||||
.XML0 {'brst', 'plusplus', 'logic', 'ml'}
|
.XML0 {'brst', 'plusplus', 'logic', 'ml'}
|
||||||
|
@ -20,6 +20,7 @@ define progLigNameMap
|
||||||
# "special" tags
|
# "special" tags
|
||||||
.ZALE {'arrowZALE'} # <= as arrow
|
.ZALE {'arrowZALE'} # <= as arrow
|
||||||
# common feature tags
|
# common feature tags
|
||||||
|
.XCCC {}
|
||||||
.dlig {'arrow2', 'plusplus', 'dotoper', 'logic', 'brst', 'dlig'}
|
.dlig {'arrow2', 'plusplus', 'dotoper', 'logic', 'brst', 'dlig'}
|
||||||
.calt {}
|
.calt {}
|
||||||
|
|
||||||
|
@ -56,8 +57,8 @@ local [no_period_center] ({'period.center'} ~> {'period'})
|
||||||
|
|
||||||
define preserved null
|
define preserved null
|
||||||
|
|
||||||
export all : define [buildLigations chain-rule lookupOrder commonList features lookups] : foreach [ ligationFeatureName : items-of : Object.keys progLigNameMap] : do
|
export : define [buildLigations chain-rule lookupOrder commonList features lookups plm] : foreach [ ligationFeatureName : items-of : Object.keys plm] : do
|
||||||
local mappedFeature : progLigNameMap.(ligationFeatureName) || {}
|
local mappedFeature : plm.(ligationFeatureName) || {}
|
||||||
local ligationLookupName : 'lig_' + ligationFeatureName + '-' + mappedFeature
|
local ligationLookupName : 'lig_' + ligationFeatureName + '-' + mappedFeature
|
||||||
|
|
||||||
define [hasLG ln] : [mappedFeature.indexOf ln] >= 0
|
define [hasLG ln] : [mappedFeature.indexOf ln] >= 0
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import 'topsort' as topsort
|
import 'topsort' as topsort
|
||||||
import '../support/glyph' as Glyph
|
import '../support/glyph' as Glyph
|
||||||
import '../support/transform' as Transform
|
import '../support/transform' as Transform
|
||||||
import './feature/ligation' as buildLigations
|
import [progLigNameMap buildLigations] from './feature/ligation'
|
||||||
import './feature/opbd' as buildOPBD
|
import './feature/opbd' as buildOPBD
|
||||||
import './feature/ccmp' as buildCCMP
|
import './feature/ccmp' as buildCCMP
|
||||||
|
|
||||||
|
@ -66,7 +66,10 @@ define [buildGSUB para glyphList markGlyphs] : begin
|
||||||
return subtable
|
return subtable
|
||||||
|
|
||||||
buildCCMP chain-rule markGlyphs commonList features lookups
|
buildCCMP chain-rule markGlyphs commonList features lookups
|
||||||
if (para.spacing > 0) : buildLigations chain-rule lookupOrder commonList features lookups
|
if (para.spacing > 0) : do
|
||||||
|
define plm : progLigNameMap
|
||||||
|
set plm.calt : plm.(para.defLigSet) || {}
|
||||||
|
buildLigations chain-rule lookupOrder commonList features lookups plm
|
||||||
if (para.spacing > 0) : buildOPBD chain-rule lookupOrder commonList features lookups
|
if (para.spacing > 0) : buildOPBD chain-rule lookupOrder commonList features lookups
|
||||||
|
|
||||||
# locl, SRB
|
# locl, SRB
|
||||||
|
|
|
@ -334,6 +334,10 @@ stressFW = true
|
||||||
[stress-fw.adds]
|
[stress-fw.adds]
|
||||||
family = " StFW"
|
family = " StFW"
|
||||||
|
|
||||||
|
# Default ligation set configuration
|
||||||
|
[default-ligset-haskell]
|
||||||
|
defLigSet = "XHS0"
|
||||||
|
|
||||||
# Compatibility PUA ligature sample
|
# Compatibility PUA ligature sample
|
||||||
# [[iosevka.compLig]]
|
# [[iosevka.compLig]]
|
||||||
# unicode = 57600 # 0xE100
|
# unicode = 57600 # 0xE100
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue