diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-05 10:27:50 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-12-05 10:27:50 (GMT) |
commit | 9e9b1b525c80ed7c369df28cefc524d01e7ebb16 (patch) | |
tree | 57ca69d8170a23d950aa386f2a9c6a4b0b143252 /generic/tkCanvPs.c | |
parent | f4a7a0e6ec336aad2e6d470e5a28f4360da2227f (diff) | |
download | tk-9e9b1b525c80ed7c369df28cefc524d01e7ebb16.zip tk-9e9b1b525c80ed7c369df28cefc524d01e7ebb16.tar.gz tk-9e9b1b525c80ed7c369df28cefc524d01e7ebb16.tar.bz2 |
Clean up PS prolog generation, getting rid of an obsolete file, and stop text
from going wildly wrong when Xft is used. [Bug 2107938]
Diffstat (limited to 'generic/tkCanvPs.c')
-rw-r--r-- | generic/tkCanvPs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index 951245a..d20f50d 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvPs.c,v 1.21 2008/11/01 16:14:30 dkf Exp $ + * RCS: @(#) $Id: tkCanvPs.c,v 1.22 2008/12/05 10:27:50 dkf Exp $ */ #include "tkInt.h" @@ -81,7 +81,9 @@ typedef struct TkPostscriptInfo { * pre-pass that collects font information, so * the Postscript generated isn't relevant. */ int prolog; /* Non-zero means output should contain the - * file prolog.ps in the header. */ + * standard prolog in the header. Generated in + * library/mkpsenc.tcl, stored in the variable + * ::tk::ps_preamable [sic]. */ } TkPostscriptInfo; /* @@ -454,7 +456,7 @@ TkCanvPostscriptCmd( * Insert the prolog */ - Tcl_AppendResult(interp, Tcl_GetVar(interp,"::tk::ps_preamable", + Tcl_AppendResult(interp, Tcl_GetVar(interp, "::tk::ps_preamable", TCL_GLOBAL_ONLY), NULL); if (psInfo.chan != NULL) { @@ -727,7 +729,7 @@ Tk_PostscriptFont( if (Tcl_ListObjGetElements(interp, list, &objc, &objv) != TCL_OK || objc != 2 - || Tcl_GetString(objv[0])[0]=='\0' + || Tcl_GetString(objv[0])[0] == '\0' || Tcl_GetDoubleFromObj(interp, objv[1], &size) != TCL_OK || size <= 0) { Tcl_ResetResult(interp); @@ -737,7 +739,7 @@ Tk_PostscriptFont( } fontname = Tcl_GetString(objv[0]); - sprintf(pointString, "%d", (int)size); + sprintf(pointString, "%d", (int) size); Tcl_AppendResult(interp, "/", fontname, " findfont ", pointString, " scalefont ", NULL); @@ -756,7 +758,7 @@ Tk_PostscriptFont( Tcl_DStringInit(&ds); points = Tk_PostscriptFontName(tkfont, &ds); - sprintf(pointString, "%d", points); + sprintf(pointString, "%d", (points<0 ? -points : points)); Tcl_AppendResult(interp, "/", Tcl_DStringValue(&ds), " findfont ", pointString, " scalefont ", NULL); if (strncasecmp(Tcl_DStringValue(&ds), "Symbol", 7) != 0) { |