After developing an algorithm that converts text from SVG to HTML, I encountered a discrepancy in the positioning of the text. The issue stems from the difference in coordinate systems between SVG and HTML; SVG's origin is at the bottom left while HTML's is at the top left. As a result, my HTML text appears lower than intended. Despite my preference for keeping the text in SVG format, I am obliged to fulfill a client request for a pixel-perfect copy in HTML.
To rectify this discrepancy, I need to align the baseline of the text in HTML with the corresponding point from the SVG. I attempted to use vertical alignment for this purpose, but without success. Although I already know where the baseline should be positioned, I'm struggling to implement it effectively in the HTML version.
If anyone has insights on aligning the baseline of text to a specific point in HTML or if it's even feasible to position text using the baseline rather than the top left corner, I would greatly appreciate your input.