On 2008-10-12 12:05-0400 Hazen Babcock wrote:

>
> On Oct 11, 2008, at 8:14 PM, Alan W. Irwin wrote:
>
>> [...]The first bug I discovered today was the code incorrectly wrote 
>> indentation
>> white space and line end characters (used for human-readability formatting
>> of the xml file but _not_ part of the text itself) between the <text> and
>> </text> tags. Some viewers (konqueror, firefox 2) incorrectly ignored 
>> those
>> characters, but others (display and probably firefox 3) correctly rendered
>> them.  So the result was standard's compliant but still far from what was
>> intended for the text to be displayed.
>
> I'm glad to hear that you figured this out. Is this somewhere in the SVG 
> standard? I was looking at: http://www.w3.org/TR/SVG11/text.html#TextElement, 
> Example text01, from which I concluded that whitespace and line end 
> characters are ignored.
> This example has whitespace and line end characters both before and after the 
> text!

My first clue was when I tried hand-editing the simple test.svg example that
I had created with -dev svg.  Any reindentation changed the display positions
of the text rendered by "display"!  Then I recalled that white-space and
line-endings are not ignored within text elements for other xml-based
standards I am familiar with such as DocBook and Atom. In fact xslt (the xml
to xml transformation specification) has a variety of methods to help you
deal with whitespace issues within text elements.  So I removed the
extraneous white space and line endings (first by hand editing, and then by
changing svg.c), and all of a sudden "display" starting acting a lot more
reliably with regard to text positions.

I agree the w3c example you mention implies extraneous whitespace and line
endings will be ignored within text elements for SVG, but (a) the example
might not actually be consistent with the formal standard (which I have not
read) or (b) it's possible this is an ambiguity in the formal SVG standard
that different applications deal with in different ways.  Anyhow, I have
chosen to do the safe thing which is to remove the extraneous whitespace and
line endings put in by svg.c since it is definitely not part of the text to
be plotted.

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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to