Hi Robert,
Thanks for looking at this. I'm sure it is an eclectic interest, but both of my
teaching sessions with the W3C produced questions of this sort from students
that I was moderately flumoxed and equally intrigued by.
>[...snip] And it's SVGLocatable that gives text the getBBox DOM method.
I think this is consistent with what I discovered roughly through trial and
error. I had rather hoped I would never have to read the spec so carefully as
to understand all that stuff that I just snipped from your reply (all that
stuff that looks like
interface SVGTSpanElement : SVGTextPositioningElement {
};
).
Sigh... I knew that stuff was there in the spec for a reason; I just hoped to
shield myself from it.
It was fascinating to see just how wildly all the browsers differed from one
another when I tried using getBBox to measure actual characters instead of
strings. Oh my! Either there are a lot of bugs out there or the spec is
underspecific! I finally gave up on getBBox( ) after somewhat reluctantly
realizing there was a reason for having getExtentOfChar in the spec. ( I had
glossed over that part on first reading , thinking that getBBox was a generic
can-opener for measuring rendered content. I guess it is unless the content has
characters inside? Are there other weird cases (other than the obvious case of
transforms and getCTM and viewBoxes and so forth) when getBBox measures things
that we can't see?
>As far as text decoration is concerned I'm still waiting for a response to
>this question to w3c:
>http://lists.w3.org/Archives/Public/www-svg/2009Oct/0010.html The firefox bug
>for text-decoration is https://bugzilla.mozilla.org/show_bug.cgi?id=317196
Oh good! I read your post here and it is reassuring to see that you've raised
exactly this same issue. In the case of overline , I really hope the answer is
to do it the way that Firefox and ASV do it rather than the way that Opera or
webkit does it. It makes more sense to overstrike a word than to overstrike
individual chars within the word, even if the chars have been mucked with.
>getBBox works on the entire text, getExtentOfChar works on individual glyphs.
Yes, I think I figured that out, though I think "aaa".getBBox() and
"AAA".getBBox() might give the same outcome in some browsers and not in other,
confusing me initially.
>getExtentOfChar
> Returns a tightest rectangle which defines the minimum and maximum
> X and Y values in the user coordinate system for rendering the
> glyph(s) that correspond to the specified character. The
> calculations assume that all glyphs occupy the full standard glyph
> cell for the font. If multiple consecutive characters are rendered
> inseparably (e.g., as a single glyph or a sequence of glyphs), then
> each of the inseparable characters will return the same extent.
>The "all glyphs occupy the full standard glyph cell for the font" is the key
>phrase here.
> Did I answer everything?
Well one more, I suppose: does this mean that since the glyph cell and the
glyph itself may not be of the same size that we have no method to actually
measure the glyph itself if it differs from the glyph cell? It appears that the
letter "p" in trampoline falls into that category.
Is Firefox correct in its handling of
http://granite.sru.edu/~ddailey/svg/tspanmeasure.svg while ASV, Opera, Chrome
and Safari are all wrong (albeit for different reasons in each case)? It looks
like Chrome has just a different manifestation of uncertainty about how to
apply getExtentofChar in cases of scaled or kerned text.
What I'm trying to do here can be seen by clicking on the words in this:
http://granite.sru.edu/~ddailey/svg/wordpuns.svg
I'll fiddle some more, I suppose.
Best
David
[Non-text portions of this message have been removed]
------------------------------------
-----
To unsubscribe send a message to: [email protected]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/