Refactor: SVG Font


Two things are handled by this commit. First, getting rid of
QSvgRefCounter entirely and relying on std::unique_ptr, and secondly,
decoupling of font specification from font querying by texts.

The second point is interesting, because SVG fonts were not parsed
properly by QSvgHandler. For a starter, the "id" attribute on <font>
should never be used as a family name. Additionally, the specs
explicitly say that <font-face-src> is ignored on <font> elements, and
<font-face> is enough to describe the font. As a result, an SVG font is
created based on createFontNode and the family name parsed from
parseFontFace. The font is stored in QSvgDocument and can be queried by
any text that has a QSvgFontStyle. This allows us to get rid of
QSvgFontStyle dependency on QSvgFont.

One thing to note is that, the specs permits the usage of <font-face>
outside of a <font> element. In this case, <font-face-src> can be used
to refer to an SVG font, local font, or a font to be downloaded from a
server. Since we never supported this in the first place, it is kept out
and the body of parseFontFaceName is removed. Maybe in the future this
can be revisited and properly supported. However, SVG 2.0 specs
deprecate <font> and all <font-*> tags and relies entirely on CSS
@font-face rules.

Pick-to: 6.12
Fixes: QTBUG-144848
Change-Id: I4369de8d805774f961d4b6f5224f2ab032778e89
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
commit4bfc4ccd683d3d79133cf8a936e7457bff440d6b
parent4befb778b33b5745e1343e8c860063f8246c3000
authorHatem ElKharashy <hatem.elkharashy@qt.io>
committerHatem ElKharashy <hatem.elkharashy@qt.io>
commit timeTue, 25 Aug 2026 06:50:41 +0000