diff --git a/buildglyphs.ptl b/buildglyphs.ptl index edbd052..ae920ed 100644 --- a/buildglyphs.ptl +++ b/buildglyphs.ptl @@ -1,5 +1,3 @@ -import 'unorm' as unorm - import './support/glyph' as Glyph import './support/point' as Point import './support/spirokit' as spirokit @@ -8,7 +6,7 @@ import './support/anchor' as Anchor import './support/monotonic-interpolate' as smoothreg import './support/fairify' as fairify -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from './support/utils' +import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet] from './support/utils' import [calculateMetrics setFontMetrics] from './meta/aesthetics' import [nameFont] from './meta/naming' import './meta/features' as Features @@ -181,7 +179,7 @@ export as build : define [buildFont para recursive recursiveCodes] : begin include markset.e save 'space' ' ' - define capture : object metrics $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged + define capture : object metrics $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged TempFont includeGlyphPart compsiteMarkSet ### HERE WE GO set capture.commonShapes : [import './glyphs/common-shapes.js'].apply.call capture diff --git a/glyphs/autobuilds.ptl b/glyphs/autobuilds.ptl index 9b05749..6bee823 100644 --- a/glyphs/autobuilds.ptl +++ b/glyphs/autobuilds.ptl @@ -2,16 +2,7 @@ $$include '../meta/macros.ptl' import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback suggestGC] from '../support/utils' define customDecompositions : object # Latvians use comma instead of cedillas in several letters. diff --git a/glyphs/common-shapes.ptl b/glyphs/common-shapes.ptl index 129c59d..4b0e3e5 100644 --- a/glyphs/common-shapes.ptl +++ b/glyphs/common-shapes.ptl @@ -1,16 +1,9 @@ $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg import '../support/fairify' as fairify -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry diff --git a/glyphs/letters-unified-basic.ptl b/glyphs/letters-unified-basic.ptl index 1d79672..544cf54 100644 --- a/glyphs/letters-unified-basic.ptl +++ b/glyphs/letters-unified-basic.ptl @@ -4,17 +4,8 @@ $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks diff --git a/glyphs/letters-unified-extended.ptl b/glyphs/letters-unified-extended.ptl index 94823e5..ad1068f 100644 --- a/glyphs/letters-unified-extended.ptl +++ b/glyphs/letters-unified-extended.ptl @@ -1,16 +1,6 @@ $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks letterBasic diff --git a/glyphs/numbers.ptl b/glyphs/numbers.ptl index 19bd436..0a7458d 100644 --- a/glyphs/numbers.ptl +++ b/glyphs/numbers.ptl @@ -1,17 +1,6 @@ $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' - +import [mix linreg clamp fallback] from '../support/utils' ###### NUMBERS export : define [apply] : begin diff --git a/glyphs/overmarks.ptl b/glyphs/overmarks.ptl index a3ae43f..c4cfc97 100644 --- a/glyphs/overmarks.ptl +++ b/glyphs/overmarks.ptl @@ -1,16 +1,6 @@ $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes diff --git a/glyphs/symbol-braille.ptl b/glyphs/symbol-braille.ptl index 58c7194..eb39134 100755 --- a/glyphs/symbol-braille.ptl +++ b/glyphs/symbol-braille.ptl @@ -1,17 +1,7 @@ ###### Brailles symbols $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks diff --git a/glyphs/symbol-geometric.ptl b/glyphs/symbol-geometric.ptl index f6dab92..1629d2e 100644 --- a/glyphs/symbol-geometric.ptl +++ b/glyphs/symbol-geometric.ptl @@ -1,17 +1,8 @@ ###### GEOMETRIC SHAPES $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks diff --git a/glyphs/symbol-letter.ptl b/glyphs/symbol-letter.ptl index a7e426a..e319d93 100644 --- a/glyphs/symbol-letter.ptl +++ b/glyphs/symbol-letter.ptl @@ -2,17 +2,7 @@ $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks letterBasic diff --git a/glyphs/symbol-math.ptl b/glyphs/symbol-math.ptl index 62f003a..d42f801 100644 --- a/glyphs/symbol-math.ptl +++ b/glyphs/symbol-math.ptl @@ -1,17 +1,7 @@ ###### Mathematical symbols $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks letterBasic letterExt diff --git a/glyphs/symbol-other.ptl b/glyphs/symbol-other.ptl index 103f2c1..2f3583f 100644 --- a/glyphs/symbol-other.ptl +++ b/glyphs/symbol-other.ptl @@ -1,17 +1,7 @@ ###### Other symbols $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks geometricSymbols diff --git a/glyphs/symbol-punctuation.ptl b/glyphs/symbol-punctuation.ptl index 6144412..2bed5b2 100644 --- a/glyphs/symbol-punctuation.ptl +++ b/glyphs/symbol-punctuation.ptl @@ -1,17 +1,7 @@ ### Punctuation symbols $$include '../meta/macros.ptl' -import 'unorm' as unorm - -import '../support/glyph' as Glyph -import '../support/point' as Point -import '../support/spirokit' as spirokit -import '../support/transform' as : Transform && [object [transformPoint tp] [untransform utp] inverse] -import '../support/anchor' as Anchor -import '../support/monotonic-interpolate' as smoothreg -import '../support/fairify' as fairify - -import [mix linreg clamp fallback TempFont includeGlyphPart compsiteMarkSet suggestGC] from '../support/utils' +import [mix linreg clamp fallback] from '../support/utils' export : define [apply] : begin glyph-module-entry commonShapes overmarks letterBasic diff --git a/makesupport.mk b/makesupport.mk index 382170e..5d76d3b 100644 --- a/makesupport.mk +++ b/makesupport.mk @@ -9,20 +9,18 @@ snapshot/assets : PATELC = node ./node_modules/patel/bin/patel-c -GLYPH_SEGMENTS = glyphs/common-shapes.js glyphs/overmarks.js glyphs/letters-unified-basic.js glyphs/letters-unified-extended.js glyphs/numbers.js glyphs/symbol-punctuation.js glyphs/symbol-math.js glyphs/symbol-letter.js glyphs/symbol-geometric.js glyphs/symbol-other.js glyphs/symbol-braille.js glyphs/autobuilds.js - -SUPPORT_FILES_FROM_PTL = support/glyph.js support/spiroexpand.js support/spirokit.js parameters.js support/anchor.js support/point.js support/transform.js support/utils.js meta/aesthetics.js meta/naming.js meta/features.js $(GLYPH_SEGMENTS) - -SUPPORT_FILES = $(SUPPORT_FILES_FROM_PTL) generator.js emptyfont.toml parameters.toml support/fairify.js -SCRIPTS = $(SUPPORT_FILES) buildglyphs.js -SCRIPTS_FROM_aki = $(SUPPORT_FILES_FROM_PTL) buildglyphs.js - -buildglyphs.js : buildglyphs.ptl $(GLYPH_SEGMENTS) - $(PATELC) --strict $< -o $@ +GLYPH_SEGMENTS = glyphs/common-shapes.js glyphs/overmarks.js glyphs/letters-unified-basic.js glyphs/letters-unified-extended.js glyphs/numbers.js glyphs/symbol-punctuation.js glyphs/symbol-math.js glyphs/symbol-letter.js glyphs/symbol-geometric.js glyphs/symbol-other.js glyphs/symbol-braille.js glyphs/autobuilds.js buildglyphs.js +SUPPORT_FILES_FROM_PTL = support/glyph.js support/spiroexpand.js support/spirokit.js parameters.js support/anchor.js support/point.js support/transform.js support/utils.js meta/aesthetics.js meta/naming.js meta/features.js +SUPPORT_FILES_JS = generator.js emptyfont.toml parameters.toml support/fairify.js +SUPPORT_FILES = $(SUPPORT_FILES_FROM_PTL) $(SUPPORT_FILES_JS) +SCRIPTS = $(SUPPORT_FILES) $(GLYPH_SEGMENTS) +SCRIPTS_FROM_PTL = $(SUPPORT_FILES_FROM_PTL) $(GLYPH_SEGMENTS) $(SUPPORT_FILES_FROM_PTL) : %.js : %.ptl meta/macros.ptl $(PATELC) --optimize --strict $< -o $@ +$(GLYPH_SEGMENTS) : %.js : %.ptl meta/macros.ptl $(subst .js,.ptl,$(SUPPORT_FILES_FROM_PTL)) $(SUPPORT_FILES_JS) + $(PATELC) --optimize --strict $< -o $@ -cleanscripts : - -@rm $(SCRIPTS_FROM_aki) +cleanscripts : + -@rm $(SCRIPTS_FROM_PTL) scripts : $(SCRIPTS) diff --git a/meta/macros.ptl b/meta/macros.ptl index 5cfb4a3..573cbd0 100644 --- a/meta/macros.ptl +++ b/meta/macros.ptl @@ -148,7 +148,7 @@ define-macro glyph-module-entry : syntax-rules for [local j 0] (j < opts.length) [inc j] : if optionalImports.(opts.(j)) : optionalImportStatements.push optionalImports.(opts.(j)) dirty `[begin \\ define $capture this - define [object metrics $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged] $capture + define [object metrics $NamedParameterPair$ $donothing$ para recursive recursiveCodes variantSelector font glyphs glyphList unicodeGlyphs create-glyph $save$ spirofns markset MARK BASE AS_BASE ALSO_METRICS pickHash dependencyProfile getDependencyProfile buildFont newtemp tagged TempFont includeGlyphPart compsiteMarkSet] $capture define [object UPM WIDTH SB CAP XH DESCENDER CONTRAST parenMid parenTop parenBot operTop operBot operMid Italify Upright Scale Translate Rotate globalTransform