Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behaviour of tab distances #60098

Closed
2 tasks done
cymed opened this issue Jan 9, 2025 · 2 comments
Closed
2 tasks done

Behaviour of tab distances #60098

cymed opened this issue Jan 9, 2025 · 2 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling

Comments

@cymed
Copy link

cymed commented Jan 9, 2025

What is the bug or the crash?

Tab distances behave unexpectedly when combined with alignment or when there are multiple tabs in a row

Steps to reproduce the issue

Base for tests, no dynamic tab width from #59253:

format('<div style="font-weight: bold; font-size: 12px;">Reservoir %1	%2	m<sup>3</sup></div>
<div style="text-align:left;font-size: 11px;">Water level:	%3	masl</div>
<div style="text-align:left;font-size: 11px;">Chamber 1:	%4	m<sup>3</sup></div>
<div style="text-align:left;font-size: 11px;">Chamber 2:	%5	m<sup>3</sup></div>',
'Example',500,1234.56,200,300)

Example works as expected:
grafik

Adding two tabs in a row for formatting:

format('<div style="font-weight: bold; font-size: 12px;">Reservoir %1	%2	m<sup>3</sup></div>
<div style="text-align:left;font-size: 11px;">Water level:		%3	masl</div>
<div style="text-align:left;font-size: 11px;">Chamber 1:		 %4	m<sup>3</sup></div>
<div style="text-align:left;font-size: 11px;">Chamber 2:		%5	m<sup>3</sup></div>',
'Example',500,1234.56,200,300)

Result:
grafik

Altering text-align

format('<div style="font-weight: bold; font-size: 12px;">Reservoir %1	%2	m<sup>3</sup></div>
<div style="text-align:right;font-size: 11px;">Water level:	%3	masl</div>
<div style="text-align:right;font-size: 11px;">Chamber 1:	%4	m<sup>3</sup></div>
<div style="text-align:right;font-size: 11px;">Chamber 2:	%5	m<sup>3</sup></div>',
'Example',500,1234.56,200,300)

Result:
grafik

It seems that text-align and tabs are interfering

Versions

QGIS-Version 3.40.2-Bratislava
QGIS-Codeversion 14826ca
 
Bibliotheken
Qt-Version 5.15.13
Python-Version 3.12.8
GDAL-Version 3.9.3
PROJ-Version 9.5.0
EPSG-Registraturdatenbankversion v11.016 (2024-08-31)
GEOS-Version 3.13.0-CAPI-1.19.0
SQLite-Version 3.46.1
PDAL-Version 2.8.1
PostgreSQL-Client-Version 16.2
SpatiaLite-Version 5.1.0
QWT-Version 6.3.0
QScintilla2-Version 2.14.1
BS-Version Windows 11 Version 2009
 
Aktive Python-Erweiterungen
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99

Bibliotheken
Qt-Version
5.15.13
Python-Version
3.12.8
GDAL-Version
3.9.3
PROJ-Version
9.5.0
EPSG-Registraturdatenbankversion
v11.016 (2024-08-31)
GEOS-Version
3.13.0-CAPI-1.19.0
SQLite-Version
3.46.1
PDAL-Version
2.8.1
PostgreSQL-Client-Version
16.2
SpatiaLite-Version
5.1.0
QWT-Version
6.3.0
QScintilla2-Version
2.14.1
BS-Version
Windows 11 Version 2009

Aktive Python-Erweiterungen
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@cymed cymed added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 9, 2025
@agiudiceandrea agiudiceandrea added the Labeling Related to QGIS map labeling label Jan 10, 2025
@nyalldawson nyalldawson self-assigned this Jan 27, 2025
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jan 28, 2025
@nyalldawson
Copy link
Collaborator

#60299 has a partial fix for this (handling multiple consecutive tabs). The combination of non-left align + tab stops is not supported, as it has no real meaning (eg try to use tabs in LibreOffice writer with right aligned text -- this is also not supported).

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jan 28, 2025
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jan 28, 2025
@cymed
Copy link
Author

cymed commented Jan 28, 2025

#60299 has a partial fix for this (handling multiple consecutive tabs). The combination of non-left align + tab stops is not supported, as it has no real meaning (eg try to use tabs in LibreOffice writer with right aligned text -- this is also not supported).

I see your point concerning tabs and alignment - I originally hoped to bypass the limitation of not having html table handling in QGIS labels by using tabs. Closing this issue.

@cymed cymed closed this as completed Jan 28, 2025
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jan 28, 2025
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Feb 4, 2025
nyalldawson added a commit that referenced this issue Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling
Projects
None yet
Development

No branches or pull requests

3 participants