|
From: Benjamin L. <bj...@gm...> - 2011-02-07 08:22:44
|
>
> OK. So I will have to leave it to you guys to figure out what the problem
> is, since it doesn't show up on my linux+wine setup.
Here we go:
The offending command happens in WIN_set_text(NULL), which places a
W_font command in the queue with an empty font name. Removing this one
solves the problem
diff --git a/src/term/win.trm b/src/term/win.trm
--- a/src/term/win.trm
+++ b/src/term/win.trm
@@ -730,7 +730,6 @@
int fontsize;
if (font == NULL) {
- GraphOp(&graphwin, W_font, 0, 0, "");
strcpy(WIN_font, graphwin.deffontname);
WIN_fontsize = graphwin.deffontsize;
return TRUE;
I am not sure this command should be there anyway, I don't really see
its purpose.
Tatsuro can you check if this also fixes the problem for you?
Second proposal:
Make GraphChangeFonts() more robust like:
diff --git a/src/src/win/wgraph.c b/src/src/win/wgraph.c
--- a/src/src/win/wgraph.c
+++ b/src/src/win/wgraph.c
@@ -2613,9 +2613,10 @@
{
int newfontsize;
bool remakefonts = FALSE;
+ bool font_is_not_empty = (font != NULL) && (font[0] != '\0');
newfontsize = (fontsize != 0) ? fontsize : lpgw->deffontsize;
- if (font != NULL) {
+ if (font_is_not_empty) {
remakefonts = (strcmp(lpgw->fontname, font) != 0) ||
(newfontsize != lpgw->fontsize);
} else {
remakefonts = (strcmp(lpgw->fontname, lpgw->deffontname) != 0)
|| (newfontsize != lpgw->fontsize);
@@ -2623,7 +2624,7 @@
if (remakefonts) {
lpgw->fontsize = newfontsize;
- strcpy(lpgw->fontname, (font) ? font : lpgw->deffontname);
+ strcpy(lpgw->fontname, font_is_not_empty ? font : lpgw->deffontname);
DestroyFonts(lpgw);
MakeFonts(lpgw, &rect, hdc);
This would ensure the behaviour of "" meaning "the default font" on
the low level terminal code.
Could you check this also Tatsuro?
I'm inclined to the first solution, but I'd like a second opinion on this.
> Does any recent MSWindows version ever provide a font that truly cannot
> be rotated? It may be that test and the flag for rotatable fonts is
> obsolete, and the corrsponding section of code in the routine MakeFonts()
> is no longer needed.
>
> If that is true, the simplest fix may be to change the first line of
> MakeFonts() so that it always sets lpgw->rotate = TRUE;
I honestly couldn't tell about window's fonts. The default font
certainly is rotatable, I guess all truetype/outline fonts are. I
don't know about monospaced bitmap fonts. I'd say: keep the test in
MakeFonts().
benjamin
|