Re: Wanted: Help centering Text

"Siegfried Heintze" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.svg
Message-ID <[email protected]>
Woops! sorry. I did not read everything. I don't understand this 
alignment-baseline. At 
http://www.w3.org/TR/SVG/text.html#AlignmentBaselineProperty I read that it 
does not appy <text but only <tspan. That does not seem logical.

So I have a rectangle whose upper right corner is at 0,0 and width=12.5 and 
height=12.5. The following code does not center it horizontally or 
vertically:

<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="middle" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="central" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="before-edge" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="text-before-edge" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="after-edge" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="text-after-edge" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="ideographic" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="alphabetic" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="hanging" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="central" >&#57350;</tspan></text>
<text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan 
alignment-baseline="mathematical" >&#57350;</tspan></text>

Could it be a problem with custom font I'm using? OK, I tried the default 
font and removed the class="common-segoe" and that did not help with the 
vertical centering. It looks like the alignment-baseline has no affect! Is 
this a bug? But the horizontal alignment looks good. So maybe there is a 
problem with the custom font I am using? Uggghh... I'm not sure how to fix 
that.
Thanks!
Siegfried
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.