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" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="central" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="before-edge" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="text-before-edge" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="after-edge" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="text-after-edge" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="ideographic" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="alphabetic" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="hanging" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="central" ></tspan></text> <text x="6.25" y="6.25" text-anchor="middle" class="common-segoe"><tspan alignment-baseline="mathematical" ></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