My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 75: drawString issue when writing on an image (microemu-android, Sony XPEDIA)
2 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by michael....@googlemail.com, Oct 18, 2010
What steps will reproduce the problem?

Font font = Font.getDefaultFont();
int height = font.getHeight();
int width = font.stringWidth("y");
Image im = Image.createImage(width, height);
Graphics g = im.getGraphics();
g.setColor(0x000000);
g.fillRect(0, 0, im.getWidth(), im.getHeight());
g.setColor(0xFFFFFF);
g.setFont(font);
g.drawString("y", 0, 0, Graphics.LEFT | Graphics.TOP);

What is the expected output? What do you see instead?

When you draw the letter 'y' it isn't drawn although the picture should be big enough. And even if it isn't - it should be clipped but you can't see 
anything.

The only device where I recognized the error was the 
Sony XPEDIA

I don't have that device on my own but I'm using microemu-android. He sent me a picture (it is attached) where you can see the problem.
If I increase the size of the picture the letter is drawn. (in the bottom part 'y's are supposed to be drawn - it works on when the image height is 2*height but not when it is only height)

The same happens with the letter 'o'. This time you have to increase the width to see the letter.

What version of the product are you using? On what operating system?
r2422 - linux

fontmetrics.jpg
71.2 KB   View   Download

Powered by Google Project Hosting