Nyall Dawson
519959154a
Fix some overly verbose class "brief" descriptions
2024-08-28 11:58:21 +10:00
Nyall Dawson
8b04562ba7
Avoid fragile reg for argument removal
2024-08-14 13:05:46 +10:00
Nyall Dawson
3a578d6712
Header update
2024-08-13 20:28:55 +10:00
Nyall Dawson
be8dce7d0d
Valid improvements from new sipify
2024-08-13 20:28:55 +10:00
Nyall Dawson
6f652d251b
Drop no-value copy constructor dox
2024-07-25 04:02:55 +10:00
Nyall Dawson
ad29a505e1
Fix text wrapping stability for small text
...
Adjust the QgsTextRenderer::calculateScaleFactorForFormat logic
so that small text is scaled up to at least 50 pixels when
calculating text metrics
This avoids tiny differences in calculated text metrics for small
text from affecting how text wrapping is calculated, which can
otherwise result in words at the end of lines "bouncing" from line
to line as layouts and maps are zoomed out
2024-07-25 04:02:33 +10:00
Nyall Dawson
28943f9c1b
Remove a bunch of useless default constructor doxygen
2024-07-23 02:08:28 +10:00
Nyall Dawson
190108e7f1
Fix automatic font download on Windows
2024-06-27 06:17:13 +10:00
Nyall Dawson
fce4ed06b8
Split fragments on tab characters
2024-05-25 06:10:28 +10:00
Nyall Dawson
25f00e2560
Don't try to render empty text strings
2024-05-25 06:10:28 +10:00
Nyall Dawson
f5853a7212
Add tab stop distance to QgsTextFormat
2024-05-25 06:10:28 +10:00
Nyall Dawson
b70fba6762
Download Google fonts from github, not broken Google fonts download url
...
Note that not all fonts available from Google fonts are present on
the github repo for some reason, eg Open Sans Condensed is not.
Fixes #57070
2024-04-18 11:31:55 +10:00
Alessandro Pasotti
db37ff8fc9
Merge pull request #56334 from elpaso/bugfix-gh55532-line-break-in-html-labels
...
[labeling] fix BR in HTML labels
2024-02-23 09:28:08 +01:00
Even Rouault
15ea5c46bc
Header files: remove all mentions of '\since QGIS 3.0'
2024-02-18 20:57:23 +01:00
Alessandro Pasotti
3705ad0c2b
[labeling] fix BR in HTML labels
...
Fix <br> ignored in HTML formatted labels.
Fix #55532
2024-02-13 12:10:25 +01:00
Mathieu Pellerin
0e6b4fb118
[layouts] Fix line height setting not respected for HTML-enabled label items
2023-10-17 15:55:13 +13:00
Nyall Dawson
ff7a5c934c
Fix pixelated icons in style lists on hi dpi displays
...
Use QgsScreenProperties in style model to ensure we
correctly generate preview icons matching the device
pixel ratio and DPI of all attached displays
2023-06-22 18:49:22 +10:00
Alessandro Pasotti
8b8d5d9031
Merge pull request #53438 from elpaso/bugfix-gh48020-server-opacities-parameter-does-not-apply-to-labels
...
Server: fix label opacity when OPACITIES is set
2023-06-21 16:32:16 +02:00
Nyall Dawson
730081dceb
Handle view device pixel ratio when generating preview icons
...
for text format and label settings
2023-06-21 13:46:50 +10:00
Alessandro Pasotti
b1b8fb8e15
Address PR comments
2023-06-14 09:55:48 +02:00
Alessandro Pasotti
a7c803e6c0
Implement multiplyOpacity for QgsTextFormat
...
This is used to change the labeling opacity in the server.
2023-06-13 12:55:40 +02:00
Nyall Dawson
50c76929e1
Followup 30700f1, ensure links to Qgis members are set in docstrings
2023-03-31 10:46:24 +10:00
Nyall Dawson
107e206ccb
Expand documentation
2023-03-27 20:58:08 +10:00
Nyall Dawson
95786c347d
Add QgsTextRenderer method to render text along a line/curved path
2023-03-27 20:58:08 +10:00
Nyall Dawson
f9c3da1e06
Move unit enums to Qgis, promote to enum class
2023-02-19 13:29:06 +10:00
Nyall Dawson
cfbf5ef51d
Add more efficient method to draw document when a QgsTextDocument is already available
2022-11-24 12:41:24 +10:00
Nyall Dawson
a10b971156
Add additional text renderer rect modes
...
Adds some text layout modes where the line heights are based
on cap heights or font ascent alone
These are required in order to port additional parts of QGIS
text rendering to the QgsTextRenderer class
2022-11-24 12:41:24 +10:00
Nyall Dawson
a7c39ffdc7
Add support for super and subscript HTML formatting in text renderer
...
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
2022-11-14 20:46:15 +10:00
Nyall Dawson
79b809a585
Prepare framework for text renderer vertical alignment
2022-11-14 20:46:15 +10:00
Nyall Dawson
ed84780de6
Avoid unnecessary font scaling by precalculating if format has a null
...
font size
2022-11-10 18:30:06 +10:00
Nyall Dawson
e478a52d72
Use precalculated horizontal advance and fragment fonts from text metrics instead of
...
recalculating
2022-11-10 18:30:06 +10:00
Nyall Dawson
8dbb654a55
Address review
2022-09-07 22:09:52 +10:00
Nyall Dawson
254c43df5f
Correctly render vertical oriented text using HTML formatting
2022-09-07 22:09:52 +10:00
Nyall Dawson
05bd566089
Modify text renderer to account for rendering text with HTML
...
content which varies in font metrics
2022-09-07 22:09:52 +10:00
Nyall Dawson
5f2aca49af
Correctly account for scaling factor and render context scale
...
when creating fonts for document fragments
2022-09-07 22:09:52 +10:00
Nyall Dawson
ad5d9d89f5
Add font size, family, italic and bold to QgsTextCharacterFormat
2022-09-07 22:09:52 +10:00
Nyall Dawson
b4c9378625
Move text renderer enums to Qgis, promote to enum class, tighten includes
2022-09-06 15:30:00 +10:00
Nyall Dawson
ed9dfa9f5a
Move TextOrientation enum from QgsTextFormat and promote to enum class
2022-09-05 17:17:18 +10:00
Nyall Dawson
775e333ec3
[feature][labeling] Add option to use absolute units for line height
...
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)
2022-09-05 13:17:33 +10:00
Nyall Dawson
864fee0172
Try to take stored font filename from response headers
2022-06-20 13:01:55 +10:00
Nyall Dawson
dae637a67c
Defer font download handling until QgsApplication is fully initialized
...
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.
2022-06-20 13:01:55 +10:00
Nyall Dawson
b9ff03473b
Download missing fonts when parsing vector tile styles wherever possible
...
This is an alternative approach to solving #46588 , where we avoid the
issues which arise from trying to render vector tile PBF fonts.
Refs #46588
2022-06-20 13:01:55 +10:00
Nyall Dawson
3214235580
Add method to remove a user font
2022-06-20 13:01:55 +10:00
Nyall Dawson
e1dba0dbe0
Allow for multiple user font directories, and add method to return
...
all installed user fonts
2022-06-20 13:01:55 +10:00
Nyall Dawson
852480c7bc
Wrap up font download in a nice method which just requires a family name
...
And populate hardcoded list with a bunch of known fonts available
from Google Fonts
2022-06-20 13:01:55 +10:00
Nyall Dawson
4772f6c27e
Add method to download and install a font
2022-06-20 13:01:55 +10:00
Nyall Dawson
4f2705e435
Make any TTF/OTF fonts stored in the QGIS user profile/fonts directory
...
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.
2022-06-20 13:01:55 +10:00
Nyall Dawson
d4ef3e3c3d
Make sure QgsFontManager methods are thread safe
2022-06-20 13:01:55 +10:00
Nyall Dawson
607b140c30
Add method to process a font family name and apply any matching
...
replacements
2022-06-20 13:01:55 +10:00
Nyall Dawson
3d7310b65c
Persist font replacements across sessions
2022-06-20 13:01:55 +10:00