From 8621ded52c4391f8c8bf3dab4a875e0a6be0a8dc Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 3 Dec 2016 00:23:23 +0100 Subject: [PATCH] grid.c, windisp.c, vertical text for postscript and WINGUI Arial as standard font for WINGUI --- src/frontend/plotting/grid.c | 10 +++++++++- src/frontend/wdisp/windisp.c | 13 ++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index b4872e323..f05537d61 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 -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); } @@ -312,6 +318,8 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis) max = graph->absolute.width - graph->viewportxoff; } else { graph->viewportxoff = (digits + 5 + mag - mag3) * graph->fontwidth; + 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 ec5652b5c..12d09ebdb 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -69,7 +69,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 */ @@ -801,9 +801,6 @@ int 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; wd = pWindowData(currentgraph); @@ -811,8 +808,8 @@ int 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 ; @@ -828,10 +825,8 @@ int 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))) { - lf.lfHeight = (int) (1.1 * currentgraph->fontheight) ; + lf.lfHeight = (int) (1.3 * currentgraph->fontheight) ; } - -// lstrcpy (lf.lfFaceName, "Courier"/*"Times New Roman"*/) ; hfont = CreateFontIndirect (&lf); SelectObject(wd->hDC, hfont);