Exemplo n.º 1
0
 def set_underline(self, underline):
     """Font.set_underline(bool): return None
        control if text is rendered with an underline"""
     style = sdl.TTF_GetFontStyle(self._sdl_font)
     if underline:
         style = style | sdl.TTF_STYLE_UNDERLINE
     elif style & sdl.TTF_STYLE_UNDERLINE:
         style = style ^ sdl.TTF_STYLE_UNDERLINE
     sdl.TTF_SetFontStyle(self._sdl_font, style)
Exemplo n.º 2
0
 def set_italic(self, italic):
     """Font.set_italic(bool): return None
        enable fake rendering of italic text"""
     style = sdl.TTF_GetFontStyle(self._sdl_font)
     if italic:
         style = style | sdl.TTF_STYLE_ITALIC
     elif style & sdl.TTF_STYLE_ITALIC:
         style = style ^ sdl.TTF_STYLE_ITALIC
     sdl.TTF_SetFontStyle(self._sdl_font, style)
Exemplo n.º 3
0
 def set_bold(self, bold):
     """Font.set_bold(bool): return None
        enable fake rendering of bold text"""
     style = sdl.TTF_GetFontStyle(self._sdl_font)
     if bold:
         style = style | sdl.TTF_STYLE_BOLD
     elif style & sdl.TTF_STYLE_BOLD:
         style = style ^ sdl.TTF_STYLE_BOLD
     sdl.TTF_SetFontStyle(self._sdl_font, style)