Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Java claims WORA Date: Sun, 24 Jun 2012 23:27:58 -0700 Organization: albasani.net Lines: 58 Message-ID: References: <8bc88bdc-bd63-4dd2-ba6c-cb0a7622fa1f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net TFjXiG1At7QjFeYl1AZlkygqcIqL8RDX9EQ2FYyUsLIM6udQNRODoSw1Aw8hlGvPmnUEM87FGVJAUJm4pocwkLh879UDB8pyoYKaR0Ua3Ot7FNIY5OEw9/s9VZPDRlKh NNTP-Posting-Date: Mon, 25 Jun 2012 06:27:35 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="6waeMF2R+oiyGbVnms1KprLf+r7ZspTt8L6k7kb4W5b8dpJqEhCuqV5TxDs0LxE5VH4arbd7ogSUhGsH25AOv+MMCPgYlAlHA0JDUrIHD3YuM0a65paYS7/unrdzQ+fZ"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 In-Reply-To: Cancel-Lock: sha1:ZZrgR4bL3Yv9dO8c0EAKBqk3rQ4= Xref: csiph.com comp.lang.java.programmer:15574 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. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg