使用 tikz 和 xelatex 时,旋转的文本未出现在预期的位置

使用 tikz 和 xelatex 时,旋转的文本未出现在预期的位置

我想将字体更改为计算机上可用字体列表中的非标准字体。当我尝试编译以下文档时,应该出现在辐条上的文本散落在整个页面上。

\documentclass{article}
\usepackage{fontspec}
\setmainfont{ScottMorrison}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{tikz}
\def\aemonth{\ifcase\x\or
    {Jan}\or
    {Feb}\or
    {Mar}\or
    {Apr}\or
    {May}\or
    {Jun}\or
    {Jul}\or
    {Aug}\or
    {Sep}\or
    {Oct}\or
    {Nov}\or
    {Dec}\else
    {ERR}\fi}
\begin{document}

\begin{tikzpicture}

  \node[circle,
        draw,blue,
        minimum size=1em,
        inner sep=0pt] (C) at (-1,0) {};
  \def\prevx{1}
  \foreach \x in {1,2,...,12}
    {
      \pgfmathparse{-(\x-1)*30+90}
      \def\myRotAngle{\pgfmathresult}
      \node[anchor=180+\myRotAngle] at (C) {\rotatebox{\myRotAngle}{\hspace*{1.5em}(\x)text along spokes}};
      \node[circle,draw,red,minimum size=4pt,anchor=180+\myRotAngle] (C label \x) at ([shift={(\myRotAngle:4)}]C) {\textcolor{black}{\aemonth}};
      \draw (C) -- (C label \x);
      \draw (C label \x) -- (C label \prevx);
      \xdef\prevx{\x}
      \ifnum\x=12\relax
        \draw (C label 1) -- (C label \prevx);
      \fi
    }
\end{tikzpicture}
\end{document}

导致:

enter image description here

如果我消除字体声明并用 进行编译,一切都会正常工作pdflatex

enter image description here

我对 的操作不多,如果有的话xelatex。我需要做什么才能xelatex与 很好地配合使用tikz


该字体可以在使用来自 myscriptfont.com 的手写字体


更新

xelatex如果我只是使用而不担心使用设置字体\setmainfont或是否加载,我会遇到同样的问题\usepackage{fontspec}。根据评论,这是我log使用后文件的相关部分\listfiles

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
   expl3.sty    2013/07/12 v4544 L3 Experimental code bundle wrapper
 l3names.sty    2012/12/07 v4346 L3 Namespace for primitives
l3bootstrap.sty    2013/01/08 v4420 L3 Experimental bootstrap code
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty    2013/07/09 v4521 L3 Basic definitions
 l3expan.sty    2013/07/09 v4521 L3 Argument expansion
    l3tl.sty    2013/04/24 v4482 L3 Token lists
   l3seq.sty    2013/05/26 v4500 L3 Sequences and stacks
   l3int.sty    2013/04/24 v4482 L3 Integers
 l3quark.sty    2013/07/09 v4521 L3 Quarks
   l3prg.sty    2013/04/24 v4482 L3 Control structures
 l3clist.sty    2013/05/26 v4500 L3 Comma separated lists
 l3token.sty    2013/04/24 v4482 L3 Experimental token manipulation
  l3prop.sty    2013/01/09 v4423 L3 Property lists
   l3msg.sty    2013/01/08 v4412 L3 Messages
  l3file.sty    2013/05/01 v4483 L3 File and I/O operations
  l3skip.sty    2013/01/13 v4444 L3 Dimensions and skips
  l3keys.sty    2013/07/12 v4544 L3 Experimental key-value interfaces
    l3fp.sty    2013/07/09 v4521 L3 Floating points
   l3box.sty    2013/04/24 v4482 L3 Experimental boxes
l3coffins.sty    2012/09/09 v4212 L3 Coffin code layer
 l3color.sty    2012/08/29 v4156 L3 Experimental color support
l3luatex.sty    2012/08/03 v4049 L3 Experimental LuaTeX-specific functions
l3candidates.sty    2013/07/09 v4521 L3 Experimental additions to l3kernel
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
  xparse.sty    2013/07/12 v4544 L3 Experimental document command parser
fontspec-patches.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTe
X
fixltx2e.sty    2006/09/13 v1.1m fixes to LaTeX
fontspec-xetex.sty    2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
  eu1enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
 eu1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2013/04/29 v0.96 LaTeX color/graphics driver for XeTeX (RRM/JK)

fontspec.cfg
  lipsum.sty    2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
    tikz.sty    2013/08/05 v2.10-cvs (rcs-revision 1.129)
     pgf.sty    2013/08/23 v2.10-cvs (rcs-revision 1.13)
  pgfrcs.sty    2010/11/07 v2.10-cvs (rcs-revision 1.25)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10-cvs (rcs-revision 1.7)
  pgfsys.sty    2013/08/23 v2.10-cvs (rcs-revision 1.46)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v2.10-cvs (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10-cvs (rcs-revision 1.1)
  pgffor.sty    2013/07/18 v2.10-cvs (rcs-revision 1.24)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
   t3cmr.fd    2001/12/31 TIPA font definitions
 ***********

答案1

(总结评论)这里的问题是由于pgfsys-dvipdfmx.def最新的 CVS 中已经修复的一个错误,因此更新 PGF 是解决方案。

\listfiles命令列出了使用 LaTeX 内核注册的文件,但似乎遗漏了pgfsys-dvipdfmx.def,因此查看日志也是一个好主意。对于此类文件,kpsewhich <filename>会显示文件在系统上的位置,以便您确定其版本。

相关内容