ソースコードの管理場所
Revision | cc5f595d3e3785a9d967eeda47ba3934fd8bd97f (tree) |
---|---|
Time | 2021-11-06 21:34:34 |
Author | Hironori Kitagawa <h_kitagawa2001@yaho...> |
Commiter | Hironori Kitagawa |
Fix #43163
@@ -3,7 +3,7 @@ | ||
3 | 3 | -- |
4 | 4 | luatexbase.provides_module({ |
5 | 5 | name = 'luatexja.jfont', |
6 | - date = '2021-09-18', | |
6 | + date = '2021-11-06', | |
7 | 7 | description = 'Loader for Japanese fonts', |
8 | 8 | }) |
9 | 9 |
@@ -889,12 +889,16 @@ do | ||
889 | 889 | end |
890 | 890 | end |
891 | 891 | |
892 | - local function prepare_extra_data_font(id, res) | |
892 | + local function prepare_extra_data_font(id, res, name) | |
893 | 893 | if type(res)=='table' and (res.psname or res.filename) then |
894 | - local bname = res.psname or nameonly(res.filename) | |
895 | - local t = font_extra_basename[bname] | |
896 | - if not t then bname = prepare_extra_data_base(res) end | |
897 | - font_extra_info[id] = bname and (t or font_extra_basename[bname]) or dummytable | |
894 | + if (res.embedding=='no') and (type(name)=='string') and (name:sub(1,5)=='psft:') then | |
895 | + font_extra_info[id] = res.resources.ltj_extra | |
896 | + else | |
897 | + local bname = res.psname or nameonly(res.filename) | |
898 | + local t = font_extra_basename[bname] | |
899 | + if not t then bname = prepare_extra_data_base(res) end | |
900 | + font_extra_info[id] = bname and (t or font_extra_basename[bname]) or dummytable | |
901 | + end | |
898 | 902 | end |
899 | 903 | end |
900 | 904 | luatexbase.add_to_callback( |
@@ -907,7 +911,7 @@ do | ||
907 | 911 | luatexbase.add_to_callback( |
908 | 912 | 'luatexja.define_font', |
909 | 913 | function (res, name, size, id) |
910 | - prepare_extra_data_font(id, res) | |
914 | + prepare_extra_data_font(id, res, name) | |
911 | 915 | end, |
912 | 916 | 'ltj.prepare_extra_data', 1) |
913 | 917 |
@@ -5,7 +5,7 @@ luatexja.load_module('base'); local ltjb = luatexja.base | ||
5 | 5 | |
6 | 6 | local cidfont_data = {} |
7 | 7 | local cache_chars = {} |
8 | -local cache_ver = 10 | |
8 | +local cache_ver = 11 | |
9 | 9 | local identifiers = fonts.hashes.identifiers |
10 | 10 | |
11 | 11 | local cid_reg, cid_order, cid_supp, cid_name |
@@ -157,6 +157,7 @@ do | ||
157 | 157 | tth[pricode], cidmo[i], pricode |
158 | 158 | = { index = i }, pricode, pricode+1; |
159 | 159 | end |
160 | + ttu[i] = cidmo[i] | |
160 | 161 | ttu[cid_order .. '.' .. i] = cidmo[i] |
161 | 162 | end |
162 | 163 |
@@ -245,6 +246,9 @@ do | ||
245 | 246 | } |
246 | 247 | end |
247 | 248 | |
249 | +local dummy_vht, dummy_vorg = {}, {} | |
250 | +setmetatable(dummy_vht, {__index = function () return 1 end } ) | |
251 | +setmetatable(dummy_vorg, {__index = function () return 0.88 end } ) | |
248 | 252 | local function cid_cache_outdated(t) return t.version~=cache_ver end |
249 | 253 | local function read_cid_font() |
250 | 254 | local dat = ltjb.load_cache("ltj-cid-auto-" .. string.lower(cid_name), |
@@ -260,6 +264,9 @@ local function read_cid_font() | ||
260 | 264 | end |
261 | 265 | if cidfont_data[cid_name] then |
262 | 266 | cidfont_data[cid_name].shared.processes = cidf_vert_processor |
267 | + cidfont_data[cid_name].resources.ltj_extra | |
268 | + = { ind_to_uni = cidfont_data[cid_name].resources.unicodes, | |
269 | + vheight = dummy_vht, vorigin = dummy_vorg } | |
263 | 270 | for i,v in pairs(cidfont_data[cid_name].characters) do |
264 | 271 | if not v.width then v.width = 655360 end |
265 | 272 | v.height, v.depth = 576716.8, 78643.2 -- optimized for jfm-ujis.lua |
@@ -0,0 +1,92 @@ | ||
1 | +%#! lualatex | |
2 | +\documentclass{ltjsarticle} | |
3 | +\usepackage{luacode} | |
4 | +\usepackage{luatexja-otf,lltjext} | |
5 | +\usepackage[noembed]{luatexja-preset} | |
6 | +%\usepackage[hiragino-pron]{luatexja-preset} | |
7 | +\begin{document} | |
8 | + | |
9 | +※このファイルは和文フォントを埋め込んでいません. | |
10 | + | |
11 | +森\UTF{9DD7}外と\UTF{5167}田百\UTF{9592}とが\UTF{9AD9}島屋に行くところを想像した。 | |
12 | + | |
13 | +\CID{7652}飾区の\CID{13706}野屋 | |
14 | + | |
15 | +\section*{Adobe-Japan1-5で追加された文字を使った例} | |
16 | +\begin{itemize} | |
17 | + \item 「\゜か」,「\゜き」,「\゜く」,「\゜け」,「\゜こ」, | |
18 | + 「\゜カ」,「\゜キ」,「\゜ク」,「\゜ケ」,「\゜コ」は鼻濁音を表す。 | |
19 | + \item Macintosh用キーボードの\UTF{2318}(Command key)を押す。 | |
20 | + \item \UTF{2672}を心がけよう。 | |
21 | +\end{itemize} | |
22 | + | |
23 | +\section*{Adobe-Japan1-6で追加された文字を使った例} | |
24 | +\begin{itemize} | |
25 | + \item ほげほげ番組\CID{20556} | |
26 | + \item ほげほげフェスティバル\CID{20656} | |
27 | + \item \CID{20939}(Bq: becquerel)は放射能の強さを表す単位である。 | |
28 | + \item フラーレン(fullerene) C$_{60}$は | |
29 | + サッカーボール状(\CID{20957})の構造をしている。 | |
30 | + \item \UTF{9B87}とは岩魚(イワナ)のことであり,嘉魚とも書く。 | |
31 | +\end{itemize} | |
32 | + | |
33 | +\section*{ajmacros} | |
34 | + | |
35 | +\begin{enumerate}\renewcommand{\labelenumi}{\ajLabel\ajKuroKaku{enumi}} | |
36 | +\item その1 | |
37 | +\item その2 | |
38 | +\item その3 | |
39 | +\end{enumerate} | |
40 | + | |
41 | +{\bf(速報)}世界陸上\CID{20660},\ajLig{ボルト}がフライングで失格. | |
42 | + | |
43 | + | |
44 | +\ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}% | |
45 | +\textgt{\ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}} | |
46 | + | |
47 | +\hbox{\tate | |
48 | + \ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}% | |
49 | + \textgt{\ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}}} | |
50 | + | |
51 | + | |
52 | +\aj半角{半角カタカナひらがな} %←JFM の問題か,半角ひらがなが全角幅で出てしまう. | |
53 | +←luatexja-otf.sty内で,JFMの文法拡張を行いました. | |
54 | + | |
55 | + | |
56 | + | |
57 | +\newpage | |
58 | + | |
59 | +\newcommand\SAMPLE{% | |
60 | + \mbox{1\CID{0}☃ゃーん}\pbox<t>{2☃ゃーん}% | |
61 | + \mbox{3\UTF{2603}\UTF{3083}\UTF{30FC}ん}% | |
62 | + \pbox<t>{4\UTF{2603}\UTF{3083}\UTF{30FC}ん}% | |
63 | + \mbox{5\CID{8218}\CID{908}\CID{660}ん}% | |
64 | + \pbox<t>{6\CID{8218}\CID{908}\CID{660}ん}% | |
65 | + \mbox{7\CID{8218}\CID{7924}\CID{7891}ん}% | |
66 | + \pbox<t>{8\CID{8218}\CID{7924}\CID{7891}ん}} | |
67 | + | |
68 | +\SAMPLE\par\smallskip | |
69 | + | |
70 | + | |
71 | +\section*{Adobe-Japan1-7 全グリフ} | |
72 | + | |
73 | +{\footnotesize | |
74 | +% 表の作成は Lua でサボってしまう. | |
75 | +% \CID{0} (.notdef) は luaotfload がマッピングしてくれないみたい. | |
76 | +\begin{luacode*} | |
77 | +for i = 0, 23059 do | |
78 | + if i % 50 == 0 then | |
79 | + tex.print(string.format("\\noindent%05d", i)) | |
80 | + end | |
81 | + if i % 10 == 0 then | |
82 | + tex.print(" ") | |
83 | + end | |
84 | + tex.print("\\hbox to 1\\zw{\\CID{"..tostring(i).."}}%") | |
85 | + if i % 50 == 49 then | |
86 | + tex.print("\\\\") | |
87 | + end | |
88 | +end | |
89 | +\end{luacode*} | |
90 | +} | |
91 | + | |
92 | +\end{document} |