• Post Reply Bookmark Topic Watch Topic
  • New Topic

Puzzle in getting OS's FONT_SIZE  RSS feed

 
yu yong
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear everyone.
I have a question in my project.
How can I get all the FONT_SIZE in current OS (OS, Linux etc.)
Thank you very much.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no single one font size used by an OS. Each application has their won defaults (sometimes inherited from OS defaults), and of course users are free to set font sizes to whatever they wish to. Can you tell us in more detail what you're trying to do?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> How can I get all the FONT_SIZE in current OS

iterate the UIManager, checking instanceof Font
 
yu yong
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Ulf:
Thank you for your reply.
The detail is :

There is a Ccombo in my Composite(SWT). And the Ccombo must show the System Font_SIZE list. For example '12px', '10px' etc. in WinXP. So How to get this list is my current question.

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no single list of system-wide font sizes. Sometimes fonts are available in a few discrete sizes only (bitmapped fonts), but they're rare these days. Most fonts are PostScript, TrueType or OpenType fonts, all of which can be scaled to any desired size.

So unless you know that -for whichever font you need to display the sizes- only some sizes are available, you can happily display a long list of all the font sizes you want to support, and let the font renderer worry about displaying them.
 
yu yong
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Ulf:
Thank you 4 your explanation. This question is clear.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!