Display non-monospaced font as monospaced.
So, i am trying to render a font to the screen. I can render the font, but the spacing is weird, which is probably because it's not a monospaced font.
How can i display it as a monospaced font?
Current Screenshot (Left: mine, Right: how i want it to look):
Character rendering code:
def render_char(self, x, y, char):
if char[1] is not DisplayColors.TRANSPARENT:
font = self.font.render(char[0], False, char[1], char[2])
size = self.font.size(char[0])
offset = 0
# Failed attempt to fix the issue:
# if size[0] < 12:
# offset = 12 - size[0]
self.surface.blit(font, ((x - offset) * 12, y * size[1]))
The font used:
Posted Aug 29, 2016, 11:39 PM UTC
26