本文整理汇总了Python中freetype.FT_LOAD_RENDER属性的典型用法代码示例。如果您正苦于以下问题:Python freetype.FT_LOAD_RENDER属性的具体用法?Python freetype.FT_LOAD_RENDER怎么用?Python freetype.FT_LOAD_RENDER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类freetype
的用法示例。
在下文中一共展示了freetype.FT_LOAD_RENDER属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _glyph_for_character
# 需要导入模块: import freetype [as 别名]
# 或者: from freetype import FT_LOAD_RENDER [as 别名]
def _glyph_for_character(self, char):
# Let FreeType load the glyph for the given character and tell it to
# render a monochromatic bitmap representation.
assert char != ''
self._face.load_char(char, freetype.FT_LOAD_RENDER |
freetype.FT_LOAD_TARGET_MONO)
return Glyph.from_glyphslot(self._face.glyph)
示例2: _glyph_for_character
# 需要导入模块: import freetype [as 别名]
# 或者: from freetype import FT_LOAD_RENDER [as 别名]
def _glyph_for_character(self, char):
# Let FreeType load the glyph for the given character and tell it to
# render a monochromatic bitmap representation.
self._face.load_char(char, freetype.FT_LOAD_RENDER |
freetype.FT_LOAD_TARGET_MONO)
return Glyph.from_glyphslot(self._face.glyph)
示例3: get_rendered_char_height
# 需要导入模块: import freetype [as 别名]
# 或者: from freetype import FT_LOAD_RENDER [as 别名]
def get_rendered_char_height(font_filename, font_size, char, target="mono"):
if target == "mono":
render_params = freetype.FT_LOAD_TARGET_MONO
elif target == "lcd":
render_params = freetype.FT_LOAD_TARGET_LCD
render_params |= freetype.FT_LOAD_RENDER
face = freetype.Face(font_filename)
face.set_char_size(font_size * 64)
face.load_char(char, render_params)
return face.glyph.bitmap.rows
示例4: glyph_for_character
# 需要导入模块: import freetype [as 别名]
# 或者: from freetype import FT_LOAD_RENDER [as 别名]
def glyph_for_character(self, char):
# Let FreeType load the glyph for the given character and tell it to render
# a monochromatic bitmap representation.
self.face.load_char(char, freetype.FT_LOAD_RENDER | freetype.FT_LOAD_TARGET_MONO)
return Glyph.from_glyphslot(self.face.glyph)