X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-rmlgbm.lua;h=ba81969d3feee2b111c157325b51fa0e82c45719;hb=79acad85e3b942cd4fe555c40886ad295b487fce;hp=c62123cffc4b885395ecb233bedb43043ebf5cc6;hpb=abfe427af8df5e0c0a7848be775891ef0538907a;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-rmlgbm.lua b/src/ltj-rmlgbm.lua index c62123c..ba81969 100644 --- a/src/ltj-rmlgbm.lua +++ b/src/ltj-rmlgbm.lua @@ -194,36 +194,36 @@ do k.characters[46].width = math.floor(655360/14); -- Standard fonts are ``seriffed''. table.tofile(savepath, k,'return', false, true, false ) + ltjb.package_info_no_line('luatexja', "saved :'" .. savepath .. "'", '') else - ltjb.package_warning('luatexja', - 'failed to save informations of non-embedded 2-byte fonts', '') + ltjb.package_warning_no_line('luatexja', "failed to save to '" .. savepath .. "'", '') end end end local make_cid_font = make_cid_font -- +local function cid_cache_load(fullpath) + cidfont_data[cid_name] = require(fullpath) + cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } +end + local function read_cid_font() -- local v = "ltj-cid-" .. string.lower(cid_name) .. ".lua" local v = "ltj-cid-auto-" .. string.lower(cid_name) .. ".lua" - local localpath = file.join(path.localdir, v) - local systempath = file.join(path.systemdir, v) + local localpath = file.join(path.localdir .. '/luatexja', v) + local systempath = file.join(path.systemdir .. '/luatexja' , v) local kpsefound = kpse.find_file(v) if kpsefound and file.isreadable(kpsefound) then - cidfont_data[cid_name] = require(kpsefound) - cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } + cid_cache_load(kpsefound) elseif file.isreadable(localpath) then - cidfont_data[cid_name] = require(localpath) - cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } + cid_cache_load(localpath) elseif file.isreadable(systempath) then - cidfont_data[cid_name] = require(systempath) - cache_chars[cid_name] = { [655360] = cidfont_data[cid_name].characters } + cid_cache_load(systempath) + else + -- Now we must create the virtual metrics from CMap. + make_cid_font() end - -- Now we must create the virtual metrics from CMap. - ltjb.package_info('luatexja', - 'I try to generate informations of non-embedded 2-byte fonts...', '') - make_cid_font() - 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 @@ -306,12 +306,12 @@ local function mk_rml(name, size, id) -- no embedding local var = '' - local s = string.match(specification.detail, 'slant=([+-]*[0-9]*%.[0-9]*)') - if s and e~=1 then + local s = string.match(specification.detail, 'slant=([+-]*%d*%.?%d)') + if s and e~=0 then s = s * 1000 var, fontdata.slant = var .. 's' .. tostring(s), s end - local e = string.match(specification.detail, 'extend=([+-]*[0-9]*%.[0-9]*)') + local e = string.match(specification.detail, 'extend=([+-]*%d*%.?%d)') if e and e~=1 then e = e * 1000 var, fontdata.extend = var .. 'x' .. tostring(e), e