summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-con.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-02-07 19:16:06 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-02-07 19:16:06 +0100
commit99dc1cd9bb77ac9fa68b0584f58f57749994fdba (patch)
treeab184c40b11270cec9c311beb0e190913471e47f /tex/context/base/mkiv/font-con.lua
parent38a9804bf0448f3c987903d2601175f1750e9fe3 (diff)
downloadcontext-99dc1cd9bb77ac9fa68b0584f58f57749994fdba.tar.gz
2019-02-07 18:55:00
Diffstat (limited to 'tex/context/base/mkiv/font-con.lua')
-rw-r--r--tex/context/base/mkiv/font-con.lua22
1 files changed, 16 insertions, 6 deletions
diff --git a/tex/context/base/mkiv/font-con.lua b/tex/context/base/mkiv/font-con.lua
index 81ea7c859..9f85ee208 100644
--- a/tex/context/base/mkiv/font-con.lua
+++ b/tex/context/base/mkiv/font-con.lua
@@ -49,6 +49,8 @@ constructors.cache = containers.define("fonts", "constructors", constr
constructors.privateoffset = fonts.privateoffsets.textbase or 0xF0000
constructors.cacheintex = true -- so we see the original table in fonts.font
+constructors.addtounicode = true
+
-- This might become an interface:
local designsizes = allocate()
@@ -424,6 +426,8 @@ function constructors.scale(tfmdata,specification)
targetparameters.forcedsize = forcedsize -- context specific
targetparameters.extrafactor = extrafactor -- context specific
--
+ local addtounicode = constructors.addtounicode
+ --
local tounicode = fonts.mappings.tounicode
local unknowncode = tounicode(0xFFFD)
--
@@ -736,13 +740,19 @@ function constructors.scale(tfmdata,specification)
end
end
local isunicode = description.unicode
- if isunicode then
- chr.unicode = isunicode
- chr.tounicode = tounicode(isunicode)
- -- in luatex > 0.85 we can do this:
- -- chr.tounicode = isunicode
+ if addtounicode then
+ if isunicode then
+ chr.unicode = isunicode
+ chr.tounicode = tounicode(isunicode)
+ -- in luatex > 0.85 we can do this:
+ -- chr.tounicode = isunicode
+ else
+ chr.tounicode = unknowncode
+ end
else
- chr.tounicode = unknowncode
+ if isunicode then
+ chr.unicode = isunicode
+ end
end
if hasquality then
-- we could move these calculations elsewhere (saves calculations)