QFontDatabase/QFont question
Maurizio Berti
maurizio.berti at gmail.com
Sun Jan 12 02:41:25 GMT 2025
Il giorno dom 12 gen 2025 alle ore 03:04 Charles <peacech at gmail.com> ha
scritto:
> variableAxisTags displays the tags that you have set, not the available
> tags for the font.
>
I was afraid of that.
Yet, a few hours ago I remembered about QRawFont, and I just found out that
a QRawFont.fontTable() <https://doc.qt.io/qt-6/qrawfont.html#fontTable>
function has been introduced as well since 6.7 (you can access a QRawFont
object through the static QRawFont.fromFont()).
As said, I haven't had the opportunity to test variable fonts, so the above
may still fall into the case mentioned by Charles.
Still, it's worth a shot.
If it still doesn't provide valid results, and as long as nobody else finds
a more simple and reliable way to check if a font has variable features,
you may consider filing a feature request ("Suggestion" in the "Issue Type"
field) on the Qt bug tracker. Assuming it's actually possible.
Just keep in mind that a QFont instance is more of an abstraction layer,
and *does not* intrinsically represent a specific font.
>From the description in its documentation
<https://doc.qt.io/qt-6/qfont.html#details> (emphasis mine):
QFont can be regarded as a *query* for *one or more* fonts on the system.
>
That's why QFontMetrics also provides a constructor that is based on a
given paint device, which may give different results based on that device
and its capabilities.
Font management is tricky (especially for cross-platform aspects), and the
variable font support introduced since 6.7 is relatively new.
We may need some time until all these aspects are properly addressed, and
filing *proper* reports may be a good thing to carefully consider.
And don't forget that font/text layout and management is an endless journey
into hell...
Cheers,
MaurizioB
--
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250112/ff5be202/attachment.htm>
More information about the PyQt
mailing list