🐛 Fix multiple font generation using profiles

This commit is contained in:
kiliman
2020-03-09 17:06:18 -04:00
parent 320fb069f7
commit d3940070ed
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -24,5 +24,5 @@ if not exist .\ligature\%lig%\glyphs\* exit /b
@echo Building %lig%
ttx -f .\original\%otf%.otf
node index.js %otf%
ttx -f .\build\%lig%.ttx
for %%f in (.\build\%lig%*.ttx) do ttx -f %%f
exit /b
+4 -1
View File
@@ -18,7 +18,10 @@ build_font() {
echo Building $1
ttx -f "./original/$otf.otf"
node index.js $otf
ttx -f ./build/$1.ttx
for f in ./build/$1*.ttx ; do
ttx -f $f
done
}
if [ -n "$1" ]
+3 -5
View File
@@ -36,9 +36,7 @@ function main() {
const buildFont = profile => {
// add suffix to dstFileName if present
const dstFileName = `./build/${ligFontName}${
profile.suffixWithLeadingHyphen
}.ttx`;
const dstFileName = `./build/${ligFontName}${profile.suffixWithLeadingHyphen}.ttx`;
console.log(
`Building ligature font file ${dstFileName} name = ${profile.name}`
);
@@ -87,7 +85,7 @@ const getProfiles = () => {
const content = fs.readFileSync(profilePath, 'utf-8');
content
.split(os.EOL)
.split(/\r|\r\n|\n/g)
.filter(line => /^[#]/.test(line) === false && line.length > 0)
.forEach(line => {
const ch = line.trim()[0];
@@ -103,7 +101,7 @@ const getProfiles = () => {
profiles.push(profile);
} else {
if (!profile) {
throw new Error('You must profile a profile name in []');
throw new Error('You must provide a profile name in []');
}
profile.ligatures.push(line);
}