• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョン39167f85f4f36af1759910a35cac6550257b537e (tree)
日時2019-07-25 06:17:36
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

Added tests

変更サマリ

差分

--- a/src/ltj-jfont.lua
+++ b/src/ltj-jfont.lua
@@ -812,11 +812,11 @@ do
812812 local ascent = id.shared.rawdata.metadata.ascender
813813 local t_vorigin, t_ind_to_uni = {}, {}
814814 for i,v in pairs(id.shared.rawdata.descriptions) do
815- t_ind_to_uni[v.index] = i
816- if v.tsb then
817- local j = v.boundingbox[4] + v.tsb
818- if j~=ascent then print(i,j);t_vorigin[i]=j end
819- end
815+ t_ind_to_uni[v.index] = i
816+ if v.tsb then
817+ local j = v.boundingbox[4] + v.tsb
818+ if j~=ascent then t_vorigin[i]=j end
819+ end
820820 end
821821 dest = dest or {}
822822 dest.ind_to_uni = t_ind_to_uni
@@ -890,63 +890,6 @@ do
890890 end
891891 end
892892
893-
894-------------------------------------------------------------------------
895--- calculate vadvance
896-------------------------------------------------------------------------
897-do
898- local function acc_feature(table_vadv, table_vorg, subtables, ft, already_vert)
899- for char_num,v in pairs(ft.shared.rawdata.descriptions) do
900- if v.slookups then
901- for sn, sv in pairs(v.slookups) do
902- if subtables[sn] and type(sv)=='table' then
903- if sv[4]~=0 then
904- table_vadv[char_num]
905- = (table_vadv[char_num] or 0) + sv[4]
906- end
907- if sv[2]~=0 and not already_vert then
908- table_vorg[char_num]
909- = (table_vorg[char_num] or 0) + sv[2]
910- end
911- end
912- end
913- end
914- end
915- end
916-
917-luatexbase.add_to_callback(
918- "luatexja.define_jfont",
919- function (fmtable, fnum)
920- local vadv = {}; fmtable.v_advance = vadv
921- local vorg = {}; fmtable.v_origin = vorg
922- local ft = font_getfont(fnum)
923- local subtables = {}
924- if ft.specification then
925- for feat_name,v in pairs(ft.specification.features.normal) do
926- if v==true and ft.resources then
927- for _,i in pairs(ft.resources.sequences) do
928- if i.order[1]== feat_name and i.type == 'gpos_single' and type(i.subtables)=='table' then
929- for _,st in pairs(i.subtables) do
930- subtables[st] = true
931- end
932- end
933- end
934- end
935- end
936- acc_feature(vadv, vorg, subtables, ft,
937- ft.specification.features.normal.vrt2 or ft.specification.features.normal.vert)
938- for i,v in pairs(vadv) do
939- vadv[i]=vadv[i]/ft.units_per_em*fmtable.size
940- end
941- for i,v in pairs(vorg) do
942- vorg[i]=vorg[i]/ft.units_per_em*fmtable.size
943- end
944- end
945- return fmtable
946- end, 'ltj.v_advance', 1
947-)
948-end
949-
950893 ------------------------------------------------------------------------
951894 -- make table of vertical glyphs which does not covered by vert feature
952895 -- nor UTR#50
--- a/src/ltj-setwidth.lua
+++ b/src/ltj-setwidth.lua
@@ -177,8 +177,7 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
177177 local ascent, descent = met.ascent, met.descent
178178 local fwidth, pwidth = char_data.width
179179 do
180- local pf = getfont(p)
181- local pc = getchar(p)
180+ local pf, pc = getfont(p), getchar(p)
182181 local feir = ltjf_font_extra_info[pf]
183182 if feir and feir.rotation and met.vert_activated then
184183 if feir.rotation[pc] then
@@ -186,10 +185,10 @@ local function capsule_glyph_tate(p, met, char_data, head, dir)
186185 end
187186 end
188187 local ident = fonts.hashes.identifiers[pf]
189- pwidth = (ident.descriptions and ident.descriptions[pc]
188+ pwidth = (ident.descriptions and ident.descriptions[pc]
190189 and ident.descriptions[pc].vheight
191190 and ident.descriptions[pc].vheight / ident.units * met.size)
192- or (ident.metadata and ident.metadate.defaultvheight) or (ascent+descent)
191+ or (ident.metadata and ident.metadata.defaultvheight) or (ascent+descent)
193192 ascent = feir.vorigin[pc] and (feir.vorigin[pc] / ident.units * met.size) or ascent
194193 end
195194 fwidth = fwidth or pwidth
--- /dev/null
+++ b/test/test51b-vorg.tex
@@ -0,0 +1,56 @@
1+\documentclass{ltjarticle}
2+\usepackage[margin=15mm,centering]{geometry}
3+\usepackage{lltjext,xcolor}
4+%\usepackage{lua-visual-debug}
5+\begin{document}
6+\def\V#1{%
7+ \setbox0=\hbox to0pt{\yoko\hss\smash{#1} \kern-\zw\hss}%
8+ \box0\relax
9+}
10+\def\YL{\rlap{\textcolor{magenta}{\vrule height 0.0625mm depth 0.0625mm width 500pt}}}
11+\def\TEST#1{\smash{\hbox to 0pt{\tate%
12+ \kern120pt\YL%
13+ \tfont\A=#1:jfm=ujisv at 10pt\A
14+ \jfont\B=#1:jfm=ujis at 10pt\B
15+ 国\V T\V y\V p\V o\V g\V r\V a\V p\V h\V y国\V Q国
16+ \V J国\V{\ltjjachar`Å}国
17+ \hss}}%
18+ \smash{\hbox to 0pt{\tate%
19+ \hbox to 120pt{\ttfamily #1\hss}\YL%
20+ \tfont\A=#1:jfm=ujisv at 10pt\A
21+ 国Typography国Q国J国\ltjjachar`Å国\ltjjachar"3031国
22+ \hss}}\quad}
23+
24+\def\TL{\smash{\rlap{\hbox to 0pt{\tate%
25+ \kern120pt\color{cyan}\kern-0.0625mm%
26+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
27+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
28+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
29+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
30+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
31+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
32+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
33+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
34+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
35+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
36+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
37+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
38+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
39+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
40+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
41+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
42+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
43+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
44+ \vrule height 400pt depth 0pt width 0.125mm\kern\dimexpr10pt-0.125mm%
45+}}}}
46+
47+\leavevmode
48+\TL
49+\TEST{IPAExMincho}
50+\TEST{HiraMinProN-W3}
51+\TEST{KozMinPr6N-Regular}
52+\TEST{YuMincho}
53+\TEST{SourceHanSerif-Regular}
54+
55+\end{document}
56+
旧リポジトリブラウザで表示