Forum Bugs

SVG text: vertical shift that depends on the font

mparento
Hi, we use SVG text elements in our single page application and we found that, for large font sizes and depending on the font used, the vertical position of the text in the PDF can be quite different from the position in the Web page.

You can see examples for the fonts Lucida Console, Palatino Linotype and Acme in the attached files. The problem shows up for several other fonts as well but the shift differs for each one.

Since I also found a shift for normal HTML text for the Palatino Linotype font while testing, I joined test files for that case but our main concern is with the SVG text.

Thanks!
  1. Acme-Regular.ttf49.1 kB
  2. HTML text.html1.8 kB
  3. HTML text.pdf34.4 kB
  4. SVG text.html2.7 kB
  5. SVG text.pdf34.8 kB
mikeday
Thanks, this is because we are not using the correct x-height from the font when laying out text with baseline alignment of "middle", we will fix this for the next pre-release build.