Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-04

Fonts Advise between Windows & Linux

19 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee Jenkins

Hi everyone,

I am curious as to what others do in the case of applications that must be portable between Windows and Linux regarding fonts.

The specific font that is actually used doesn't matter to me as long as its readable and well rendered.

Just looking for suggestions,

Thank you,

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Albert Zeyer
to Lee Jenkins
Lee Jenkins wrote 12 lines
Hi everyone, I am curious as to what others do in the case of applications that must be portable between Windows and Linux regarding fonts. The specific font that is actually used doesn't matter to me as long as its readable and well rendered. Just looking for suggestions, Thank you,

Hi,

I had this problem recently while developing a Java applet. I used many advanced Unicode characters (mainly math symbols) in it and later, some users (mainly Windows users and some not up-to-date Linux users) reported that a lot of symbols where not shown correctly. Also, the width of my applet was a fixed constant and on some machines the font was much wider than on others and the Labels didn't fit anymore on the form. I also used sometimes a mono-spaced font and sometimes a normal font. There were even more problems with the mono-spaced font which seems to support even less characters on some systems.

I first tried around to give some special system dependent rules for an individual choice of the font. After a lot of tries, I came to the conclusion, that this is just not a good idea and there will always be some systems which have some problems.

In my case, I was restricted in the choice of the font also because I need a lot of these advanced Unicode characters. If you just need the normal Latin characters and nothing more, it's probably easier. But you should design your application in a way that it will work however the size of the actual font is.

For my problem, I just came to the conclusion to distribute a font together with the Java applet. The applet just loads this font and doesn't use any system , I had further problems to find a font which can display all of my needed characters. Normally, if you use the system fonts, there are special mechanisms that if a font doesn't support a individual character, the system will use automatically another similar font. I first figured this out while I was loading the ttf file directly.

I am using the free font DejaVu now which supports all my wanted characters.

Regards,
Albert

Reply by email

Lee Jenkins
to Albert Zeyer
Albert Zeyer wrote 53 lines
Am Samstag, den 12.04.2008, 10:11 -0400 schrieb Lee Jenkins: > Hi everyone, > > I am curious as to what others do in the case of applications that must be > portable between Windows and Linux regarding fonts. > > The specific font that is actually used doesn't matter to me as long as its > readable and well rendered. > > Just looking for suggestions, > > Thank you, > Hi, I had this problem recently while developing a Java applet. I used many advanced Unicode characters (mainly math symbols) in it and later, some users (mainly Windows users and some not up-to-date Linux users) reported that a lot of symbols where not shown correctly. Also, the width of my applet was a fixed constant and on some machines the font was much wider than on others and the Labels didn't fit anymore on the form. I also used sometimes a mono-spaced font and sometimes a normal font. There were even more problems with the mono-spaced font which seems to support even less characters on some systems. I first tried around to give some special system dependent rules for an individual choice of the font. After a lot of tries, I came to the conclusion, that this is just not a good idea and there will always be some systems which have some problems. In my case, I was restricted in the choice of the font also because I need a lot of these advanced Unicode characters. If you just need the normal Latin characters and nothing more, it's probably easier. But you should design your application in a way that it will work however the size of the actual font is. For my problem, I just came to the conclusion to distribute a font together with the Java applet. The applet just loads this font and doesn't use any system font at all. Here, I had further problems to find a font which can display all of my needed characters. Normally, if you use the system fonts, there are special mechanisms that if a font doesn't support a individual character, the system will use automatically another similar font. I first figured this out while I was loading the ttf file directly. I am using the free font DejaVu now which supports all my wanted characters. Regards, Albert

Thanks Albert.

This will be primarily simple texts such as button captions, etc. I just want to make sure that the fonts display as normally as possible on each platform.

Thanks again,

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Mattias Gaertner
to Lee Jenkins
[...] This will be primarily simple texts such as button captions, etc. I just want to make sure that the fonts display as normally as possible on each platform.

Then you should take the default and use the autosizing properties to auto resize your forms.

Mattias

Reply by email

Lee Jenkins
to Mattias Gaertner
Mattias Gaertner wrote 12 lines
On Sat, 12 Apr 2008 11:42:38 -0400 Lee Jenkins wrote: > [...] > This will be primarily simple texts such as button captions, etc. I > just want to make sure that the fonts display as normally as possible > on each platform. Then you should take the default and use the autosizing properties to auto resize your forms. Mattias

Thanks Mattias,

I don't think that will be an option as this is not a desktop application, but a POS application with specific size screens, etc.

I guess the best thing I can do is try to ensure there is enough space for possible differences in font rendering and test a lot.

Thanks again,

Warm Regards, Lee

Reply by email

Graeme Geldenhuys
to Lee Jenkins: Thanks Albert. This will be primarily simple texts such as button captions, etc. I just…
Lee Jenkins wrote
This will be primarily simple texts such as button captions, etc. I just want to make sure that the fonts display as normally as possible on each platform.

You could use the DejaVu fonts. They are freely available on SourceForge and look pretty good. DejaVu is normally included with Linux distro and is very simple to install under Windows. It's a very small download and you can even ship it with your application. http://sourceforge.net/projects/dejavu/

Alternatively, if the Windows users keep bitching that they actually need to install a font before using the program (I really can see the issue here... you have to install MS Office before you can use it!), then you can let the Linux users install the require fonts fonts. The Microsoft Core Web fonts are freely available. The Arial font is normally a nice looking GUI font as well.

NOTE:
Just remember that the sizes are also different between Linux and Windows! I'm still trying to find out why this is - some technical reason maybe?. eg: Arial-8 under Windows is roughly the same size as Arial-10 under Linux. Arial-8 under Linux will be very small!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Sat, 12 Apr 2008 11:42:38 -0400 Then you should take the default and use the…
Mattias Gaertner wrote 5 lines
Then you should take the default and use the autosizing properties to auto resize your forms. From my experience, that has very limited success! I'm not sure if

the font system in LCL has improved over the last two years, but the last time I used things like Bold, Italic etc they were not consistent under Linux and Windows. eg: We kept a label with Default font, but set the Bold = True. Under Windows it looked fine, under Linux it looked like a standard label (no bold).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Lee Jenkins
to Graeme Geldenhuys: You could use the DejaVu fonts. They are freely available on SourceForge and look pretty…
Graeme Geldenhuys wrote 24 lines
On 12/04/2008, Lee Jenkins wrote: > This will be primarily simple texts such as button captions, etc. I just want > to make sure that the fonts display as normally as possible on each platform. You could use the DejaVu fonts. They are freely available on SourceForge and look pretty good. DejaVu is normally included with Linux distro and is very simple to install under Windows. It's a very small download and you can even ship it with your application. http://sourceforge.net/projects/dejavu/ Alternatively, if the Windows users keep bitching that they actually need to install a font before using the program (I really can see the issue here... you have to install MS Office before you can use it!), then you can let the Linux users install the require fonts fonts. The Microsoft Core Web fonts are freely available. The Arial font is normally a nice looking GUI font as well. NOTE: Just remember that the sizes are also different between Linux and Windows! I'm still trying to find out why this is - some technical reason maybe?. eg: Arial-8 under Windows is roughly the same size as Arial-10 under Linux. Arial-8 under Linux will be very small!

Nice. Are these similar to mscorefonts?

Fortunately, this particular application doesn't necessarily allow the user to change fonts so if I can find a suitable font between both windows and linux, it shouldn't be that difficult maintain. I'm assuming anyway. The existing version of the application support multiple languages which has given a little practice in allocating enough room for textual display.

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Ales Katona
to Lee Jenkins

I believe the size difference stems from the different DPI in font/widgetsets. The size parameter at least on gtk is calculated by division and DPI is featured, so it's possible that the default DPI differ on platforms?

My knowledge of this area is quite limited tho so I might have said something stupid.

Reply by email

Marco van de Voort
to Ales Katona
Ales Katona wrote
I believe the size difference stems from the different DPI in font/widgetsets. The size parameter at least on gtk is calculated by division and DPI is featured, so it's possible that the default DPI differ on platforms?

The dpi varies even within platforms, e.g. X has one 75 and a 100 dpi font set. The latter is recommended for higher resolutions.

And also Windows has a "large fonts" options (see display options). Elderly people frequently have "large fonts" enabled.

Reply by email

Graeme Geldenhuys
to Ales Katona: I believe the size difference stems from the different DPI in font/widgetsets. The size…
Ales Katona wrote
I believe the size difference stems from the different DPI in font/widgetsets. The size parameter at least on gtk is calculated by division and DPI is featured, so it's possible that the default DPI differ on platforms?

That was my first thought to. I normally let X-Window server query the monitor to find the correct dpi value (eg: 119 dpi on my laptop, 110 on my desktop LCD). But since then, I have forced my X-Window server to 96 dpi, like Windows. The size difference is still there, which is what confuses me more. I have tried Google to find more information. All I got is that there is a size difference, but I can't find an explanation for why. :-(

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Lee Jenkins: Nice. Are these similar to mscorefonts? Fortunately, this particular application doesn't…
Lee Jenkins wrote
Nice. Are these similar to mscorefonts?

I believe they are the same.

Fortunately, this particular application doesn't necessarily allow the user to change fonts so if I can find a suitable font between both windows and linux, it

At the moment fpGUI defaults to Arial-10. Soon I will change that to Arial-8 for Windows and Arial-10 for Linux/FreeBSD. Xft under Linux will substitute an alternative font if Arial doesn't exist, but installing mscorefonts packages or copying Arial font into ~/.fonts/ directory fixes that.

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Marco van de Voort: The dpi varies even within platforms, e.g. X has one 75 and a 100 dpi font set. The…
Marco van de Voort wrote
And also Windows has a "large fonts" options (see display options). Elderly people frequently have "large fonts" enabled.

Or when you mistakenly bought a laptop with a 15.1" display with resolution of 1920x1600. At 96 dpi things are *very* small. :-) But changing Windows to 120 dpi cause many applications to be unusable, because they hard-coded co-ordinates and sizes to 96 dpi. A very frustrating experience! Nvida and ATI display control panels are big culprits!!

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Bogusław Brandys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 15 lines
Marco van de Voort wrote: > And also Windows has a "large fonts" options (see display options). Elderly > people frequently have "large fonts" enabled. Or when you mistakenly bought a laptop with a 15.1" display with resolution of 1920x1600. At 96 dpi things are *very* small. :-) But changing Windows to 120 dpi cause many applications to be unusable, because they hard-coded co-ordinates and sizes to 96 dpi. A very frustrating experience! Nvida and ATI display control panels are big culprits!! Regards, - Graeme -

Oh! So we should have also an advise how to code dialogs in Lazarus to be properly adjusted when DPI changed :-(
Comments, thoughts ?

Regards
Boguslaw

Reply by email

Graeme Geldenhuys
Don't forget that many new distros are trying to standardize dpi's (96,120) etc ... with gtk or qt2 (K3) you have to force dpi to 96 (best results), but with qt4 not.

It is very bad design which started with Microsoft to force all monitors to 96 dpi. X-Window servers are 100% correct in querying the monitor for the best dpi value. Native dpi values should also give the user a better visual experience. The GUI toolkits are supposed to handle the various dpi settings without developer intervention, but most don't, and simply rely on the hard-coded 96 dpi value. 10 out of 10 for Qt4, if they manage this correctly!

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Unknown author
to Graeme Geldenhuys

Quoting Graeme Geldenhuys :

Show quoted text 13 lines
wrote: > > Don't forget that many new distros are trying to standardize dpi's > (96,120) etc ... with gtk or qt2 (K3) you have to force dpi to 96 (best > results), but with qt4 not. It is very bad design which started with Microsoft to force all monitors to 96 dpi. X-Window servers are 100% correct in querying the monitor for the best dpi value. Native dpi values should also give the user a better visual experience. The GUI toolkits are supposed to handle the various dpi settings without developer intervention, but most don't, and simply rely on the hard-coded 96 dpi value. 10 out of 10 for Qt4, if they manage this correctly!

yes they are. Font expirience is excellent with qt4 compared with qt3 and especially compared with qt2. qt4 doesn't use xfs so there's big diff.Think that latest gtk2 also doesn't take care of xfs. My test projects with lcl-qt4 looks same on linux, win32 and mac.

Reply by email

Graeme Geldenhuys
to Bogusław Brandys: Oh! So we should have also an advise how to code dialogs in Lazarus to be properly…
Bogus?aw Brandys wrote
Oh! So we should have also an advise how to code dialogs in Lazarus to be properly adjusted when DPI changed :-( Comments, thoughts ?

I've already detected some recent dialog issue in Lazarus IDE. I had a look in SubVersion. The dialog was designed at 75 dpi (setting stored in .lfm file). Then somewhere along the line, the dpi setting was removed from the .lfm file and all the sizes (width, height etc) went nuts on my 96 dpi Linux. Many buttons are off the visible window aread, or dialogs are really wide. :-( As I mentioned, this is not specific to Lazarus, but to many toolkits out there...

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Unknown author: Quoting Graeme Geldenhuys : yes they are. Font expirience is excellent with qt4 compared…
yes they are. Font expirience is excellent with qt4 compared with qt3 and especially compared with qt2. qt4 doesn't use xfs so there's big

What is XFS (other than the cool file-system from Sun)? Did you mean Xft?

Regards,
- Graeme -

_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

Unknown author
to Graeme Geldenhuys

Quoting Graeme Geldenhuys :

Show quoted text 6 lines
wrote: > > yes they are. Font expirience is excellent with qt4 compared with qt3 > and especially compared with qt2. qt4 doesn't use xfs so there's big What is XFS (other than the cool file-system from Sun)? Did you mean Xft?

xfs is X Font Server (but there's also xfs filesystem;) )

Show quoted text 16 lines
Regards, - Graeme - _______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email