1

When I look at different anchors within the same text having same position, here is what comes to my mind. How is it possible to change the text-anchor but move the text back to its position?

I thought this will be achieved by:

  1. finding the BBOx before and after setting the anchor,
  2. Find the distance between the center of two
  3. shift it up or down with that distance value

It does not work that way meaning that the text does not break from the center of the BBox, then where does it break?

UPDATE: From SVG Documentation, I took this part out but did not really understand what it meant: For each glyph to be rendered, the SVG user agent determines an appropriate alignment-point on the glyph which will be placed exactly at the current text position. The alignment-point is determined based on glyph cell metrics in the glyph itself, the current inline-progression-direction and the glyph orientation relative to the inline-progression-direction. For most uses of Latin text (i.e., writing-mode:lr, text-anchor:start and alignment-baseline:baseline) the alignment-point in the glyph will be the intersection of left edge of the glyph cell (or some other glyph-specific x-axis coordinate indicating a left-side origin point) with the Latin baseline of the glyph.

SVG Text-anchor from MDN

4

0 回答 0