This allows for either:
- <sup>superscript</sup> / <sub>subscript</sub> components in text,
where the text will be vertically super or subscript aligned
and automatically sized to 2/3rd of the parent font size. Users
can also set a fixed font size for the super/sub script by
including css rules, e.g. <sup style="font-size:33pt">super</sup>
- "vertical-align: super" or "vertical-align: sub" CSS formatting
rules in any other HTML element
Sponsored by OSGEO UK
Previously the line height was always set in multiples of the
text line spacing. This works fine for rendering text blocks
containing text of all the same sizes, but when we mix
text sizes in the one document then the relative line height
option doesn't cover all use cases. (e.g. when a constant
spacing between lines is desired even when the text on those
lines varies in height)
and make opt-in for non-app clients
There's a tricky initialization balancing act happening here -- but
if we try to load the default style on a system missing the fonts
referenced in that style, then we risk trying to download those
fonts before the QgsNetworkAccessManager is ready.
So play it safe and defer all font download handling until the
QGIS app is fully launched.
available for use in QGIS
Allows for use of fonts which aren't installed system-wide in QGIS, e.g.
when the user does not have permission to install fonts on a system.
Unlike setting a font's style via setNamedStyle(), these settings
will ensure that a font is always rendered in bold or italic regardless
of whether the font family actually has a bold or italic variant. A
"faux bold" or slanted text effect will be emulated by Qt, which may
result in poor quality font rendering.
(For this reason it is greatly preferred to call setNamedStyle() instead.)
This API is being added so that QgsTextFormat/QgsTextRenderer can
replicate the same font behaviour as the base QFont/QPainter classes
do, where faux bold/italic effects are possible.
(It's not exposed anywhere for user control!)
Allows text to be horizontally stretched or condensed by a %
factor. Handy for tweaking the widths of fonts to fit a bit
of extra text into labels (when used sparingly, that is...
you can certainly abuse font stretching with some horrendous
results!)
Requires Qt 6.3+ or KDE's 5.15 fork
Thanks for KDAB for fixing the upstream issues blocking this!
Adds two new capitalization styles for labels and text symbols:
- Small Caps: Renders lowercase characters as small caps
- All Small Caps: Renders all characters as small caps (regardless
of their original case)
Requires Qt 6.3+, or Qt 5.15 using KDE's fork and the cmake
HAS_KDE_QT5_SMALL_CAPS_FIX switch defined during build.
QgsTextFormat
Just like in CSS, these families will be used as an ordered list
of fonts to fallback on if the actual text format font isn't available
on a particular QGIS install.
This is API only, and isn't designed to be shown anywhere in QGIS.
Instead the intended use is for creators of QGIS styles to either use
the raw api to specify the list of fallback fonts OR hand edit the
style xml to add the fallback fonts, e.g by adding a block like:
<families>
<family name="Arial"/>
<family name="Helvetica"/>
<family name="Sans"/>
</families>
To the "text-style" parent element.
rename the confusing "Capitalize First Letter" option to
"Force First Letter to Capital"
This change is intended to clarify the role of the "capitalize
first letter" option, and to provide an option which actually
does what users expect the "capitalize first letter" option
to do.
Fixes#16539