On 2009-04-07 15:40+0100 Alban Rochel wrote:

> Alan,
>
> Looking in plcore, I realized that plplot switched to the "Symbol" font
> before plotting a symbol, which is not supported in our driver (not
> declared as a StyleHint in Qt), and was just ignored, dropping through
> the "switch" statements to the default, which was helvetica. I've
> changed this part, so that requesting a "symbol" font just keeps the
> settings of the previous font. And everything gets aligned properly now
> in example 3.
>
> A patch is attached.

If I understand your patch correctly, it works around the alignment problem
by ignoring FCI's within strings.  But that drops an important PLplot
capability (the ability of PLplot users to deliberately change fonts in the
middle of a string).

Note, also, that currently in the unpatched svn trunk code, we have

case 0: case3: case4: default: f.setFamily("Helvetica");
f.setStyleHint(QFont::SansSerif);
break;

case 4 _is_ the symbol font so that automatically gets translated to the
generic Helvetica/sans-serif case just like should happen.

I assume from what you have said that currently unpatched svn trunk does the
character alignment for the whole string rather than for each individual
glyph. If that assumption is correct, then that is the real issue here, and
the proper and simple cure is to do the alignment independently for each
glyph in the string. Remember, the font can change from one glyph to the
next in the string not only because of PLplot FCI's (automatic or deliberate
user FCI's) but also because of the font finding done by the underlying Qt
code that might also change the font in the middle of a string to get the
highest-quality glyph or even to avoid missing glyphs for some fonts.

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
__________________________

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to