summaryrefslogtreecommitdiff
path: root/otfl-font-def.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2012-05-09 09:02:13 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2012-05-09 09:02:13 +0200
commitbb67558c87704ad7193b07e4ef657cb9d948a9a0 (patch)
tree6360c5dfc5f7b685852aa5d677bb2e1f20e9dd53 /otfl-font-def.lua
parentdba2e8c586d45440495b247b3895e874784a3136 (diff)
downloadluaotfload-bb67558c87704ad7193b07e4ef657cb9d948a9a0.tar.gz
Sync with context beta 2012.05.08 23:00
Diffstat (limited to 'otfl-font-def.lua')
-rw-r--r--otfl-font-def.lua33
1 files changed, 19 insertions, 14 deletions
diff --git a/otfl-font-def.lua b/otfl-font-def.lua
index 10958cf..96de480 100644
--- a/otfl-font-def.lua
+++ b/otfl-font-def.lua
@@ -258,6 +258,24 @@ end
-- return tfmdata
-- end
+local function checkembedding(tfmdata)
+ local properties = tfmdata.properties
+ local embedding
+ if directive_embedall then
+ embedding = "full"
+ elseif properties and properties.filename and constructors.dontembed[properties.filename] then
+ embedding = "no"
+ else
+ embedding = "subset"
+ end
+ if properties then
+ properties.embedding = embedding
+ else
+ tfmdata.properties = { embedding = embedding }
+ end
+ tfmdata.embedding = embedding
+end
+
function definers.loadfont(specification)
local hash = constructors.hashinstance(specification)
local tfmdata = loadedfonts[hash] -- hashes by size !
@@ -287,21 +305,8 @@ function definers.loadfont(specification)
end
end
if tfmdata then
- local properties = tfmdata.properties
- local embedding
- if directive_embedall then
- embedding = "full"
- elseif properties and properties.filename and constructors.dontembed[properties.filename] then
- embedding = "no"
- else
- embedding = "subset"
- end
- if properties then
- properties.embedding = embedding
- else
- tfmdata.properties = { embedding = embedding }
- end
tfmdata = definers.applypostprocessors(tfmdata)
+ checkembedding(tfmdata) -- todo: general postprocessor
loadedfonts[hash] = tfmdata
designsizes[specification.hash] = tfmdata.parameters.designsize
end