• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ソースコードの管理場所


Commit MetaInfo

Revisionc5d6a2be5a9a6f7516b03f23db53dbb8ec421d6e (tree)
Time2016-05-04 05:53:06
AuthorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

ltj-otf.lua: fix for luaotfload v2.7(?)

Change Summary

Incremental Difference

--- a/src/ltj-jfont.lua
+++ b/src/ltj-jfont.lua
@@ -683,11 +683,8 @@ do
683683
684684 local sort = table.sort
685685 local function add_fl_table(dest, glyphs, unitable, asc_des, units)
686- local tg, glyphmin, glyphmax = glyphs.glyphs, 0, glyphs.glyphmax
687- for _,v in pairs(fields(glyphs)) do
688- if v=='glyphmin' then glyphmin, glyphmax = glyphs.glyphmin, glyphmax+1; break end
689- end
690- for i = glyphmin, glyphmax-1 do
686+ local tg, glyphmin, glyphmax = glyphs.glyphs, glyphs.glyphmin, glyphs.glyphmax
687+ for i = glyphmin, glyphmax do
691688 local gv = tg[i]
692689 if gv then
693690 if gv.altuni then
@@ -695,20 +692,22 @@ do
695692 local bu, vsel = at.unicode, at.variant
696693 if vsel then
697694 if vsel>=0xE0100 then vsel = vsel - 0xE0100 end
698- dest = dest or {}; dest[bu] = dest[bu] or {}
699695 local uniq_flag = true
700- for i,_ in pairs(dest[bu]) do
701- if i==vs then uniq_flag = false; break end
702- end
696+ if dest and dest[bu] then
697+ for i,_ in pairs(dest[bu]) do
698+ if i==vsel then uniq_flag = false; break end
699+ end
700+ end
703701 if uniq_flag then
704- dest[bu][vsel] = unitable[gv.name]
702+ dest = dest or {}; dest[bu] = dest[bu] or {}
703+ dest[bu][vsel] = unitable[i]
705704 end
706705 end
707706 end
708707 end
709708 -- vertical metric
710709 local vw, tsb, vk = glyph_vmetric(gv)
711- local gi = unitable[gv.name]
710+ local gi = unitable[i]
712711 if gi and vw and vw~=asc_des then
713712 -- We do not use tsidebearing, since (1) fontloader does not read VORG table
714713 -- and (2) 'tsidebearing' doea not appear in the returned table by fontloader.fields.
@@ -744,13 +743,27 @@ do
744743 end
745744 prepare_fl_data = function (dest, id)
746745 local fl = fontloader.open(id.filename)
747- local unicodes = id.resources.unicodes
746+ local unicodes = {}
747+ for i,v in pairs(id.characters) do
748+ unicodes[v.index] = i
749+ end
750+
748751 if fl.glyphs then
752+ local tg, glyphmin, glyphmax = fl.glyphs, fl.glyphmin, fl.glyphmax
753+ for i = glyphmin, glyphmax do
754+ if tg[i] and tg[i].name then unicodes[tg[i].name] = unicodes[i] end
755+ end
749756 dest = add_fl_table(dest, fl, unicodes,
750757 fl.ascent + fl.descent, fl.units_per_em)
751758 end
752759 if fl.subfonts then
753760 for _,v in pairs(fl.subfonts) do
761+ local tg, glyphmin, glyphmax = v.glyphs, v.glyphmin, v.glyphmax
762+ for i = glyphmin, glyphmax do
763+ if tg[i] and tg[i].name then unicodes[tg[i].name] = unicodes[i] end
764+ end
765+ end
766+ for _,v in pairs(fl.subfonts) do
754767 dest = add_fl_table(dest, v, unicodes,
755768 fl.ascent + fl.descent, fl.units_per_em)
756769 end
@@ -777,7 +790,7 @@ end
777790
778791 --
779792 do
780- local cache_ver = 6
793+ local cache_ver = 7
781794 local checksum = file.checksum
782795
783796 local function prepare_extra_data_base(id)