summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-one.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-04-26 00:56:11 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-04-26 00:56:11 +0200
commit0189223a1a40debb4cb3b146ce182eb806cd28f2 (patch)
treeef50df44125284834b25f5eb59a58afadfe5a4d3 /tex/context/base/mkiv/font-one.lua
parent32e6c720c4f84f112596c6b4a75193f99e9be158 (diff)
downloadcontext-0189223a1a40debb4cb3b146ce182eb806cd28f2.tar.gz
2019-04-25 10:44:00
Diffstat (limited to 'tex/context/base/mkiv/font-one.lua')
-rw-r--r--tex/context/base/mkiv/font-one.lua42
1 files changed, 24 insertions, 18 deletions
diff --git a/tex/context/base/mkiv/font-one.lua b/tex/context/base/mkiv/font-one.lua
index 9b296cac5..5387516b4 100644
--- a/tex/context/base/mkiv/font-one.lua
+++ b/tex/context/base/mkiv/font-one.lua
@@ -483,8 +483,9 @@ local function copytotfm(data)
local filename = constructors.checkedfilename(resources)
local fontname = metadata.fontname or metadata.fullname
local fullname = metadata.fullname or metadata.fontname
- local endash = 0x0020 -- space
+ local endash = 0x2013
local emdash = 0x2014
+ local space = 0x0020 -- space
local spacer = "space"
local spaceunits = 500
--
@@ -496,28 +497,33 @@ local function copytotfm(data)
parameters.italicangle = italicangle
parameters.charwidth = charwidth
parameters.charxheight = charxheight
- -- same as otf
+ -- nearly the same as otf, catches
+ local d_endash = descriptions[endash]
+ local d_emdash = descriptions[emdash]
+ local d_space = descriptions[space]
+ if not d_space or d_space == 0 then
+ d_space = d_endash
+ end
+ if d_space then
+ spaceunits, spacer = d_space.width or 0, "space"
+ end
if properties.monospaced then
- if descriptions[endash] then
- spaceunits, spacer = descriptions[endash].width, "space"
- end
- if not spaceunits and descriptions[emdash] then
- spaceunits, spacer = descriptions[emdash].width, "emdash"
- end
- if not spaceunits and charwidth then
- spaceunits, spacer = charwidth, "charwidth"
+ if spaceunits == 0 and d_emdash then
+ spaceunits, spacer = d_emdash.width or 0, "emdash"
end
else
- if descriptions[endash] then
- spaceunits, spacer = descriptions[endash].width, "space"
- end
- if not spaceunits and charwidth then
- spaceunits, spacer = charwidth, "charwidth"
+ if spaceunits == 0 and d_endash then
+ spaceunits, spacer = d_emdash.width or 0, "endash"
end
end
- spaceunits = tonumber(spaceunits)
- if spaceunits < 200 then
- -- todo: warning
+ if spaceunits == 0 and charwidth then
+ spaceunits, spacer = charwidth or 0, "charwidth"
+ end
+ if spaceunits == 0 then
+ spaceunits = tonumber(spaceunits) or 500
+ end
+ if spaceunits == 0 then
+ spaceunits = 500
end
--
parameters.slant = 0