Bug 153368 - Support optical size for OpenType variable fonts
Summary: Support optical size for OpenType variable fonts
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Khaled Hosny
URL:
Whiteboard: target:26.8.0 inReleaseNotes:26.8
Keywords:
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2023-02-04 07:49 UTC by Volga
Modified: 2026-06-12 15:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test document (18.38 KB, application/vnd.oasis.opendocument.text)
2026-03-02 22:08 UTC, Khaled Hosny
Details
Exported PDF (18.91 KB, application/pdf)
2026-03-02 22:08 UTC, Khaled Hosny
Details
Screenshot of the docuemnt (1.63 MB, image/png)
2026-03-02 22:10 UTC, Khaled Hosny
Details
Screenshot of the characters dialog (1.26 MB, image/png)
2026-03-02 22:11 UTC, Khaled Hosny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Volga 2023-02-04 07:49:05 UTC
Description:
OpenType font variation have the 'size' axis for optical fonts. In LibreOffice this should be activated by default for variable fonts so they would be able to produce proper rendition on documents.

If a font have both 'size' axis and 'size' feature tag, the 'size' axis should override 'size' feature tag.

Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: No

Additional Info:
-
Comment 1 Commit Notification 2026-03-02 20:45:37 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9e67072a21bdbdfa9dc8da826654bf6fb4ec6116

tdf#153368: Support optical size for variable fonts, part 1

It will be available in 26.8.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 Commit Notification 2026-03-02 20:45:39 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d128bdf1feadd167485f819a582af533cfde6523

tdf#153368: Support optical size for variable fonts, part 2

It will be available in 26.8.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 3 Commit Notification 2026-03-02 20:45:42 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/331e2c3b89d4f5fe53822489aab463a81fb19810

tdf#153368: Support optical size for variable fonts, part 3

It will be available in 26.8.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 4 Commit Notification 2026-03-02 20:45:45 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1802e84d03c3d458edc3e124d2a7839660bc53d0

tdf#153368: Support optical size for variable fonts, part 4

It will be available in 26.8.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 5 Commit Notification 2026-03-02 20:46:47 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/475ec1aa3683cd4a7ff9e5f89d0b3fc858763fa3

tdf#153368: Support optical size for variable fonts, part 5

It will be available in 26.8.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 6 Commit Notification 2026-03-02 20:46:50 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3fb0c4e15f66e383c6fe2e44eeb6b3a3b64b2721

tdf#153368: Support optical size for variable fonts, part 6

It will be available in 26.8.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 7 Commit Notification 2026-03-02 20:46:52 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/059b717535bf48243b7a63e309d6e22d7b2fcd1b

tdf#153368: Support optical size for variable fonts, part 7

It will be available in 26.8.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 8 Commit Notification 2026-03-02 20:46:55 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5825e9cfdbe8c8ab33a4db06bc9581aaed6c48de

tdf#153368: Support optical size for variable fonts, part 8

It will be available in 26.8.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 9 Khaled Hosny 2026-03-02 22:02:18 UTC
With these series of commits (and other foundational changes before them), I have added support for OpenType opsz axis:
1. A new font-optical-sizing property (under loext namespace for now), modeled after the similarly named CSS property: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-optical-sizing
2. When enabled, the opsz axis (for fonts that support it) is set to the font’s point size.
3. In Writer, Draw, and Impress, optical sizing is enabled by default for new documents.
4. For backward compatibility, it remains disabled by default for old documents.
5. The Position tab of the Character dialog has a new Optical Font Sizing option.
5. ODF importing/exporting supports the new property.
6. HTML importing/exporting uses the CSS equivalent.
7. PDF export instances the font into static instances and embeds them as regular fonts (no more Type 3 fonts, except for CFF2)
Comment 10 Khaled Hosny 2026-03-02 22:08:24 UTC
Created attachment 205893 [details]
Test document

Test document that uses https://fonts.google.com/specimen/Fraunces, with above text enabling Font Optical sizing, and below text disabling it. Notice how the above text gets more thinner strokes as the font size increases and some letters (like h, n, and s) change there shape compared to the smallest point size.
Comment 11 Khaled Hosny 2026-03-02 22:08:55 UTC
Created attachment 205894 [details]
Exported PDF
Comment 12 Khaled Hosny 2026-03-02 22:10:04 UTC
Created attachment 205895 [details]
Screenshot of the docuemnt
Comment 13 Khaled Hosny 2026-03-02 22:11:14 UTC
Created attachment 205896 [details]
Screenshot of the characters dialog
Comment 14 V Stuart Foote 2026-03-03 13:23:16 UTC
(In reply to Khaled Hosny from comment #10)
> Created attachment 205893 [details]
> Test document
> 
> Test document that uses https://fonts.google.com/specimen/Fraunces, with
> above text enabling Font Optical sizing, and below text disabling it. Notice
> how the above text gets more thinner strokes as the font size increases and
> some letters (like h, n, and s) change there shape compared to the smallest
> point size.

Khaled, *all* of your recent work on logical fonts & variations, postscript font naming, and integrating the harfbuzz variable font support to support this optical sizing is exceptional, and appreciated.

Thank you!