diff options
Diffstat (limited to 'Build/source/utils/asymptote/pen.h')
-rw-r--r-- | Build/source/utils/asymptote/pen.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Build/source/utils/asymptote/pen.h b/Build/source/utils/asymptote/pen.h index 623a57f09ba..755d7262be6 100644 --- a/Build/source/utils/asymptote/pen.h +++ b/Build/source/utils/asymptote/pen.h @@ -17,6 +17,7 @@ namespace camp { static const string DEFPAT="<default>"; static const string DEFLATEXFONT="\\usefont{\\ASYencoding}{\\ASYfamily}{\\ASYseries}{\\ASYshape}"; +static const string DEFCONTEXTFONT="modern"; static const string DEFTEXFONT="cmr12"; static const double DEFWIDTH=-1; static const Int DEFCAP=-1; @@ -395,8 +396,15 @@ public: return settings::getSetting<string>("textinitialfont"); else { ostringstream buf; - buf << "\\font\\ASYfont=" << DEFTEXFONT << " at " << size() - << "pt\\ASYfont"; + // Protect context switchtobodyfont with gsave/grestore to prevent + // misalignment if font is not found. + if(texengine == "context") + buf << "\\special{pdf:q}\\switchtobodyfont[" + << DEFCONTEXTFONT << "," << size() << "pt]\\special{pdf:Q}%" + << newl; + else + buf << "\\font\\ASYfont=" << DEFTEXFONT + << " at " << size() << "pt\\ASYfont"; return buf.str(); } } |