使用 Holden 字体时不显示撇号逗号

使用 Holden 字体时不显示撇号逗号

在普通字体(例如默认的计算机现代字体)中,输出中会出现撇号逗号。但是当我使用 Holden 字体时,\setmainfont{Holden}输出中不会出现撇号逗号。

我的代码是-

\documentclass[12pt]{article}
\usepackage[a4paper,left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{fontspec}
\usepackage[dvipsnames]{xcolor}
\usepackage[object=vectorian]{pgfornament} % also loads tikz
\setmainfont{Holden}
\tikzset{pgfornamentstyle/.style={draw = Periwinkle,
                                  fill = SpringGreen}}

\usetikzlibrary{
  positioning, % for left=of, above=of etc.
  calc % for let syntax used in second example
}

\begin{document}

\begin{center}
\begin{tikzpicture}[
  every node/.append style={inner sep=0},
  node distance=5mm
]
   \node [Black] (text){Vaijan's Honey};



  \path
    let
    \p1=(text.south west),
    \p2=(text.north east),
    \n1={\x2-\x1}, % width of text node
    \n2={\y2-\y1}  % height of text node
    in
% in all of the below some fraction of \n1 or \n2 is used to define the width of the ornaments
% set width of these ornaments to half the text node's width
   node [anchor=north] (below) at (text.south) {\pgfornament[width=0.5*\n1,symmetry=c]{69}}
   node [anchor=south] (above) at (text.north) {\pgfornament[width=0.5*\n1]{69}}



% use \n2 for ornament width here
   node [rotate=-90, left=of text, anchor=north] (left)  {\pgfornament[width=\n2]{46}}
   node [rotate=90, right=of text, anchor=north] (right) {\pgfornament[width=\n2]{46}}
% and \n1 here
   node [above=of above] (top)    {\pgfornament[width=\n1]{71}}
   node [below=of below] (bottom) {\pgfornament[width=\n1,symmetry=h]{71}}
%   node [anchor=north] (top) at (text.north)   {\pgfornament[width=\n1]{71}}
%   node [anchor=south] (bottom) at (text.south) {\pgfornament[width=\n1,symmetry=h]{71}}
% and 25% of width for the corner ornaments
   node [anchor=north west] at (top.north -| left.south)  {\pgfornament[width=0.25*\n1]{63}}
   node [anchor=north east] at (top.north -| right.south) {\pgfornament[width=0.25*\n1,symmetry=v]{63}}
   node [anchor=south west] at (bottom.south -| left.south) {\pgfornament[width=0.25*\n1,symmetry=h]{63}}
   node [anchor=south east] at (bottom.south -| right.south) {\pgfornament[width=0.25*\n1,symmetry=c]{63}}; % <- note the \path doesn't end until here

   % draw frame
  \draw [Blue] (current bounding box.south west) rectangle (current bounding box.north east);

  \vspace{2cm};
  \node [anchor=south] (bellowaddress1) at (below.south) {\pgfornament[width=0.10*\textwidth]{88}};
  \setmainfont{Linux Biolinum O}
  \tiny
  \node [Brown, below, align=center] (bellowaddress3) at (bellowaddress1.south) {Md.Al-Helal, CSE, DU\\ 01515611989};
  \node [anchor=south, below] (bellowaddress2) at (bellowaddress3.south) {\pgfornament[width=0.10*\textwidth]{88}};
\end{tikzpicture}
\end{center}
\end{document}

输出

在此处输入图片描述

答案1

显然,对于此字体,映射并不完全正确。日志显示:

Missing character: There is no ’ in font [Holden.otf]/OT:mapping=tex-text;!

然而,该字符是存在的,如在 FontForge 中所见:

在此处输入图片描述

FontForge 显示字符的名称,"quotesingle"。这可用于宏\XeTeXglyphindex查找索引号,该索引号可用于打印字符:

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmainfont{Holden.otf}
\begin{document}
The apostrophe is at position: \the\XeTeXglyphindex"quotesingle"

Printed: \XeTeXglyph83
\end{document}

在此处输入图片描述

注意这里.otf使用了字体,但是对于版本来说它的作用是一样的.ttf

应用于您的 MWE:

\node [Black] (text){Vaijan\XeTeXglyph83 s Honey};

在此处输入图片描述

答案2

字体默认使用 加载Ligatures=TeX。此功能重新映射'到 U+2019,但显然 Holden 字体在该位置没有字形。相反,其标准 ASCII 位置的撇号是花括号。

只需加载字体即可Ligatures=TeX

\documentclass[12pt]{article}
\usepackage[a4paper,left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
\usepackage{fontspec}
\usepackage[dvipsnames]{xcolor}
\usepackage[object=vectorian]{pgfornament} % also loads tikz


\newfontface{\holdenfont}{Holden}[
  Path=./,
  Extension=.otf,
  Ligatures=,
]

\tikzset{pgfornamentstyle/.style={draw = Periwinkle,
                                  fill = SpringGreen}}

\usetikzlibrary{
  positioning, % for left=of, above=of etc.
  calc % for let syntax used in second example
}

\begin{document}

\begin{center}
\begin{tikzpicture}[
  every node/.append style={inner sep=0},
  node distance=5mm
]
   \node [Black] (text){\holdenfont Vaijan's Honey};



  \path
    let
    \p1=(text.south west),
    \p2=(text.north east),
    \n1={\x2-\x1}, % width of text node
    \n2={\y2-\y1}  % height of text node
    in
% in all of the below some fraction of \n1 or \n2 is used to define the width of the ornaments
% set width of these ornaments to half the text node's width
   node [anchor=north] (below) at (text.south) {\pgfornament[width=0.5*\n1,symmetry=c]{69}}
   node [anchor=south] (above) at (text.north) {\pgfornament[width=0.5*\n1]{69}}



% use \n2 for ornament width here
   node [rotate=-90, left=of text, anchor=north] (left)  {\pgfornament[width=\n2]{46}}
   node [rotate=90, right=of text, anchor=north] (right) {\pgfornament[width=\n2]{46}}
% and \n1 here
   node [above=of above] (top)    {\pgfornament[width=\n1]{71}}
   node [below=of below] (bottom) {\pgfornament[width=\n1,symmetry=h]{71}}
%   node [anchor=north] (top) at (text.north)   {\pgfornament[width=\n1]{71}}
%   node [anchor=south] (bottom) at (text.south) {\pgfornament[width=\n1,symmetry=h]{71}}
% and 25% of width for the corner ornaments
   node [anchor=north west] at (top.north -| left.south)  {\pgfornament[width=0.25*\n1]{63}}
   node [anchor=north east] at (top.north -| right.south) {\pgfornament[width=0.25*\n1,symmetry=v]{63}}
   node [anchor=south west] at (bottom.south -| left.south) {\pgfornament[width=0.25*\n1,symmetry=h]{63}}
   node [anchor=south east] at (bottom.south -| right.south) {\pgfornament[width=0.25*\n1,symmetry=c]{63}}; % <- note the \path doesn't end until here

   % draw frame
  \draw [Blue] (current bounding box.south west) rectangle (current bounding box.north east);

  \vspace{2cm};
  \node [anchor=south] (bellowaddress1) at (below.south) {\pgfornament[width=0.10*\textwidth]{88}};
  \setmainfont{Linux Biolinum O}
  \tiny
  \node [Brown, below, align=center] (bellowaddress3) at (bellowaddress1.south) {Md.Al-Helal, CSE, DU\\ 01515611989};
  \node [anchor=south, below] (bellowaddress2) at (bellowaddress3.south) {\pgfornament[width=0.10*\textwidth]{88}};
\end{tikzpicture}
\end{center}
\end{document}

我加载它不是作为主字体,而是指定路径和扩展名只是为了适应我的设置(我当然不希望该字体破坏我的系统字体 

相关内容