X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-rmlgbm.lua;h=5ee567b5b872b5c6bd1c068415950c298c7074e2;hb=80bbcf52bf096105cf1797a4422a38d400b3fa05;hp=7614684ecc982a11ff457c83f100e96d016b7fe3;hpb=b470e92153b991fb21371ccf82dab74e3314e886;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-rmlgbm.lua b/src/ltj-rmlgbm.lua index 7614684..5ee567b 100644 --- a/src/ltj-rmlgbm.lua +++ b/src/ltj-rmlgbm.lua @@ -12,10 +12,8 @@ local err, warn, info, log = luatexbase.errwarinf(_NAME) luatexja.load_module('base'); local ltjb = luatexja.base -local round = tex.round local cidfont_data = {} local cache_chars = {} -local taux_dir = 'luatex-cache/luatexja' local path = { localdir = file.join(kpse.expand_var("$TEXMFVAR"), aux_dir), systemdir = file.join(kpse.expand_var("$TEXMFSYSVAR"), aux_dir), @@ -30,23 +28,19 @@ local function read_cid_font(cid_name) if kpsefound and file.isreadable(kpsefound) then cidfont_data[cid_name] = require(kpsefound) cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } - for i,v in pairs(cidfont_data[cid_name].characters) do - if not v.width then v.width = 655360 end - end elseif file.isreadable(localpath) then cidfont_data[cid_name] = require(localpath) cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } - for i,v in pairs(cidfont_data[cid_name].characters) do - if not v.width then v.width = 655360 end - end elseif file.isreadable(systempath) then cidfont_data[cid_name] = require(systempath) cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } + end + if cidfont_data[cid_name] then for i,v in pairs(cidfont_data[cid_name].characters) do if not v.width then v.width = 655360 end + v.height, v.depth = 576716.8, 78643.2 -- optimized for jfm-ujis.lua end end - -- end -- High-level @@ -81,13 +75,13 @@ local function mk_rml(name, size, id, cid_name) -- characters & scaling if size < 0 then size = -size * 655.36 end local scale = size / 655360 - local def_height = round(0.88 * size) -- character's default height (optimized for jfm-ujis.lua) - local def_depth = round(0.12 * size) -- and depth. + local def_height = 0.88 * size -- character's default height (optimized for jfm-ujis.lua) + local def_depth = 0.12 * size -- and depth. if not cache_chars[cid_name][size] then cache_chars[cid_name][size] = {} for k, v in pairs(cache_chars[cid_name][655360]) do cache_chars[cid_name][size][k] = { - index = v.index, width = round(v.width * scale), + index = v.index, width = v.width * scale, height = def_height, depth = def_depth, tounicode = v.tounicode, } end