SFML community forums
Help => Graphics => Topic started by: AClockWorkLemon on December 08, 2011, 01:13:43 pm
-
Heya, was wondering if you guys could help.
Project i'm working on has need of fonts, however most text rendered seems to be coming out a little.. 'blobby'. Not sure really how to put it, so here's a picture:
(http://i42.tinypic.com/w7dlq1.png)
The font is Gotham-book
This is the "Text" class i'm using to handle fonts etc:
class Drawable(object):
def render(self, win, offset=Point(), camera=Point()):
self.SetPosition(self.x+offset.x-camera.x, self.y+offset.y-camera.y)
win.Draw(self)
class Text(sf.String, Drawable):
def __init__(self, text, font, size):
self.font = GetFont(font, size)
sf.String.__init__(self, text, self.font, size)
self.x = 0
self.y = 0
fontCache = {}
def GetFont(loc, size):
try:
fnt = fontCache[loc]
old_size = fnt.GetCharacterSize()
if size < old_size:
return fnt
except KeyError: pass
Font = sf.Font()
if not Font.LoadFromFile(loc, size):
return None
fontCache[loc] = Font
return Font
If you need more, please feel free to ask ^_^
thanks in advance :)
-
http://www.sfml-dev.org/forum/viewtopic.php?p=36367#36367
-
http://www.sfml-dev.org/forum/viewtopic.php?p=36367#36367
My apologies.
I think i've got it sorted now, i was unaware that loading a font at a larger size than was needed would have adverse effects on quality. If that does not fix it, i'll make sure to provide a proper example that reproduces it properly :)
Sorry again, ACWL