win32u: Use Full Name as fallback when Unique Name is not found in freetype name table

This patch should remedy an issue with freetype_set_outline_text_metrics failing to read a full name for some fonts that don't have a unique name entry in their name table.

For example, some Material fonts from Google that DON'T have a unique name entry.

Font NameID StringName
Material Icons Outlined 0 (Copyright) (Google Copyright Text)
1 (Family) Material Icons Outlined
2 (Style) Regular
6 (PostScript) MaterialIconsOutlined-Regular
Material Icons Round 0 (Copyright) (Google Copyright Text)
1 (Family) Material Icons Round
2 (Style) Regular
6 (PostScript) MaterialIconsRound-Regular
Material Icons Sharp 0 (Copyright) (Google Copyright Text)
1 (Family) Material Icons Sharp
2 (Style) Regular
6 (PostScript) MaterialIconsSharp-Regular
Material Icons Two Tone 0 (Copyright) (Google Copyright Text)
1 (Family) Material Icons Two Tone
2 (Style) Regular
6 (PostScript) MaterialIconsTwoTone-Regular

This (mostly) follows Apple's TrueType name table docs for what names should be included for a font (aside from missing a full name entry).

While this patch is based on Apple's documentation, it should be reasonable that the PostScript name is treated as an acceptable fallback for a unique name: "If two fonts are installed with the same PostScript name, Apple platforms treat them as duplicates and only one will be available for use."

Merge request reports

Loading