Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #15605
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Java claims WORA |
| Date | 2012-06-26 15:43 -0400 |
| Organization | The Wasteland |
| Message-ID | <nospam-BD1A62.15434326062012@news.aioe.org> (permalink) |
| References | (1 earlier) <js29dm$1fo$1@news.belwue.de> <nospam-F6171E.15594322062012@news.aioe.org> <u5vdu75uinlmblggdlue7vlbjq64flga8a@4ax.com> <nospam-2E53F0.18515424062012@news.aioe.org> <js90cn$m5o$1@news.albasani.net> |
In article <js90cn$m5o$1@news.albasani.net>, Lew <noone@lewscanon.com> wrote: > John B. Matthews wrote: > > Roedy Green wrote: > >> John B. Matthews wrote, quoted or indirectly quoted someone who said : > >>> I'll second the need for testing, but I've found that using > >>> layouts properly and respecting a component's preferred size > >>> greatly reduces the number of cross-platform problems. There's a > >>> recent example here: > >> > >> one of the big problems is when you substitute a font, the > >> characters are not the same size. I would like to normalize fonts > >> to their true size so that when you substitute fonts, the actual > >> real estate consumed varies only a little. > > > > I must demur: a typical JComponent, such as JLabel, goes to > > considerable lengths to calculate its preferred size using the > > metrics of the selected Font. As long as you > > > > - don't veto the calculation, > > - don't preclude resizing, > > - do use a LayoutManager, and > > - do pack() the enclosing Container > > > > the chosen Font is irrelevant. If the Font must be changed dynamically, > > revalidate() and repaint() should suffice. > > > >> Another would be a guaranteed to render all glyphs, even if it > >> means substituting from some other font. Failing that at telling > >> the truth. Java claims to render a glyph when all it does in > >> render some generic glyph. > > > > Font substitution shouldn't cause a problem. Missing glyphs and > > mendacious canDisplay() are annoying, but the metrics are typically > > reliable. > > Depends on what problem you care about, and what constitutes relevance. > > You might not be happy with a screen that doubles its width to > accommodate a font, for design reasons. > > Sure, Swing handles the technical details of resizing, and layouts do > wonders to work around variances in fonts and so forth, but that's > all technical problems and solutions and relevance. > > Design problems and solutions and relevance revolve around what looks > right and works for the program's purpose, i.e., the user's purpose. > Roedy's wish for fonts that squish instead of windows that widen is > not uncommon nor unreasonable, from a design perspective. You might > prefer the data entry box not get smaller to make room for a longer > prompt. > > So technical dimension, no problem, design dimension, eh, depends on > the design and what changes it can withstand. This is a valuable distinction. The physical font selected for a given family may not _double_ the width, but localization might come close. As a practical matter, I sometimes relegate the full text to a tool tip, leaving a digest in the label. Size variants can be handy, too: <http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/size.html> -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Java claims WORA owais <awais4you@gmail.com> - 2012-06-20 08:33 -0700
Re: Java claims WORA Robert Klemme <shortcutter@googlemail.com> - 2012-06-20 09:21 -0700
Re: Java claims WORA Gene Wirchenko <genew@ocis.net> - 2012-06-20 09:46 -0700
Re: Java claims WORA Lew <lewbloch@gmail.com> - 2012-06-20 10:47 -0700
Re: Java claims WORA "Mike Schilling" <mscottschilling@hotmail.com> - 2012-06-24 16:56 -0700
Re: Java claims WORA Arne Vajhøj <arne@vajhoej.dk> - 2012-06-20 17:02 -0400
Re: Java claims WORA glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-06-20 21:45 +0000
Re: Java claims WORA Martin Gregorie <martin@address-in-sig.invalid> - 2012-06-20 22:25 +0000
Re: Java claims WORA Robert Klemme <shortcutter@googlemail.com> - 2012-06-21 00:57 +0200
Re: Java claims WORA Roedy Green <see_website@mindprod.com.invalid> - 2012-06-20 16:46 -0700
Re: Java claims WORA David Lamb <dalamb@cs.queensu.ca> - 2012-06-20 19:56 -0400
Re: Java claims WORA Arne Vajhøj <arne@vajhoej.dk> - 2012-06-20 19:16 -0400
Re: Java claims WORA "Mike Schilling" <mscottschilling@hotmail.com> - 2012-06-24 16:58 -0700
Re: Java claims WORA Roedy Green <see_website@mindprod.com.invalid> - 2012-06-20 16:43 -0700
Re: Java claims WORA Arne Vajhøj <arne@vajhoej.dk> - 2012-06-20 20:30 -0400
Re: Java claims WORA Roedy Green <see_website@mindprod.com.invalid> - 2012-06-20 18:37 -0700
Re: Java claims WORA Arne Vajhøj <arne@vajhoej.dk> - 2012-06-20 21:47 -0400
Re: Java claims WORA Thomas Richter <thor@math.tu-berlin.de> - 2012-06-22 19:18 +0200
Re: Java claims WORA "John B. Matthews" <nospam@nospam.invalid> - 2012-06-22 15:59 -0400
Re: Java claims WORA Roedy Green <see_website@mindprod.com.invalid> - 2012-06-24 04:43 -0700
Re: Java claims WORA "John B. Matthews" <nospam@nospam.invalid> - 2012-06-24 18:51 -0400
Re: Java claims WORA Lew <noone@lewscanon.com> - 2012-06-24 23:27 -0700
Re: Java claims WORA "John B. Matthews" <nospam@nospam.invalid> - 2012-06-26 15:43 -0400
Re: Java claims WORA Jim Janney <jjanney@shell.xmission.com> - 2012-06-22 18:23 -0600
Re: Java claims WORA Jan Burse <janburse@fastmail.fm> - 2012-06-22 21:40 +0200
Re: Java claims WORA David Lamb <dalamb@cs.queensu.ca> - 2012-06-25 09:57 -0400
Re: Java claims WORA Jan Burse <janburse@fastmail.fm> - 2012-06-25 20:34 +0200
Re: Java claims WORA Jan Burse <janburse@fastmail.fm> - 2012-06-25 20:44 +0200
csiph-web