diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-28 23:56:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-28 23:56:03 +0000 |
commit | e767448d0591f5dbb0cd485e4b014becdcbd1ba4 (patch) | |
tree | 83bec5bd1ee117130f3e9dcee985dcd42f5145d9 /Build/source/utils/asymptote/base/plain_pens.asy | |
parent | 20751a51df382b884807d8b9ef1ff7f7cc7739a5 (diff) |
asymptote 1.74
git-svn-id: svn://tug.org/texlive/trunk@13514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/base/plain_pens.asy')
-rw-r--r-- | Build/source/utils/asymptote/base/plain_pens.asy | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Build/source/utils/asymptote/base/plain_pens.asy b/Build/source/utils/asymptote/base/plain_pens.asy index 88fc112f684..5dba51dbda4 100644 --- a/Build/source/utils/asymptote/base/plain_pens.asy +++ b/Build/source/utils/asymptote/base/plain_pens.asy @@ -174,17 +174,29 @@ void write(file file=stdout, string s="", pen[] p) write(file,s,p[i],endl); } -pen font(string name) +void usetypescript(string s, string encoding="") { - return fontcommand("\font\ASYfont="+name+"\ASYfont"); + texpreamble("\usetypescript["+s+"]["+encoding+"]"); } -pen font(string name, real size) +pen font(string name, string options="") { + // Protect context switchtobodyfont with gsave/grestore to prevent + // misalignment if font is not found. + return fontcommand(settings.tex == "context" ? + "\special{pdf:q}\switchtobodyfont["+name+ + (options == "" ? "" : ","+options)+"]\special{pdf:Q}%" : + "\font\ASYfont="+name+"\ASYfont"); +} + +pen font(string name, real size, string options="") +{ + if(settings.tex == "context") + return fontsize(size)+font(name+","+(string) size+"pt",options); return fontsize(size)+font(name+" at "+(string) size+"pt"); } -pen font(string encoding, string family, string series="m", string shape="n") +pen font(string encoding, string family, string series, string shape) { return fontcommand("\usefont{"+encoding+"}{"+family+"}{"+series+"}{"+shape+ "}"); |