All the logical fonts use multiple fonts, and they may not have the monospaced
property,
and almost inevitably using > 1 physical font means they aren't all monospaced.
For this range so far as I can tell Courier New - the primary font for
monospaced -
on XP has only a few of the elements. So you are getting most of them from a
CJK font
I think. I don't know about the Mac but its probably similar.
Also the square block char U2588 is defined in Courier New but it can't be
square
as it needs to be the same width as all the other chars!
If turning off AA isn't working then that's probably something Mac specific
(talk
to Apple) but I'm sure I've seen it work so it may be your bug.
-phil.
jav...@javadesktop.org wrote:
I'm working on a roguelike just for fun, using unicode chars. I want to use the
chars available on the block elements section, range is U+2596 to U+259F, to
build dungeon maps:
http://www.unicode.org/charts/PDF/U2580.pdf
I know that all characters in this range have the same size so i thought it
would be possible to create a 1point size font using the monospaced logical
font (i know it has the above unicode chars) and then use the deriveFont method
in the Font class with an AffineTransform to transform the font to the
desirable size in pixels (for example 16 pixels, squared).
The problems i have:
1) how to create the affine transform to obtain a font whose char bounds match
the pixel size?
2) characters have non zero descent, how to change the descent to become 0 and
put the origin of each character at the lower left corner?
3) it's weird but block characters from the monospaced font aren't squares,
they are slightly taller, how to determine this aspect ratio to fix it?
4) the glyph edges are being anti-aliasied even set rendering hints to no
anti-aliasing
What i have tried so far. The Toolkit class gives me screen resolution and dpi which in my MacBook is 112dpi and the screen size is 1280x800 (using an LCD). I assume Java points meens 1/72inch and used 1/112inch as the size of a pixel.
The problem is to make a 1pt height font to fit into a 16pixel area. I can do this scaling the font by 16*112/72.
This solves one problem but i still have problems with 2-4.
Any clues? Thanks in advance.
[Message sent by forum member 'institute' (institute)]
http://forums.java.net/jive/thread.jspa?messageID=336503
===========================================================================
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
lists...@java.sun.com and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
lists...@java.sun.com and include in the body of the message "help".