Prevent Node.js on Archlinux from modifying capture.metrics. Fixes #99.

This commit is contained in:
be5invis 2016-07-21 13:00:13 +08:00
parent fab10e03b2
commit 7ca2f5f9c5
2 changed files with 4 additions and 5 deletions

View File

@ -101,9 +101,6 @@ export as build : define [buildFont para recursive recursiveCodes] : begin
return dp
define [create-glyph] : match [Array.prototype.slice.call arguments 0]
`[@name @actions] : begin
if (pickHash && nPending <= 0) : begin
if para.verbose : console.log " *** Done recursive build for \[if (recursive.length > 3) [recursive.slice 0 3 :.concat {'...'} :.join ','] [recursive.join ',']] in \(font.name.uniqueSubFamily)"
throw {.glyfMap glyphs}
if (pickHash && [not pickHash.(name)]) : return nothing
if para.verbose : console.log name
@ -179,7 +176,8 @@ 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 TempFont includeGlyphPart compsiteMarkSet
# IDKY, but wrapping "metrics" prevents Node.js on Arch modifying it.
define capture : object [metrics : Object.create 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

View File

@ -576,7 +576,8 @@ export : define [apply] : begin
local shouldBuildUnicodes : shouldBuildList.map ([x] => [if (glyphs.(x) && glyphs.(x).unicode) glyphs.(x).unicode.0 nothing])
:.filter ([x] => [not [not x]])
local p : Object.create ps
local p {.}
foreach [{k v} : pairs-of all ps] : set p.(k) v
try : begin
local forkFont : buildFont.call [TempFont] p shouldBuildList shouldBuildUnicodes
: ex