Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / font differences between Gosu::Image::from_text & Gosu::Font
- By simonj Date 2009-09-06 08:09
I'm trying to keep a consist font across a wide range of interfaces for a game, issue being that I'm not able to get the font to be the same given the tools

option A
@normal_font  = Gosu::Font.new(window, "Verdana", 12)
@normal_font.draw("Some text",50,50,0,1,1,0xffffffff)

option B

@img=Gosu::Image::from_text(window,"Some text", @normal_font,12,1,50,:center)
@img.draw(50,70, 0, 1, 1, 0xffffffff, :default)

the output text is different, option B is always smaller and gives the same font but smaller and cleaner, its quite interesting but starts to detract from the things I;m doing and the layout is loosing form from this difference. Fonts are correctly found. Windows box.

Any help on what I can do as I need to use both options in the code

     
- By jlnr (dev) Date 2009-09-06 10:15
The letters shouldn't be smaller. If this is really the case, I will consider this a bug, but I can only fix it when I get to work on the whole text system again in a future version.

That both methods look a bit different is normal though. Image#from_text can do all the one-time layouting work that Font#draw cannot do all the time, so things like font kerning or ligatures will slightly change the appearance of the font.
- By simonj Date 2009-09-06 10:26
ok, understood re kerning but it does seem considerably different, set the font size to 150 and you notice a huge difference - looks like its a glitch but workable for now, thanks,
Up Topic Gosu / Gosu Exchange / font differences between Gosu::Image::from_text & Gosu::Font

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill