From 9d6e4ea26d8a2fc849fa586688bbb823a69a4b17 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 5 Nov 2010 18:00:11 +0200 Subject: Sync with context 2010.11.03 --- otfl-font-tfm.lua | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'otfl-font-tfm.lua') 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.

--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) -- cgit v1.2.3