|
From: Ethan M. <merritt@u.washington.edu> - 2010-08-16 16:40:27
|
On Monday 09 August 2010 04:15:22 am Shigeharu TAKENO wrote:
> shige 08/09 2010
> ----------------
>
> Ethan Merritt wrote:
> | > In enhanced mode for x11 term, the following commands
> | >
> | > set ylabel '{/Symbol=20 x}'
> | > set xlabel 'sin' font ',14'
> | > plot sin(x) notitle
> | >
> | > put the xlabel of "Symbol" font, but other terminals (post,wxt,
> | > svg,emf) put xlabels of default font.
> | >
> | > This may be fixed by the following patch.
> |
> | Thank you for the bug report.
> | Your test case does indeed reveal a problem.
> | Unfortunately, on my computer the patch does not fix it.
> | Maybe we need a corresponding change in gplt_x11?
>
> I find that the gnuplot_x11 uses the previous font if the default
> font is unknown and the font specification form is ',<size>'. For
> example,
>
> set term x11 enh font "Unknown-Fontname"
> set ylabel '{/Symbol=20 x}'
> set xlabel 'sin' font ',14'
> plot x
>
> the problem also remains even if with my last patch.
>
> The following additional patch for src/gplt_x11.c may solve the
> problem. But, I don't know well that we should use the default
> font instead of previous font for such a case.
I think the correct fix in gnuplot_x11 is directly equivalent to your
earlier fix to x11.trm. At the end of enhanced text processing, the
font must be restored to its default. Also, the previous_font_name
should be restored to its default.
So when gnuplot_X11 sees the "QF" command sent by your earlier fix,
it just needs to clear previous_font_name. In my testing that is
sufficient. I've added both the x11 and gplt_x11.c fixes to CVS.
Note: Two different cases need to be tested, because the code path
is different depending on the presence or absence of an X11 resource
"gnuplot*font".
Ethan
>
> ----- From here -----
> --- src/gplt_x11.c.ORG Mon Aug 9 18:54:02 2010
> +++ src/gplt_x11.c Mon Aug 9 20:02:38 2010
> @@ -5549,7 +5549,9 @@
> pr_font( fontname )
> char *fontname;
> {
> +#if 0
> static char previous_font_name[128];
> +#endif
> char fontspec[128];
> int fontsize = 0;
> #ifdef USE_X11_MULTIBYTE
> @@ -5612,7 +5614,11 @@
> #endif
> } else if (*fontname == ',') {
> sscanf(&fontname[1], "%d", &fontsize);
> +#if 0
> fontname = previous_font_name;
> +#else
> + fontname = default_font;
> +#endif
> #ifdef USE_X11_MULTIBYTE
> backfont = 1;
> #endif
> @@ -5758,8 +5764,10 @@
> if (usemultibyte && orgfontname)
> fontname = orgfontname;
> #endif
> +#if 0
> strncpy(previous_font_name, fontname, sizeof(previous_font_name)-1);
> FPRINTF((stderr, "gnuplot_x11:saving current font name \"%s\"\n", previous_font_name));
> +#endif
> }
>
> /* By now we have tried everything we can to honor the specific request. */
> ----- To here -----
>
> +========================================================+
> Shigeharu TAKENO NIigata Institute of Technology
> kashiwazaki,Niigata 945-1195 JAPAN
> sh...@ie... TEL(&FAX): +81-257-22-8161
> +========================================================+
>
--
Ethan A Merritt
Biomolecular Structure Center, K-428 Health Sciences Bldg
University of Washington, Seattle 98195-7742
|