libgdiplus icon indicating copy to clipboard operation
libgdiplus copied to clipboard

Bugfix/font style issue

Open abossard opened this issue 5 years ago • 4 comments

This fixes the wrong font-weight from issue #626

Sadly I it breaks the tests, but it does render the font as Bold.

I'll check what's wrong with the tests. Is this maybe a Mono issue instead of a libgdiplus issue?

abossard avatar Feb 26 '20 21:02 abossard

CLA assistant check
All CLA requirements met.

dnfclas avatar Feb 27 '20 08:02 dnfclas

I reverted the test metrics (cell ascent and descent and letter spacing) to the previous values. I compiled a few examples and didn't notice a degradation.

abossard avatar Feb 27 '20 09:02 abossard

The fix in the current form is incorrect, as pointed out in issue #626. The reason for duplicating properties of the original font is to preserve path to custom fonts (FC_FONT, FC_INDEX). The font metrics in the test are from the custom font and if you observe different ones it means the font was incorrectly substituted.

filipnavara avatar Mar 30 '20 16:03 filipnavara

@filipnavara do you know which component is responsible for the Font substitution?

It looks like the FcPatternDuplicate does not copy the font correctly. Certain fonts in Windows are different in Linux; I wonder if the FcPatternDuplicate would handle such cases. (e.g. Arial in Linux is: Liberation Sans)

I built the latest mono from master and I can confirm that this revert of FcPatternDuplicate resolves the font issue for me.

Debian with LightDM Mono: Built from master libgdiplus: master + this patch

engrch avatar Apr 12 '21 09:04 engrch