꽤 오래 전에 한 폰트 파일에 들어있는 글리프들을 식자하는 방법에 대한 논의가 있었죠. 그것을 모아 hzglyph.tex에 담았습니다.
그것을 이용하여 typeface.bat를 만들었고요. Noto Sans 글꼴이 어여쁘다는 소문에 그것의 글리프들을 감상하려 했습니다.
D:\>typeface NotoSancCJKsc-Regular.otf
PDF가 만들어지지 않습니다. 폰트가 여차저차하여 TeXLive 2015에서 될 것이란 얘기를 들었습니다. 오늘 TL2015를 설치했습니다.
소문과는 달리 미색이 아니네요. 아무튼 제가 쓴 방법은 이렇습니다.
hzglyphh.tex
\documentclass[12pt,b5paper,oneside]{memoir}
\usepackage{fontspec}
\usepackage{fmtcount}
\usepackage{tabto}
\setulmarginsandblock{15mm}{20mm}{*}
\setheadfoot{5mm}{10mm}
\setlrmarginsandblock{25mm}{25mm}{*}
\checkandfixthelayout
\pagestyle{plain}
\setlength\parindent{0pt}
\newcounter{tmpcnt}
\setcounter{tmpcnt}{1}
\newcounter{charno}
\setcounter{charno}{1}
\newcounter{inline}
\setcounter{inline}{8}
\NumTabs{\theinline}
\let\>\tab
\padzeroes[4]
\makeatletter
\newcommand\PrintGlyphs[2][\@empty]{
\ifx\@empty#1
\setcounter{charno}{1}
\else
\@empty\setcounter{charno}{#1}
\fi
\whiledo{\value{charno}<#2}{%
\textsf{\textsubscript{\Hexadecimal{charno}}}~\char\thecharno\>%
\stepcounter{charno}%
\stepcounter{tmpcnt}%
\ifthenelse{\value{tmpcnt}>\value{inline}}{%
\setcounter{tmpcnt}{1}\newline%
}{}}}
\makeatother
typeface.bat
if !%1==! (
echo typeface foo.ttf 65535
goto END
)
set FONTFILE=%1
set TEXFILE=%~n1.tex
if !%2==! (
SET CHARS=65535
) else (
set CHARS=%2
)
echo \input{hzglyph.tex} > %TEXFILE%
echo \setmainfont{%FONTFILE%} >> %TEXFILE%
echo \begin{document} >> %TEXFILE%
echo \PrintGlyphs{%CHARS%} >> %TEXFILE%
echo \end{document} >> %TEXFILE%
xelatex %TEXFILE%
KTUG 한국 텍 사용자 그룹