[Lazarus] Font sizes on various platforms

Graeme Geldenhuys graemeg at opensoft.homeip.net
Tue Jul 7 14:33:07 CEST 2009


Could anybody help me with the following font problems please...

DPI Differences
As far as I know this is the following default DPI settings on various 

  - 75 dpi for Mac OS
  - 96 dpi for MS Windows
  - auto detect or 110 dpi for X11, though I have seem many
    applications an distros force a 96 dpi setting like Windows.

Now as far as I know this makes fonts look difference in size for the 
same font height. Is this only true when the font size is defined as 
pixel heigh, or does it also apply when font sizes are defined in points 
height as well?

Some Examples
 From my own experience, this is what I have found. Under Windows, the 
default system font size is 8 points (not 100% sure if this is points or 
pixels, but I believe it's points?). To get the same look (font height) 
under Linux, I need to set my X11 applications to use 10 points size 
fonts. Strangely enough, that is also the case even if I force my X11 to 
use 96 dpi like Windows. Why is that?

Now under Mac OS X (I just read this in the Mac HIG document), the 
standard (normal size) font is Lucida Grande Normal and is set to 13 
points. Judging by 1:1 ratio screenshots, those fonts appear the same 
size as my X11 applications (under Linux) set to 11 points font size.


- So why is there a difference in size between all the platforms?

- I first thought it was dpi related, but setting Linux to run at 96 dpi 
and Windows to 96 dpi there is still a size difference. Windows 8 point 
= Linux 10 point. Why?

- If I create a cross-platform application that uses a non-default font 
(not like what Lazarus LCL does by default), how am I supposed to set 
the font size, so the UI text looks consistent in size no matter the 

   - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the Lazarus mailing list