Bug 147739 - Font weight "Medium" is not listed in font styles menu if weight "Regular" is also installed
Summary: Font weight "Medium" is not listed in font styles menu if weight "Regular" is...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: ⁨خالد حسني⁩
URL:
Whiteboard: target:7.6.0 target:7.5.2
Keywords:
: 95816 119116 145041 153383 (view as bug list)
Depends on:
Blocks: Font-List
  Show dependency treegraph
 
Reported: 2022-03-02 19:27 UTC by Burkhard Grebe
Modified: 2023-02-24 11:47 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Burkhard Grebe 2022-03-02 19:27:01 UTC
Description:
for opentype fonts (example: Profile Pro):
  If font weights "Regular" and "Medium" are both installed:
    font weight "Medium" cannot be selected in the menu
  If only one of these font weights is installed:
    the installed font weight "Regular" or "Medium" can be selected in the menu

Steps to Reproduce:
1. install an opentype font with font weights "Regular" and "Medium" in Linux
2. select the installed opentype font
3. write a text sample in Libreoffice writer
4. try to select font weight "Medium"

Actual Results:
1. opentype font "Profile Pro" is installed on a Linux xfce system
  (Debian bullseye)
2. a sample text with font "Profile Pro" is shown in font weight "Regular"
3. in menu under font weight the weight "Medium" is not displayed and therefore
   cannot be chosen

Expected Results:
1. opentype font "Profile Pro" is installed on a Linux xfce system
  (Debian bullseye)
2. a sample text with font "Profile Pro" is shown in font weight "Regular"
3. in menu under font weight the weight "Medium" as font weight different from
   "Regular" is displayed and can be chosen


Reproducible: Always


User Profile Reset: No



Additional Info:
Because of different font weight structure the bug is not present in Windows file systems
Comment 1 Julien Nabet 2022-03-02 19:38:19 UTC
I downloaded both fonts in ttf formats (from https://fontshub.pro/font/profile-pro-download) and no pb to display then on pc Debian testing x86-64 with LO Debian package 7.3.1.1

Did you use ttf or one of the other formats? (eot, woff, woff2)
Comment 2 Julien Nabet 2022-03-03 19:29:16 UTC
On pc Debian x86-64 with master sources updated today and the otf files you provided, I could reproduce this.

I don't know the license of these fonts but do you think it's possible to attach them on the bugtracker?
Comment 3 Julien Nabet 2022-03-03 20:43:33 UTC
The fonts have the same name with otf, I suppose it's the source of the pb.
No pb with ttf which have distinct names "Profile Pro" and "Profile Pro Medium".

Please respond on the bugtracker (except attaching fonts since they're not free) in order to share info.
Comment 4 Julien Nabet 2022-03-04 11:41:26 UTC
As a workaround, you can try ttf fonts (the ones I used) which are free and have a distinct name.
For the rest, I can't help here=>uncc myself.
Comment 5 Timur 2022-05-18 06:46:17 UTC
Hi Kevin, please see if interested or comment or remove yourself. Thanks.
Comment 6 Thomas Linard 2023-02-04 20:25:06 UTC

*** This bug has been marked as a duplicate of bug 98596 ***
Comment 7 ⁨خالد حسني⁩ 2023-02-06 14:33:36 UTC
*** Bug 153383 has been marked as a duplicate of this bug. ***
Comment 8 ⁨خالد حسني⁩ 2023-02-06 14:35:46 UTC
Bug 98596 is too general, this is a rather specific issue and can be fixed independently and does not seem to be Linux-specific either (based on bug 153383).
Comment 9 Thomas Linard 2023-02-14 17:16:22 UTC
Several bug reports are related to this one:

Bug 35538 - Handling of fonts with more than 4 styles (R/B/I/BI) is suboptimal
Bug 69254 - Mac: Handling of fonts with more than 4 styles (R/B/I/BI) is suboptimal
Bug 72944 - Enhance handling of font varieties within families (weight, width, slope)
Bug 98596 - Linux: Handling of fonts with more than 4 styles (R/B/I/BI) is suboptimal
Bug 105298 - Incorrect handling of font families (weight, width, slope) cross-platform

Historically, every time someone said "I have this bug on macOS but also on Windows, or on Linux", they were told to open another bug report, "because we don't enumerate the fonts the same way according to the different OS".

So if the Medium weight isn't seen on Windows, macOS, and Linux, according to the traditional bug report response, it would be three different unrelated issues...
Comment 10 ⁨خالد حسني⁩ 2023-02-14 18:34:13 UTC
The platform layer is enumerating the fonts fine in this case, but somewhere indide libreoffice medium and regular get folded together and only one can be visible. The above bugs are unrelated.
Comment 11 Thomas Linard 2023-02-15 13:20:15 UTC
In fact, you'll find the mention of the lack of the Medium weight in most of the bugs I've cited (maybe we should have made a specific bug for Medium earlier, so this one, the 147739, is very suitable).
Comment 12 ⁨خالد حسني⁩ 2023-02-15 14:42:18 UTC
(In reply to Thomas Linard from comment #11)
> In fact, you'll find the mention of the lack of the Medium weight in most of
> the bugs I've cited (maybe we should have made a specific bug for Medium
> earlier, so this one, the 147739, is very suitable).

There are lots of comments and confusion surrounding the other bugs. The root issue, as far as I understand it, the incompatibility between the RBIBI model of Windows GDI that LibreOffice used on windows, and the lack of such limitation on Linux and macOS. That is the platform-specific part, most other issues that get lumped with these (like this issue) are not platform-specific.

I did a bit of debugging earlier and I think I know why Medium gets AWOL, but I didn’t have time to work on it further.
Comment 13 Commit Notification 2023-02-17 22:24:47 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0c9448bb31a32a3bf4004d45c4b1305debf1b5e2

tdf#147739: Medium is not a synonym of normal

It will be available in 7.6.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 14 Commit Notification 2023-02-18 12:56:00 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#147739: Medium is not a synonym of normal

It will be available in 7.5.2.

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 15 ⁨خالد حسني⁩ 2023-02-24 11:26:07 UTC
*** Bug 145041 has been marked as a duplicate of this bug. ***
Comment 16 ⁨خالد حسني⁩ 2023-02-24 11:46:13 UTC
*** Bug 119116 has been marked as a duplicate of this bug. ***
Comment 17 ⁨خالد حسني⁩ 2023-02-24 11:47:15 UTC
*** Bug 95816 has been marked as a duplicate of this bug. ***