steinbergmedia / vstgui

A user interface toolkit mainly for audio plug-ins
Other
869 stars 123 forks source link

Font drawing inconsistencies between Mac and Windows #298

Closed bxjoscha closed 1 year ago

bxjoscha commented 1 year ago

VSTGUI has the following two font drawing inconsistencies between Mac and Windows:

The following drawings are made with the current develop state of VSTGUI using the Hello World example app.

VSTGUI Font Drawing Inconsistencies

In the above image, the first image is not scaled correctly, so here again:

VSTGUI Font Drawing Inconsistencies 2

scheffle commented 1 year ago

Hi, this is the difference between the platform dependent font render engines. If you need pixel perfect text rendering then you should pre-render the text into bitmaps and use them instead. Or do you have any other idea how this could be done?

bxjoscha commented 1 year ago

Hi @scheffle, actually I was able to fix both issues in our internal VSTGUI fork that, unfortunately, is not up-to-date to the current VSTGUI state. Here are the two changes I have made internally (still need to be validated by our QA, but on my machine it worked).

Actually, that part of the code changed and I do not find the lines in the latest state of VSTGUI.

Screenshot 2023-05-05 at 07 07 42

Screenshot 2023-05-05 at 07 08 02

bxjoscha commented 1 year ago

I found the lines the current VSTGUI version as well:

https://github.com/steinbergmedia/vstgui/blob/develop/vstgui/lib/platform/mac/coregraphicsdevicecontext.mm#L904

https://github.com/steinbergmedia/vstgui/blob/develop/vstgui/lib/platform/win32/direct2d/d2dgraphicscontext.cpp#L845

bxjoscha commented 1 year ago

If the fix gets validated, I would create a PR, but you could also investigate already and perhaps you are happy changing the code by yourself.

scheffle commented 1 year ago

Hi @bxjoscha , I'm very busy at the moment, but I will take care of this in the coming weeks.