summaryrefslogtreecommitdiff
path: root/otfl-font-tfm.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-11-05 18:00:11 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-11-05 18:00:54 +0200
commit9d6e4ea26d8a2fc849fa586688bbb823a69a4b17 (patch)
tree9696db4d3a26c6c031e0bea6efbc3e33d0a4b43a /otfl-font-tfm.lua
parentb9f388349d0f602bbc9ebc9c59160298b4bbbb4c (diff)
downloadluaotfload-9d6e4ea26d8a2fc849fa586688bbb823a69a4b17.tar.gz
Sync with context 2010.11.03
Diffstat (limited to 'otfl-font-tfm.lua')
-rw-r--r--otfl-font-tfm.lua27
1 files changed, 21 insertions, 6 deletions
diff --git a/otfl-font-tfm.lua b/otfl-font-tfm.lua
index 7a16b28..e8b2427 100644
--- a/otfl-font-tfm.lua
+++ b/otfl-font-tfm.lua
@@ -128,16 +128,31 @@ end
to scale virtual characters.</p>
--ldx]]--
+--~ function tfm.getvirtualid(tfmdata)
+--~ -- since we don't know the id yet, we use 0 as signal
+--~ local tf = tfmdata.fonts
+--~ if not tf then
+--~ tfmdata.type = "virtual"
+--~ tfmdata.fonts = { { id = 0 } }
+--~ return 1
+--~ else
+--~ local ntf = #tf + 1
+--~ tf[ntf] = { id = 0 }
+--~ return ntf
+--~ end
+--~ end
+
function tfm.getvirtualid(tfmdata)
-- since we don't know the id yet, we use 0 as signal
- if not tfmdata.fonts then
+ local tf = tfmdata.fonts
+ if not tf then
+ tf = { }
tfmdata.type = "virtual"
- tfmdata.fonts = { { id = 0 } }
- return 1
- else
- tfmdata.fonts[#tfmdata.fonts+1] = { id = 0 }
- return #tfmdata.fonts
+ tfmdata.fonts = tf
end
+ local ntf = #tf + 1
+ tf[ntf] = { id = 0 }
+ return ntf
end
function tfm.checkvirtualid(tfmdata, id)