EpiData-dk / analysis

EpiData Analysis
2 stars 0 forks source link

Mac fonts / high DPI #69

Open charlesknightsbridge opened 2 months ago

charlesknightsbridge commented 2 months ago

I've made this a single issue, because I'm sure the problems below are linked.

When I build Analysis on my Mac, fonts look like this:

Screen Shot 2024-04-24 at 9 54 15 PM

The production Analysis fonts look like this:

Screen Shot 2024-04-24 at 9 53 57 PM

I know this difference has been there in the past. I'll have to read up a bit. My understanding is that Lazarus has been high DPI aware for some time.

Mac fonts are not handled properly in set "output font name". For example setting this to "Arial" yields an Arial font face, but the character spacing is doubled.

I don't know how Windows or Linux handle this.

charlesknightsbridge commented 2 months ago

with Output Format = text, all output is monospaced, whether the font is monospaced or not. This makes sense, as table borders require a monospaced font. TODO: a caution in the documentation that only monospaced fonts should be selected with Output Format = text

with Output Format = html, set "Output Font Name" has no effect. TODO: propagate font name changes to the htmlviewer

With regard to the appearance of fonts in the production build, it looks like the fonts are rendered with the option foo_antialiased2 (equivalent to foo_cleartype in Windows). see Reference: MSEgui/TFont For the Darwin build, the default option for all fonts should be foo_antialiased

This wiki page has some info about developing for Hi DPI: High_DPI_in_Lazarus_1.8_and_above

Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.

I don't really understand the hint. Does it mean that we should be doing all of our testing without HighDPI Mode and then turn on these for production? There are two options to check in the project Options / Application