[Libreoffice-bugs] [Bug 35538] Handling of fonts with more than 4 styles (R/B/I/BI) is suboptimal

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun May 17 11:23:46 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=35538

--- Comment #54 from Henrik <henrik.svenson at aol.com> ---
Confirming a very similar issue on a fresh install Ubuntu 20.04 with
LibreOffice  Writer v6.4.3.2 from the Ubuntu repository.

Issue
=====

OTF font weights "Medium", "Medium Italic", "Mediumxxxxyyyyzzzz"
are not selectable in LibreOffice v6.4.3.2. Those fonts have to be renamed
"-Medium", "-Medium Italic", "-Mediumxxxxyyyyzzzz" to show up as selectable
weights.

Proposed Discussion
===================

According to
https://www.webtype.com/info/articles/fonts-weights/
https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass
Section 2.3 Weight in
https://monotype.github.io/panose/pan2.htm

the following commonly appearing font weights should at least be able to be
detected and shown as selectable by LibreOffice Writer font selector:

Thin
Very Light
Extra Light
Ultra Light
Light
Semi Light
Book
Demi
Normal
Regular
Medium
Semibold
Demibold
Bold
Heavy
Black
Extra Bold
Extra Black
Fat
Poster
Ultra Black
Nord

Test case
=========

Create a random test font with FontForge.
Fill the font with some glyphs like A-Z,a-z for testing.
In the "Font Info..." dialog (Ctrl+Shift+F)
select "TTF Names" table
and set entry 
"Styles (Subfamily)" = "Medium"
and entry
"Preferred Styles" = "Medium"
Create OTF font (test.otf) with FontForge.
Install the new test font (test.otf) in $HOME/.local/share/fonts/
Restart LibreOffice Writer so it detects the new font.
Type some text, select it, right-click, select "Character..."
and change the font to your new font with font weight "Medium".
"Medium" will not appear in the list of selectable font weights.

Result
======

If an OTF font's TTF Name table entry "Styles (Subfamily)" or "Preferred
Styles" has a string starting with "Medium", LibreOffice Writer will not
display it as selectable font weight in the font selection dialog. It does not
matter if you set the "Styles (Subfamily)" = "Mediumxyz" and "Preferred Styles"
= "Mediumxyz". Strings like "Medium Italics" wont show up either.

Workaround
==========

With FontForge:
In the "Font Info..." dialog (Ctrl+Shift+F)
select "TTF Names" table
Set entry 
"Styles (Subfamily)" = "-Medium"
and entry
"Preferred Styles" = "-Medium"

Regenerate the test font (test.otf) with FontForge.
Install/overwrite the new test font (test.otf) in $HOME/.local/share/fonts/
Restart LibreOffice Writer so it detects the new font.
Type some text, select it, right-click, select "Character..."
and change the font to your new font with font weight "-Medium".
"-Medium" will now appear in the list of selectable font weights.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200517/b7c8cf8f/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list