diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 4aeb50c07..0c1b2f73b 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -141,7 +141,13 @@ gr_redrawgrid(GRAPH *graph) graph->fontwidth, (graph->absolute.height * 3) / 4, 0); } else { - DevDrawText(graph->grid.ylabel, + if (eq(dispdev->name, "postscript") || eq(dispdev->name, "Windows")) + DevDrawText(graph->grid.ylabel, + graph->fontwidth, + /*vertical text, midpoint in y is aligned midpoint of text string */ + (graph->absolute.height - (int) strlen(graph->grid.ylabel) * graph->fontwidth) / 2, 90); + else /* FIXME: for now excluding X11 and others */ + DevDrawText(graph->grid.ylabel, graph->fontwidth, graph->absolute.height / 2, 90); } @@ -311,8 +317,14 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis) margin = graph->viewportxoff; /*max = graph->viewport.width + graph->viewportxoff;*/ max = graph->absolute.width - graph->viewportxoff; + /* don't subtract font height from right border of grid */ + if (graph->grid.ylabel) + max += graph->fontheight; } else { graph->viewportxoff = (digits + 5 + mag - mag3) * graph->fontwidth; + /* add height of the vertical text to offset*/ + if (graph->grid.ylabel) + graph->viewportxoff += graph->fontheight; margin = graph->viewportyoff; /*max = graph->viewport.height + graph->viewportyoff;*/ max = graph->absolute.height - graph->viewportyoff; diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index 15a741c75..680ffd143 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -3,6 +3,7 @@ * Wolfgang Muees 27.10.97 * Holger Vogt 07.12.01 * Holger Vogt 05.12.07 + * Holger Vogt 01.11.18 */ #include "ngspice/ngspice.h" @@ -71,7 +72,7 @@ extern void com_hardcopy(wordlist *wl); #define M_LN10 2.30258509299404568402 #endif -#define DEF_FONTW "Courier" +#define DEF_FONTW "Arial" /* local variables */ static int IsRegistered = 0; /* 1 if window class is registered */ @@ -864,9 +865,6 @@ WIN_Text(char *text, int x, int y, int angle) tpWindowData wd; HFONT hfont; LOGFONT lf; - NG_IGNORE(angle); - - int CentiDegrees = 0; if (!currentgraph) return 0; @@ -877,8 +875,8 @@ WIN_Text(char *text, int x, int y, int angle) lf.lfHeight = (int) (1.1 * currentgraph->fontheight); lf.lfWidth = 0; - lf.lfEscapement = CentiDegrees; - lf.lfOrientation = CentiDegrees; + lf.lfEscapement = angle * 10; + lf.lfOrientation = angle * 10; lf.lfWeight = 500; lf.lfItalic = 0; lf.lfUnderline = 0; @@ -894,9 +892,7 @@ WIN_Text(char *text, int x, int y, int angle) (void) lstrcpy(lf.lfFaceName, DEF_FONTW); if (!cp_getvar("wfont_size", CP_NUM, &(lf.lfHeight), 0)) - lf.lfHeight = (int) (1.1 * currentgraph->fontheight); - -// lstrcpy (lf.lfFaceName, "Courier"/*"Times New Roman"*/); + lf.lfHeight = (int) (1.3 * currentgraph->fontheight); hfont = CreateFontIndirect (&lf); SelectObject(wd->hDC, hfont);