🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7849

Re: Monospaced and Higher Unicode Characters

#7849
From: John McGrath TeamB
Date: Fri, 01 Dec 2000 00:00
23 lines
1238 bytes
On Thu, 30 Nov 2000 14:30:25 -0600, James A. Schulz wrote:

> In a jTextField with its font set to "Monospaced" the
> width of '\u2228' is greater than an 'M'.  Is there
> anyway I can fix this?

Install a font that meets your expectations?  :o)

You seem to be assuming that the "M" must be the widest character in a 
font, and there is no guarantee of that.

The FontMetrics class has a getMaxAdvance() method that will tell you 
the maximum advance (width) of all characters in the font.  But note 
that the information is not guaranteed to be available. 

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.14912621d190d0f989d82@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <906d8v$cq63@bornews.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,e7b0355fee419750
X-Google-Attributes: gid111d45,public
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Subject: Re: Monospaced and Higher Unicode Characters
Date: 2000/12/01
Message-ID: <MPG.14912621d190d0f989d82@forums.borland.com>
X-Deja-AN: 699880144
References: <906d8v$cq63@bornews.inprise.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing