<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Handling of fonts with more than 4 styles (R/B/I/BI) is suboptimal"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=35538#c54">Comment # 54</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Handling of fonts with more than 4 styles (R/B/I/BI) is suboptimal"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=35538">bug 35538</a>
              from <span class="vcard"><a class="email" href="mailto:henrik.svenson@aol.com" title="Henrik <henrik.svenson@aol.com>"> <span class="fn">Henrik</span></a>
</span></b>
        <pre>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
<a href="https://www.webtype.com/info/articles/fonts-weights/">https://www.webtype.com/info/articles/fonts-weights/</a>
<a href="https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass">https://docs.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass</a>
Section 2.3 Weight in
<a href="https://monotype.github.io/panose/pan2.htm">https://monotype.github.io/panose/pan2.htm</a>

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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>