Java Question (Drawing Strings)

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
ajtgarber
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 97
Joined: Wed Jun 10, 2009 8:56 am

Java Question (Drawing Strings)

Post by ajtgarber »

Why does Java draw the String at some weird offset every time I try to draw a string through Graphics.drawString? How can I get around it?
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

Re: Java Question (Drawing Strings)

Post by Live-Dimension »

Define 'some weird offset'? Are you taking into effect the font's spacing and such?
Image
ajtgarber
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 97
Joined: Wed Jun 10, 2009 8:56 am

Re: Java Question (Drawing Strings)

Post by ajtgarber »

Sorry, not to sound stupid or anything, but how would the fonts spacing effect where the text is placed?
Live-Dimension
Chaos Rift Junior
Chaos Rift Junior
Posts: 345
Joined: Tue Jan 12, 2010 7:23 pm
Favorite Gaming Platforms: PC - Windows 7
Programming Language of Choice: c++;haxe
Contact:

Re: Java Question (Drawing Strings)

Post by Live-Dimension »

Well, it might not, but you haven't said how big the offset is. A few pixels out could definitely do with font spacing, size, etc. 50000 pixels generally isn't anything to do with the font, but more of a programming error :P
Image
Post Reply