Reputation: 8588
I am writing a gui PC program with java and I am using Java Swing, the question is, for a given Font, with a given size and style, on a given String, i compute the bounding box (in pixels) on some machine, is there a possibility that on some other machine, for the exact same Font and exact same String, the computed bounding box will turn out different?
if it is possible( which seems to be the case according to the results I get on my program ), then how can i define a font where for a given string, in every possible machine, it will return the exact same bounding box?
Upvotes: 1
Views: 828
Reputation: 3230
You can't, because the rendering depends on several factors:
Upvotes: 2
Reputation: 109823
this is the intersection, setting :
Native OS,
accesible, instaled Font (Native OS uses different Fonts, size, bold ....)
Font (its properties) used for theme
various users setting, customs themes
idiotics custom application that can change global properties in Native OS, not applications setting
LookAndFeel
L&F uses own Font, are different
by default the same options as for Native OS
i**** custom application that can change global properties in Native OS.....
very different and too hard job is to change Font based on screen ration (in pixels),
any changes are about to iterating in UIManager and to change every key for FontUIResources
Upvotes: 1