Created attachment 396391 [details] Patch When comparing SVG Fonts converted to OTF using FontForge and using WebKits builtin SVGToOTFFontConversion it is evident that the HHEA table is incorrect. The ascent/descent (HheaAscent/HheaDescent) stored in the HHEA table is currently equivalent to the typographic ascent/descent, as specified in the SVGFontFaceElement. This is not correct, it should be computed as unite of the individual glyph bounding boxes. Currently this wrong behavior leads to broken text seleciton when using SVG Fonts. The text selection highlight is placed incorrectly. This is easiy visible when converting the SVG Font to OTF using e.g. FontForge and comparing the text selection rects.
Created attachment 396392 [details] Patch
TODO: - Missing one reftest to compare SVG Fonts->OTF on-the-fly conversion vs. FontForge converted SVG Fonts - Expecations for mac (going through EWS to obtain them)
Created attachment 396517 [details] Patch
Created attachment 396519 [details] Patch
Created attachment 396700 [details] Patch
Created attachment 396956 [details] Patch
Created attachment 396961 [details] Patch
Created attachment 397176 [details] Patch
Created attachment 397195 [details] Patch
*sigh* I need access to a local Mac :-) This patch works flawlessly on Gtk/WPE (FreeType based font rendering) but shows issues on macOS, most noticeable on svg/text/kerning.svg, which is broken with the patch. Will investigate, no need to review until I get this sorted out.