Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

GdipGetFontCollectionFamilyList does not correctly identify font families #692

@trungnt2910

Description

@trungnt2910

I am embedding the Open Sans font family (downloaded on Google Fonts) in my Windows Forms application.

To use these fonts, I've added each .ttf file to a PrivateFontCollection. After adding these fonts, I display all the font families by showing string.Join("\n", fontCollection.Families.Select(f => f.Name)).

On Windows, using .NET Framework 4.8, it correctly displays 4 Font families:

Open Sans
Open Sans ExtraBold
Open Sans Light
Open Sans SemiBold

(None of the Windows applications seem to recognize ExtraBold, Light, SemiBold as the same font family).

However, using the latest version of Mono, with the latest build of libgdiplus fetched from master, on Ubuntu 20.04, it shows:

Open Sans
Open Sans
Open Sans
Open Sans
Open Sans
Open Sans
Open Sans
Open Sans
Open Sans
Open Sans

(One different family for each font, although the library correctly recognize them all as Open Sans).

This makes my app unable to distinguish between Open Sans variants on Linux.
Also, creating a Font with one of these families, and applying FontStyle.Bold has no effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions