|
From: sfeam (E. Merritt) <eam...@gm...> - 2011-02-04 16:39:15
|
On Friday, February 04, 2011, Benjamin Lindner wrote: > Hello list, > > I ran into another strange behviour with the windows terminal and enhanced text. > With a 4.5.0 CVS snapshot build, when I execute > > set term windows enhanced > set ylabel "something in mm^2" > plot [0:2*pi] sin(x) with linespoints > > the ylabel is placed horizontally at the top left corner, however if I > do instead > > set tem windows enhanced > plot [0:2*pi] sin(x) with linespoints > set ylabel "something in mm^2" > replot > > it works as expected. > > I tracked it down to do_plot() in graphics.c at line 1632 deciding > that the terminal can't do rotated text. > do_plot() decides so, because WIN_text_angle (in win.trm) returnes > FALSE, because graphwin.rotate is FALSE. > Now graphwin.rotate is set in MakeFonts() in wgraph.c, which > determines, whether the font in question supports being rotated. > MakeFonts() in turn is called (among others) by GraphChangeFont() > which itself is called from drawgraph() with the OP Code W_font. > > Ok, so on startup, when the terminal is initialized, graphwin.rotate > is set to TRUE (which is correct), but it gets reset to FALSE during > execution. > This happens, because GraphChangeFont() is called with an empty font > name (not a NULL pointer, but the empty string ""). MakeFonts(), when > presented with a font name which is empty, resets graphwin.rotate to > FALSE. It should not do that. An empty string means "restore the default font". So unless the default font is for some reason non-rotatable, WIN_text_angle should always return TRUE. Ethan > And at this point I got unsure as to what is the correct way to fix > this problem. > > Solution 1) > GraphChangeFont() should test whether the font name is not empty, and > only then really change the font (i.e. silently ignore empty font > names) > > Solution 2) > drawgraph() should only call GraphChangeFont() if the font name is not > empty (i.e. silently ignore W_font commands with empty font names) > > Solution 3) > GraphChangeFont() should not be called with an empty font name in the > first place. > Such a call is found in WIN_set_font (win.trm) when the fontname is > NULL. Is this correct? > And WIN_set_font(NULL) is called from within WIN_options() with the > remark "font initialization". Is this correct, too? > > Solution 4) > deal with it in MakeFonts() directly. > > benjamin > > ------------------------------------------------------------------------------ > The modern datacenter depends on network connectivity to access resources > and provide services. The best practices for maximizing a physical server's > connectivity to a physical network are well understood - see how these > rules translate into the virtual world? > http://p.sf.net/sfu/oracle-sfdevnlfb > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |