• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Puzzle in getting OS's FONT_SIZE

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic