--
luatexbase.provides_module({
name = 'luatexja.jfont',
- date = '2021-09-18',
+ date = '2021-11-06',
description = 'Loader for Japanese fonts',
})
end
end
- local function prepare_extra_data_font(id, res)
+ local function prepare_extra_data_font(id, res, name)
if type(res)=='table' and (res.psname or res.filename) then
- local bname = res.psname or nameonly(res.filename)
- local t = font_extra_basename[bname]
- if not t then bname = prepare_extra_data_base(res) end
- font_extra_info[id] = bname and (t or font_extra_basename[bname]) or dummytable
+ if (res.embedding=='no') and (type(name)=='string') and (name:sub(1,5)=='psft:') then
+ font_extra_info[id] = res.resources.ltj_extra
+ else
+ local bname = res.psname or nameonly(res.filename)
+ local t = font_extra_basename[bname]
+ if not t then bname = prepare_extra_data_base(res) end
+ font_extra_info[id] = bname and (t or font_extra_basename[bname]) or dummytable
+ end
end
end
luatexbase.add_to_callback(
luatexbase.add_to_callback(
'luatexja.define_font',
function (res, name, size, id)
- prepare_extra_data_font(id, res)
+ prepare_extra_data_font(id, res, name)
end,
'ltj.prepare_extra_data', 1)
local cidfont_data = {}
local cache_chars = {}
-local cache_ver = 10
+local cache_ver = 11
local identifiers = fonts.hashes.identifiers
local cid_reg, cid_order, cid_supp, cid_name
tth[pricode], cidmo[i], pricode
= { index = i }, pricode, pricode+1;
end
+ ttu[i] = cidmo[i]
ttu[cid_order .. '.' .. i] = cidmo[i]
end
}
end
+local dummy_vht, dummy_vorg = {}, {}
+setmetatable(dummy_vht, {__index = function () return 1 end } )
+setmetatable(dummy_vorg, {__index = function () return 0.88 end } )
local function cid_cache_outdated(t) return t.version~=cache_ver end
local function read_cid_font()
local dat = ltjb.load_cache("ltj-cid-auto-" .. string.lower(cid_name),
end
if cidfont_data[cid_name] then
cidfont_data[cid_name].shared.processes = cidf_vert_processor
+ cidfont_data[cid_name].resources.ltj_extra
+ = { ind_to_uni = cidfont_data[cid_name].resources.unicodes,
+ vheight = dummy_vht, vorigin = dummy_vorg }
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
--- /dev/null
+%#! lualatex
+\documentclass{ltjsarticle}
+\usepackage{luacode}
+\usepackage{luatexja-otf,lltjext}
+\usepackage[noembed]{luatexja-preset}
+%\usepackage[hiragino-pron]{luatexja-preset}
+\begin{document}
+
+※このファイルは和文フォントを埋め込んでいません.
+
+森\UTF{9DD7}外と\UTF{5167}田百\UTF{9592}とが\UTF{9AD9}島屋に行くところを想像した。
+
+\CID{7652}飾区の\CID{13706}野屋
+
+\section*{Adobe-Japan1-5で追加された文字を使った例}
+\begin{itemize}
+ \item 「\゜か」,「\゜き」,「\゜く」,「\゜け」,「\゜こ」,
+ 「\゜カ」,「\゜キ」,「\゜ク」,「\゜ケ」,「\゜コ」は鼻濁音を表す。
+ \item Macintosh用キーボードの\UTF{2318}(Command key)を押す。
+ \item \UTF{2672}を心がけよう。
+\end{itemize}
+
+\section*{Adobe-Japan1-6で追加された文字を使った例}
+\begin{itemize}
+ \item ほげほげ番組\CID{20556}
+ \item ほげほげフェスティバル\CID{20656}
+ \item \CID{20939}(Bq: becquerel)は放射能の強さを表す単位である。
+ \item フラーレン(fullerene) C$_{60}$は
+ サッカーボール状(\CID{20957})の構造をしている。
+ \item \UTF{9B87}とは岩魚(イワナ)のことであり,嘉魚とも書く。
+\end{itemize}
+
+\section*{ajmacros}
+
+\begin{enumerate}\renewcommand{\labelenumi}{\ajLabel\ajKuroKaku{enumi}}
+\item その1
+\item その2
+\item その3
+\end{enumerate}
+
+{\bf(速報)}世界陸上\CID{20660},\ajLig{ボルト}がフライングで失格.
+
+
+\ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}%
+\textgt{\ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}}
+
+\hbox{\tate
+ \ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}%
+ \textgt{\ajLig{明治}\ajLig{大正}\ajLig{昭和}\ajLig{平成}\ajLig{令和}}}
+
+
+\aj半角{半角カタカナひらがな} %←JFM の問題か,半角ひらがなが全角幅で出てしまう.
+←luatexja-otf.sty内で,JFMの文法拡張を行いました.
+
+
+
+\newpage
+
+\newcommand\SAMPLE{%
+ \mbox{1\CID{0}☃ゃーん}\pbox<t>{2☃ゃーん}%
+ \mbox{3\UTF{2603}\UTF{3083}\UTF{30FC}ん}%
+ \pbox<t>{4\UTF{2603}\UTF{3083}\UTF{30FC}ん}%
+ \mbox{5\CID{8218}\CID{908}\CID{660}ん}%
+ \pbox<t>{6\CID{8218}\CID{908}\CID{660}ん}%
+ \mbox{7\CID{8218}\CID{7924}\CID{7891}ん}%
+ \pbox<t>{8\CID{8218}\CID{7924}\CID{7891}ん}}
+
+\SAMPLE\par\smallskip
+
+
+\section*{Adobe-Japan1-7 全グリフ}
+
+{\footnotesize
+% 表の作成は Lua でサボってしまう.
+% \CID{0} (.notdef) は luaotfload がマッピングしてくれないみたい.
+\begin{luacode*}
+for i = 0, 23059 do
+ if i % 50 == 0 then
+ tex.print(string.format("\\noindent%05d", i))
+ end
+ if i % 10 == 0 then
+ tex.print(" ")
+ end
+ tex.print("\\hbox to 1\\zw{\\CID{"..tostring(i).."}}%")
+ if i % 50 == 49 then
+ tex.print("\\\\")
+ end
+end
+\end{luacode*}
+}
+
+\end{document}