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".