Discussion:
case sensitivity
Osei Poku
2007-08-10 17:40:18 UTC
Permalink
I am evaluating cl-who for the capability of generating svg documents.
One issue I have encountered is the viewBox attribute of a top-level
svg tag which appears to be case sensitive.

so for example:

(with-html-output (*standard-output* nil :indent t)
(:svg :width "500" :height "400" :viewBox "0 0 1000 800"
(:rect :x "1" :y "1" :width "600" :height "500"
:fill "none" :stroke-width "4" :stroke "red"))
nil)

gives:

<svg width='500' height='400' viewbox='0 0 1000 800'>
<rect x='1' y='1' width='600' height='500' fill='none'
stroke-width='4' stroke='red'/>
</svg>

which outputs a rectangle with some of the edges outside the viewable
area instead of inside the viewable area. Ideally the point of
viewbox is to scale all the coordinates used within the svg tag such
that they fit in the specified width and height of the svg tag.

Is there a clean way (other than special casing that tag) to create
the case sensitive attribute?

I am not sure why it is case-sensitive but the following viewers seem to
recognize the camelCase version and not the all lowercase version.

opera
inkscape
sketsa SVG graphics editor
xara xtreme


Thanks,
--
Osei Poku
Edi Weitz
2007-08-10 21:29:57 UTC
Permalink
Post by Osei Poku
Is there a clean way (other than special casing that tag) to create
the case sensitive attribute?
No, currently not. We'd need a patch similar to the one for
*DOWNCASE-TAGS-P* for that one (or maybe one should subsume downcasing
of tags and attributes into one special variable).

Cheers,
Edi.
Osei Poku
2007-08-11 00:21:07 UTC
Permalink
Post by Edi Weitz
Post by Osei Poku
Is there a clean way (other than special casing that tag) to create
the case sensitive attribute?
No, currently not. We'd need a patch similar to the one for
*DOWNCASE-TAGS-P* for that one (or maybe one should subsume downcasing
of tags and attributes into one special variable).
Patch attached. Naturally comments welcome.

I did the latter and replaced *DOWNCASE-TAGS-P* with
*DOWNCASE-TOKENS-P*. This make both element names and attributes case
sensitive when set to nil.
Post by Edi Weitz
Cheers,
Edi.
_______________________________________________
cl-who-devel site list
http://common-lisp.net/mailman/listinfo/cl-who-devel
--
Osei Poku
PhD Student, ECE
Carnegie Mellon University

412.268.2687 (work)
Edi Weitz
2007-08-24 08:06:00 UTC
Permalink
Post by Osei Poku
Patch attached. Naturally comments welcome.
Thanks for the patch which is in the new release. It took me a bit
longer to apply it as it wasn't complete - the HTML docs were missing.

http://weitz.de/patches.html

Cheers,
Edi.
Osei Poku
2007-08-24 14:26:23 UTC
Permalink
Post by Edi Weitz
Post by Osei Poku
Patch attached. Naturally comments welcome.
Thanks for the patch which is in the new release. It took me a bit
longer to apply it as it wasn't complete - the HTML docs were missing.
http://weitz.de/patches.html
Sorry. I should not have assumed that they were automatically generated.
Post by Edi Weitz
Cheers,
Edi.
_______________________________________________
cl-who-devel site list
http://common-lisp.net/mailman/listinfo/cl-who-devel
--
Osei Poku
Loading...