usted / Albert-Sans

SIL Open Font License 1.1
93 stars 3 forks source link

Incorrect selection of italics/bold in Microsoft Word (in Albert Sans v1.3) #3

Closed HolgerGerhardt closed 2 months ago

HolgerGerhardt commented 2 months ago

When using “Albert Sans” in Microsoft Word (no matter whether in macOS or Windows), selecting italics (and bold italics) in Word makes the font artificially slanted instead of selecting the “Regular Italic” and “Bold Italic” versions, respectively.

Using “Albert Sans Regular” instead fixes this issue for the regular version. Then, however, selecting the bold version results in fonts that are artificially made heavier.

A similar issue applies to “Albert Sans Narrow.” There, however, it is only the Bold Italic version that is not selected correctly:

Albert Sans
HolgerGerhardt commented 2 months ago

The culprit seem to be the “TTF Names” that diverge for “Family” between AlbertSans-Regular.{otf/ttf} and AlbertSans-RegularItalic.{otf/ttf} as well as between AlbertSans-Bold.{otf/ttf} and AlbertSans-BoldItalic.{otf/ttf}.

In the following screenshot, the top row shows the original values (in FontForge). When I change these values to the values in the bottom row, the “italic” and “bold” buttons in MS Word work as intended:

Albert Sans TTF names

Having identical “Preferred Family” entries alone does not seem to do the job.

kenmcd commented 2 months ago

There was also a similar error in the Narrow fonts. Here is a complete set of fixed v1.300 TTF fonts. Albert.Sans.v1.300.(2024-07-27).fixed.names.TTF.only.zip

usted commented 2 months ago

@HolgerGerhardt @kenmcd Thank you both for identifying and reporting the issue. I will investigate it further as soon as I have access to my computer. At this point, I'm unsure if the error is due to the Glyph-file or occurs during the GF Build process.

HolgerGerhardt commented 2 months ago

I just checked: The issue was not present in v1.25. (There, the file of the normal italic version is called AlbertSans-Italic.{otf/ttf} instead of AlbertSans-RegularItalic.{otf/ttf}.)

Of course, the naming scheme—both internally and regarding the file names—makes more sense in v1.3 for a typeface that includes multiple weights, but it unfortunately has that undesired side effect in Word.

By comparison, selecting bold/italic in Pages or in Libre Office Writer works flawlessly with v1.3. Interestingly, however, selecting bold in Pages changes the line spacing as long as I do not set the line spacing to a fixed value in points:

AlbertWordPages

(Word on the left, Pages on the right.)

kenmcd commented 2 months ago

By comparison, selecting bold/italic in Pages or in Libre Office Writer works flawlessly with v1.3.

No. LibreOffice uses the style groups just like Word does. So the similar issues will be there. If you make a test doc with all the styles, you can see some of the errors. The image below is from LibreOffice, exported to PDF, and then exported from the PDF to an image. You can see the styles with faked italics by the different slant.

Albert-Sans-in-LibreOffice_1

To make sure all styles are all working you have to check the embedded fonts in the PDF. The faked italics will show that the regular or non-italic font is actually embedded. Below is the test PDF used to make the above image. Take a look at the fonts embedded for the oddly slanted text. They are not the italics fonts.

Albert-Sans-in-LibreOffice.pdf

Pages may be using the Typographic Family & Subfamily, rather than the style groups. So it could be different. Note how in your image above the italics angle is different.

HolgerGerhardt commented 2 months ago

No. LibreOffice uses the style groups just like Word does. So the similar issues will be there. If you make a test doc with all the styles, you can see some of the errors.

I should have been more specific: I was talking about LibreOffice for Mac. I can confirm that LibreOffice for Windows uses the fake italics, just like Word for Windows does.

LibreOffice for Mac uses the correct italic (and bold italic) version when clicking the “italic” (and “bold”) button. Here’s a screenshot of Word for Mac and LibreOffice for Mac side by side:

WordLibreOffice

(Of course, I know that the italic angle is the characteristic to look for. This is why I spotted the issue in the first place.)

kenmcd commented 2 months ago

You need to test with all styles. In LibreOffice on Mac pretty much the only thing which works correctly is the basic RIBBI. This is due to limitations in Mac regarding font styles (nameID 2).

HolgerGerhardt commented 2 months ago

Thank you, @usted, for fixing this so quickly in the current pre-release version (https://github.com/usted/Albert-Sans/releases/tag/v1.3)!

usted commented 2 months ago

Thanks @kenmcd and @HolgerGerhardt. It should be fixed now in the new release.

HolgerGerhardt commented 2 months ago

Thanks a lot, @usted! I can confirm that the issue is fixed in the current release.