On Mon, Feb 27, 2006 at 06:57:02PM +0100, Jeremias Maerki wrote: > I need a second pair of eyes (or more) for a change I've done in > Font-java. > > I think there are a number of bugs in the getCharWidth() method: > - The widths for special spaces were never returned as getWidth() > automatically replaced them with "#". > - The value for "em" was taken from the width of the small "m". > WikiPedia says to use the width of the big "M", or rather, today, the > size of the font in use (like in the XSL-FO spec). > - A similar problem with "en". It is defined by WikiPedia as em/2. > - I changed the widths of 200A and 200B to better match the description > in http://www.unicode.org/charts/PDF/U2000.pdf. I actually used half the > width of a thin space for hair space and set the width of the zwsp to > zero which surprisingly it wasn't.
Donald Knuth in The TeX Book, page 60, says this: em is the width of a "quad" in the current font. Each font defines its own em and ex values. In olden days an "em" was the width of an `M', but this is no longer true; ems are simply arbitrary units that come with a font, and so are exes. Indeed, Knuth's Computer Modern fonts contain a quantity called quad width. For en space he uses .5 em. Regards, Simon -- Simon Pepping home page: http://www.leverkruid.nl