Bug 168251 - Add glyph scaling to paragraph justification
Summary: Add glyph scaling to paragraph justification
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on: 168351
Blocks: Paragraph-Alignment
  Show dependency treegraph
 
Reported: 2025-09-02 09:05 UTC by László Németh
Modified: 2025-09-10 13:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
tdf168251_demo.fodt: test document (43.67 KB, application/vnd.oasis.opendocument.text-flat-xml)
2025-09-08 17:49 UTC, László Németh
Details
tdf168251_demo.pdf: PDF export of the previous test document (31.04 KB, application/pdf)
2025-09-08 18:00 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2025-09-02 09:05:51 UTC
Description:
Minor automatic glyph scaling within a minimum/maximum range can minimize too big word spacing, rivers of justified lines, allowing to typeset narrow columns and more readable text. Combined with custom word spacing and letter spacing, it is the basic tool of DTP software to improve typography and readability.

Note: without optical sizing, e.g. variable fonts with "wdth" axis, the suggested/allowed minimum and maximum glyph scaling only a few percent, because distortion of the glyphs destroys their balanced stroke thickness, i.e. the design of the letters.

Steps to Reproduce:
Create a narrow column with justified text.

Actual Results:
Too big word spacing, often rivers (overlapping word spacing of consecutive lines).

Expected Results:
Closer to the desired word spacing, no rivers.


Reproducible: Always


User Profile Reset: No

Additional Info:
See Bug 167648.

See also CSS font-width: the font-stretch property at

https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-stretch-prop

and “Glyph scaling” in Text composition page of Adobe InDesign’s Help:

https://helpx.adobe.com/indesign/using/text-composition.html

More information: R. Schlicht: The microtype package, CTAN:

http://mirrors.ctan.org/macros/latex/contrib/microtype/microtype.pdf
Comment 1 Commit Notification 2025-09-03 13:23:38 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/45ec7bd76196dcc60b4c2db2f6f00623ecbaf5a4

tdf#168251 cui offapi xmloff sw glyph scaling: extend UNO/UX/ODF

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 László Németh 2025-09-08 17:49:34 UTC
Created attachment 202746 [details]
tdf168251_demo.fodt: test document
Comment 3 László Németh 2025-09-08 18:00:11 UTC
Created attachment 202747 [details]
tdf168251_demo.pdf: PDF export of the previous test document

Note: the +10% letter spacing and glyph scaling (without hyphenation and custom word spacing) is only for demonstration of the working letter spacing and glyph scaling, also their combination.

Line length is ~35 characters, i.e. the minimum value suggested for columns. Using also hyphenation and custom word spacing (and later paragraph-level justification) it's possible to create better paragraph layout with the suggested +3 letter spacing and 103% glyph scaling. Using wdth axis of variable fonts for glyph scaling, i.e. without destroying balanced stroke width and letter design, it's possible to use greater values for glyph scaling.
Comment 4 László Németh 2025-09-08 18:02:15 UTC
Close issue (opening new issues for smaller problems).