|
From: Benjamin L. <lin...@gm...> - 2010-02-07 19:02:33
|
Hello,
Working on the copy-to-clipboard-as-emf issue I stumbled over the
bug that the windows terminal obviously ignores the font name and size
specified for labels and instead uses the default terminal's font
and size.
To reproduce:
set term windows enhanced font "arial,9"
set label 1 "e^{i{/symbol p}}=-1" at graph 0.5,0.5 font "courier,15"
plot sin(x) with linespoints
Searching the code I found that in win.trm indeed the font is explicitly
reverted to the terminal's default before processing the text output ?
If I remove this statement, at least the size is working as expected,
but the font name still is ignored?
benjamin
diff --git a/term/win.trm b/term/win.trm
--- a/term/win.trm
+++ b/term/win.trm
@@ -894,7 +894,7 @@
/* This will restore the default font
and update WIN_font and WIN_fontsize */
- WIN_set_font(NULL);
+ /*WIN_set_font(NULL); */
/* Set the recursion going. We say to keep going until a
* closing brace, but we don't really expect to find one.
|
|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-07 19:16:12
|
On Sunday 07 February 2010, Benjamin Lindner wrote:
> Hello,
>
> Working on the copy-to-clipboard-as-emf issue I stumbled over the
> bug that the windows terminal obviously ignores the font name and size
> specified for labels and instead uses the default terminal's font
> and size.
Huh. Does the "enhancedtext.dem" demo not work under [real] Windows?
It works from the Windows terminal when run under linux+wine.
> To reproduce:
>
> set term windows enhanced font "arial,9"
> set label 1 "e^{i{/symbol p}}=-1" at graph 0.5,0.5 font "courier,15"
> plot sin(x) with linespoints
Works properly under linux+wine using wgnuplot from Oct 2009.
Could it be a font path problem?
Ethan
> Searching the code I found that in win.trm indeed the font is explicitly
> reverted to the terminal's default before processing the text output ?
>
> If I remove this statement, at least the size is working as expected,
> but the font name still is ignored?
>
> benjamin
>
> diff --git a/term/win.trm b/term/win.trm
> --- a/term/win.trm
> +++ b/term/win.trm
> @@ -894,7 +894,7 @@
>
> /* This will restore the default font
> and update WIN_font and WIN_fontsize */
> - WIN_set_font(NULL);
> + /*WIN_set_font(NULL); */
>
> /* Set the recursion going. We say to keep going until a
> * closing brace, but we don't really expect to find one.
|
|
From: Benjamin L. <lin...@gm...> - 2010-02-07 20:03:11
|
Ethan Merritt wrote:
> On Sunday 07 February 2010, Benjamin Lindner wrote:
>> Hello,
>>
>> Working on the copy-to-clipboard-as-emf issue I stumbled over the
>> bug that the windows terminal obviously ignores the font name and size
>> specified for labels and instead uses the default terminal's font
>> and size.
>
> Huh. Does the "enhancedtext.dem" demo not work under [real] Windows?
> It works from the Windows terminal when run under linux+wine.
Yes it works, but none of the demos contain a "set label" with explicit
fontname/size. *this* does not work.
>> To reproduce:
>>
>> set term windows enhanced font "arial,9"
>> set label 1 "e^{i{/symbol p}}=-1" at graph 0.5,0.5 font "courier,15"
>> plot sin(x) with linespoints
>
> Works properly under linux+wine using wgnuplot from Oct 2009.
> Could it be a font path problem?
Ah, there is one catch: it should read "courier new,15".
But then it still only works with the patch applied,
with the 4.4.0-rc1 binaries, it does neither change the font name nor
the font size.
So no, I don't think it's a font path issue.
It works fine if the label is set to "noenhanced".
But with enhanced text it ignores the explicit specifications.
benjamin
|
|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-07 22:04:13
|
On Sunday 07 February 2010, Benjamin Lindner wrote:
> Ethan Merritt wrote:
> > On Sunday 07 February 2010, Benjamin Lindner wrote:
> >> Hello,
> >>
> >> Working on the copy-to-clipboard-as-emf issue I stumbled over the
> >> bug that the windows terminal obviously ignores the font name and size
> >> specified for labels and instead uses the default terminal's font
> >> and size.
> >
> > Huh. Does the "enhancedtext.dem" demo not work under [real] Windows?
> > It works from the Windows terminal when run under linux+wine.
>
> Yes it works, but none of the demos contain a "set label" with explicit
> fontname/size. *this* does not work.
Ah. I misunderstood.
I thought you were talking about the enhanced text constructs, as in
set label 11 "{/Symbol=18 \362@_{/=9.6 0}^{/=12 ^\245}} {e^{-{/Symbol m}^2/2} d}"
where both the font and the size are correctly selected.
> >> To reproduce:
> >>
> >> set term windows enhanced font "arial,9"
> >> set label 1 "e^{i{/symbol p}}=-1" at graph 0.5,0.5 font "courier,15"
> >> plot sin(x) with linespoints
> >
> > Works properly under linux+wine using wgnuplot from Oct 2009.
> > Could it be a font path problem?
>
> Ah, there is one catch: it should read "courier new,15".
> But then it still only works with the patch applied,
> with the 4.4.0-rc1 binaries, it does neither change the font name nor
> the font size.
OK.
Petr:
Are you collecting the patches from Benjamin Lindner and
Tatsuro Matsuoka for application to 4.4?
Ethan
|
|
From: Benjamin L. <lin...@gm...> - 2010-02-08 07:56:51
|
> > >
> > > Huh. Does the "enhancedtext.dem" demo not work under [real] Windows?
> > > It works from the Windows terminal when run under linux+wine.
> >
> > Yes it works, but none of the demos contain a "set label" with explicit
> > fontname/size. *this* does not work.
>
> Ah. I misunderstood.
>
> I thought you were talking about the enhanced text constructs, as in
> set label 11 "{/Symbol=18 \362@_{/=9.6 0}^{/=12 ^\245}} {e^{-{/Symbol
> m}^2/2} d}"
> where both the font and the size are correctly selected.
Right. Sorry, I wasn't precise in my description.
set term windows enhanced font "arial,9"
set label 1 "e^{i{/symbol p}}=-1" at graph 0.5,0.5 font "Times,15"
set label 2 "{/Courier=15 e^{i{/symbol p}}=-1}" at graph 0.5,0.6
plot sin(x) with linespoints
Here the second label works, but the first doesn't.
>From debugging I saw that the flow was:
term.c: place_labels(), calling
gadgetgs.c: write_label(), calling
term.c: write_multiline()
now in write_multiline() there is the call to set_font in line 965
/* EAM 9-Feb-2003 - Set font before calculating sizes */
if (font && *font && t->set_font)
(*t->set_font) (font);
which applies the explicit font for label 1. Ok.
Then write_multiline() calls WIN_enhanced_put_text() in win.trm where
I read in line 895
/* This will restore the default font
and update WIN_font and WIN_fontsize */
WIN_set_font(NULL);
which then revokes the previously set fontname/size.
However, I see that enhanced_recursion() also has a parameter
'fontname' which is set to be NULL from within WIN_enhanced_put_text()
which, in line 2755 of enhanced_recursion()
default:
/*{{{ print it */
(term->enhanced_open)(fontname, fontsize, base, widthflag, showflag, overprint);
(term->enhanced_writec)(*p);
leads to NULL passed in the variable fontname to WIN_enhanced_open()
consequently leading to the default fontname being substituted *again*.
And then I got a bit confused as to the many calls to set the
fontname/size.
Hmm, I guess it's not that simple to solve this.
benjamin
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
|