SVG Text-anchor top left -
by default, anchor text element in svg @ bottom left, want @ top left, since creating rectangle act background text, displayed incorrectly since text higher rectangle (because rectangle anchor/offset @ top left). there way fix this, both text , rectangle can drawn @ same coordinates , displayed in same location.
the coordinates (x
, y
) supply text elements used baseline of text. makes sense because if there text varying font sizes on same line, want baselines line up.
there no "automatic" way want. svg elements absolutely positioned.
you have move text down bit making y
coordinate bit larger.
alternatively, add dy
attribute shift text down bit. or use transform
attribute same. using either of methods wouldn't simplifying process you.
Comments
Post a Comment