Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4936
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jeff Higgins <jeff@invalid.invalid> |
| Newsgroups | comp.lang.java.gui |
| Subject | Re: Determining font letter center |
| Date | Fri, 13 Jan 2012 13:49:09 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 18 |
| Message-ID | <jepttd$3k9$1@dont-email.me> (permalink) |
| References | <9ab7338e-e8e1-4e12-8d8e-43e6469d8215@s6g2000pbi.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Fri, 13 Jan 2012 18:41:50 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="qwFw1g9RsQ6TkML5yezG9A"; logging-data="3721"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1NH8F4pZarb8KYyQG1IG45aowbGqWwaA=" |
| User-Agent | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111110 Icedove/3.0.11 |
| In-Reply-To | <9ab7338e-e8e1-4e12-8d8e-43e6469d8215@s6g2000pbi.googlegroups.com> |
| Cancel-Lock | sha1:178YncUc4rlHm4pJFgRImHsm8mg= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4936 |
Show key headers only | View raw
On 01/13/2012 01:32 PM, Fred wrote: > How can I find out how high a letter is when using a particular font? > I am trying to place the center of capital letters at a specific > location. > > The javadoc for FontMetrics says that getAscent() returns the distance > from the font's baseline to the top of most alphanumeric characters, > but that doesn't seem to be true. > > For example, Font( "Serif", 1, 32 ) (serif font, bold, 32-points, its > FontMetric getAscent returns 33, but the height of every capital > letter is 21 pixels. > > I have also tried to use the strikethroughOffset, but that is not in > the center of capital letters either. > This may help. <http://explodingpixels.wordpress.com/2009/01/29/drawing-text-about-its-visual-center/>
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Determining font letter center Fred <fred.l.kleinschmidt@gmail.com> - 2012-01-13 10:32 -0800
Re: Determining font letter center Jeff Higgins <jeff@invalid.invalid> - 2012-01-13 13:49 -0500
Re: Determining font letter center Fred <fred.l.kleinschmidt@gmail.com> - 2012-01-13 11:58 -0800
Re: Determining font letter center Roedy Green <see_website@mindprod.com.invalid> - 2012-01-14 01:28 -0800
csiph-web