summaryrefslogtreecommitdiff
path: root/otfl-font-otf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'otfl-font-otf.lua')
-rw-r--r--otfl-font-otf.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/otfl-font-otf.lua b/otfl-font-otf.lua
index 6a75a0c..cab6fae 100644
--- a/otfl-font-otf.lua
+++ b/otfl-font-otf.lua
@@ -1838,6 +1838,11 @@ local function copytotfm(data,cache_id)
local fullname = metadata.fullname or fontname
local units = metadata.units_per_em or 1000
--
+ if units == 0 then -- catch bugs in fonts
+ units = 1000
+ metadata.units_per_em = 1000
+ end
+ --
parameters.slant = 0
parameters.space = spaceunits -- 3.333 (cmr10)
parameters.space_stretch = units/2 -- 500 -- 1.666 (cmr10)