
TeX 소스에서 깔끔한 PDF 문서를 만들고 싶습니다. TeX 파일은 주로 ASCII가 아닌 기호(구성표의 화살표, 목록 항목을 표시하는 사용자 정의 글머리 기호, 크레딧 섹션의 기여자 이름의 상형 문자 등)가 거의 없는 ASCII 텍스트입니다.
TeX 소스는 Sphinx가 첫 번째 소스에서 구축한 것입니다.
비ASCII 기호는 기본적으로 문서 전체에 사용되는 글꼴에 대한 문자 모양이 없기 때문에 출력 PDF에 인쇄되지 않습니다.
그래서 TeX Live 설치 디렉터리에서 .pfb, .otf 및 .ttf 파일을 검색하고 발견된 각 글꼴에 대해 다음과 같은 TeX 문서를 생성하는 쉘 스크립트를 만들었습니다.
\documentclass{article}
\usepackage[english]{babel}
\usepackage{fontspec}
\usepackage{multido}
\font\testedfont="[/usr/share/texlive/texmf-dist/fonts/type1/wadalab/dgj/dgjkj.pfb]"
\font\basictextfont="cmr10"
\title{Find glyph for Unicode 80A5 in dgjkj.pfb}
\begin{document}
\newcounter{glyphslotnum}
\newcommand\findglyphslotnum{}
\newcounter{totalglyphnum}
\newcommand\findtotalglyphnum{}
Test glyphs
{\basictextfont{Font filename: dgjkj.pfb}}
\testedfont
\renewcommand\findglyphslotnum{\the\XeTeXcharglyph"80A5}
\setcounter{glyphslotnum}{\findglyphslotnum}
\renewcommand\findtotalglyphnum{\the\XeTeXcountglyphs\testedfont}
\setcounter{totalglyphnum}{\findtotalglyphnum}
%\multido{\i=0+1}{\value{totalglyphnum}\relax}{
%{\basictextfont\i:\,}{\testedfont\XeTeXglyph\i}
%}
\basictextfont
dgjkj.pfb: total \number\value{totalglyphnum} glyphs
\ifnum\value{glyphslotnum}>0{\message{Glyph for 80A5 exists in dgjkj.pfb (slot \number\value{glyphslotnum})}Glyph for Unicode 80A5 exists in dgjkj.pfb at slot \number\value{glyphslotnum}.
It looks like [{\testedfont\XeTeXglyph\value{glyphslotnum}}] (by $\backslash$XeTeXglyph)
or [{\testedfont{\char"80A5}}] (by $\backslash$char)
or [{\testedfont{\symbol{"80A5}}}] (by $\backslash$symbol)
}\fi
\end{document}
다음과 같은 출력이 제공됩니다(여기에 복사:dgjkj.pfb_U80A5.jpg):
multido 루프의 주석 처리를 제거하면 글꼴의 모든 글리프 목록이 제공됩니다.
필요한 모든 유니코드 기호에 대한 문자 모양이 있는 글꼴을 찾았지만 기호 U279C("무거운 둥근 팁 오른쪽 화살표")에 문제가 있습니다. 글꼴 파일(fonts/type1/urw/zapfding/uzdr.pfb)에서 발견되었지만(컴파일하는 동안 "279C에 대한 Glyph가 uzdr.pfb(슬롯 168)에 존재합니다"라는 메시지가 인쇄됨) 오류로 인해 PDF 작성이 실패합니다. 전체 출력 다음과 같다:
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./find_glyph_pfb_uzdr.tex
LaTeX2e <2017-04-15>
Babel <3.17> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def)
(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def
(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def)
(/usr/share/texlive/texmf-dist/tex/generic/babel/xebabel.def
(/usr/share/texlive/texmf-dist/tex/generic/babel/txtbabel.def)))))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texlive/texmf-dist/tex/latex/multido/multido.sty
(/usr/share/texlive/texmf-dist/tex/generic/multido/multido.tex
v1.42, 2010/05/14 <tvz>))
No file find_glyph_pfb_uzdr.aux.
Glyph for 279C exists in uzdr.pfb (slot 168) [1] (./find_glyph_pfb_uzdr.aux)
xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object.
Output file removed.
)
Error 256 (driver return code) generating output;
file find_glyph_pfb_uzdr.pdf may not be valid.
Transcript written on find_glyph_pfb_uzdr.log.
전체 로그는 여기에서 찾을 수 있습니다:find_glyph_pfb_uzdr.log.
그래서 질문은 - 그 문자를 인쇄하려면 어떻게 해야 합니까?
Upd: 실패한 TeX 문서:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{fontspec}
\usepackage{multido}
\font\testedfont="[/usr/share/texlive/texmf-dist/fonts/type1/urw/zapfding/uzdr.pfb]"
\font\basictextfont="cmr10"
\title{Find glyph for Unicode 279C in uzdr.pfb}
\begin{document}
\newcounter{glyphslotnum}
\newcommand\findglyphslotnum{}
\newcounter{totalglyphnum}
\newcommand\findtotalglyphnum{}
Test glyphs
{\basictextfont{Font filename: uzdr.pfb}}
\testedfont
\renewcommand\findglyphslotnum{\the\XeTeXcharglyph"279C}
\setcounter{glyphslotnum}{\findglyphslotnum}
\renewcommand\findtotalglyphnum{\the\XeTeXcountglyphs\testedfont}
\setcounter{totalglyphnum}{\findtotalglyphnum}
%\multido{\i=0+1}{\value{totalglyphnum}\relax}{
%{\basictextfont\i:\,}{\testedfont\XeTeXglyph\i}
%}
\basictextfont
uzdr.pfb: total \number\value{totalglyphnum} glyphs
\ifnum\value{glyphslotnum}>0{\message{Glyph for 279C exists in uzdr.pfb (slot \number\value{glyphslotnum})}Glyph for Unicode 279C exists in uzdr.pfb at slot \number\value{glyphslotnum}.
It looks like [{\testedfont\XeTeXglyph\value{glyphslotnum}}] (by $\backslash$XeTeXglyph)
or [{\testedfont{\char"279C}}] (by $\backslash$char)
or [{\testedfont{\symbol{"279C}}}] (by $\backslash$symbol)
}\fi
\end{document}