From: Alan W. I. <ir...@be...> - 2009-04-07 16:29:30
|
On 2009-04-07 14:11+0100 Alban Rochel wrote: > Hello Alan et al, > > I've found a curious plplot behaviour having a closer look at example 3: > monitoring the font changes, it looks like there are font changes before > and after writing the thetas, switching from Times to Helvetica. I don't > think this is a problem in the Qt driver parser, as the font change also > occurs in wxwidgets. Obviously, Qt doesn't align the different fonts on > the same baselines. > > Is this font switch justified by anything? Note, that PLplot users always have the capability of switch fonts within strings so it is essential to make sure the alignment is not affected by such a switch. To give you some additional background, in this case you are not seeing a result of some FCI command inserted in the example 3 code. Instead, the FCI is inserted automatically by the PLplot core. This is a necessity because we have to support the first-generation plfreetype approach as well for dealing with unicode fonts. Unlike cairo.c and qt.cpp, the plfreetype approach has no method of automatically switching to the best system font to render the unicode glyph required by PLplot. Instead, plfreetype fonts are controlled only by file name. To avoid the situation where the user would have to insert special font-changing FCIs for every non-ascii character in PLplot strings, PLplot does this automatically by switching to the "symbol" font momentarily for each such non-Latin character. (Look for the comment "momentarily switch to symbol font" within plcore.c.) This greatly simplifies the user's life when they are using device drivers which depend on plfreetype. In the cairo and qt cases these automatic FCI's are redundant but should be relatively harmless since the symbol font for both those device drivers is simply defined as sans (or the equivalent generic Helvetica which stands for sans in the qt case) so the glyph finding algorithm just goes ahead and finds the best sans glyph. The result does look a bit peculiar when the string is actually generic serif, but nobody has ever complained about this. Eventually, I think we will probably retire the plfreetype approach altogether and strip out the automatic switch to symbol font at the same time. But we are always going to have deliberate font switches in the middle of strings by PLplot users so qt must always have the capability of dealing with FCI's in the middle of strings without losing alignment whether the FCI is automatically generated or not. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |