minor cleanup of code
This commit is contained in:
parent
3294813573
commit
7aa74afa93
4 changed files with 22 additions and 5 deletions
|
@ -7,14 +7,14 @@ const convertOtd = require("./otd-conv/index");
|
||||||
|
|
||||||
const { buildOtl } = require("../otl/index");
|
const { buildOtl } = require("../otl/index");
|
||||||
const { assignFontNames } = require("../meta/naming");
|
const { assignFontNames } = require("../meta/naming");
|
||||||
const { setFontMetrics } = require("../meta/aesthetics");
|
const { copyFontMetrics } = require("../meta/aesthetics");
|
||||||
|
|
||||||
module.exports = function (para) {
|
module.exports = function (para) {
|
||||||
const otd = EmptyFont();
|
const otd = EmptyFont();
|
||||||
const gs = buildGlyphs(para);
|
const gs = buildGlyphs(para);
|
||||||
|
|
||||||
assignFontNames(para, gs.metrics, otd);
|
assignFontNames(para, otd);
|
||||||
setFontMetrics(para, gs.metrics, otd);
|
copyFontMetrics(gs.fontMetrics, otd);
|
||||||
|
|
||||||
const otl = buildOtl(para, gs.glyphStore);
|
const otl = buildOtl(para, gs.glyphStore);
|
||||||
otd.GSUB = otl.GSUB;
|
otd.GSUB = otl.GSUB;
|
||||||
|
|
|
@ -150,5 +150,5 @@ export all : define [buildGlyphs para recursive recursiveCodes] : begin
|
||||||
|
|
||||||
foreach [gb : items-of $$Capture$$.$pendingGlyphBlocks$] : gb.resolve
|
foreach [gb : items-of $$Capture$$.$pendingGlyphBlocks$] : gb.resolve
|
||||||
|
|
||||||
return : object metrics glyphStore
|
return : object glyphStore fontMetrics
|
||||||
|
|
||||||
|
|
|
@ -238,6 +238,23 @@ export : define [setFontMetrics para metrics fm] : begin
|
||||||
set fm.OS_2.sCapHeight CAP
|
set fm.OS_2.sCapHeight CAP
|
||||||
set fm.post.italicAngle [Math.round (0 - para.slopeAngle)]
|
set fm.post.italicAngle [Math.round (0 - para.slopeAngle)]
|
||||||
|
|
||||||
|
export : define [copyFontMetrics fm1 fm2] : begin
|
||||||
|
set fm2.OS_2.xAvgCharWidth fm1.OS_2.xAvgCharWidth
|
||||||
|
set fm2.head.unitsPerEm fm1.head.unitsPerEm
|
||||||
|
set fm2.hhea.ascender fm1.hhea.ascender
|
||||||
|
set fm2.OS_2.usWinAscent fm1.OS_2.usWinAscent
|
||||||
|
set fm2.OS_2.sTypoAscender fm1.OS_2.sTypoAscender
|
||||||
|
|
||||||
|
set fm2.hhea.descender fm1.hhea.descender
|
||||||
|
set fm2.OS_2.usWinDescent fm1.OS_2.usWinDescent
|
||||||
|
set fm2.OS_2.sTypoDescender fm1.OS_2.sTypoDescender
|
||||||
|
|
||||||
|
set fm2.hhea.lineGap fm1.hhea.lineGap
|
||||||
|
set fm2.OS_2.sTypoLineGap fm1.OS_2.sTypoLineGap
|
||||||
|
|
||||||
|
set fm2.OS_2.sxHeight fm1.OS_2.sxHeight
|
||||||
|
set fm2.OS_2.sCapHeight fm1.OS_2.sCapHeight
|
||||||
|
set fm2.post.italicAngle fm1.post.italicAngle
|
||||||
|
|
||||||
export : define [compositeBaseAnchors] : begin
|
export : define [compositeBaseAnchors] : begin
|
||||||
local h {.}
|
local h {.}
|
||||||
|
|
|
@ -124,7 +124,7 @@ define [getStyleLinkedStyles weight width slope] : begin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export : define [assignFontNames para metrics font] : begin
|
export : define [assignFontNames para font] : begin
|
||||||
set font.name {}
|
set font.name {}
|
||||||
|
|
||||||
define family : para.naming.family.trim
|
define family : para.naming.family.trim
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue