From 36623f13d922461c897fe0ae1ff550a073385329 Mon Sep 17 00:00:00 2001 From: Roozbeh Pournader Date: Tue, 13 Jan 2015 08:50:27 -0800 Subject: Add FreeType python bindings to third_party. --- third_party/freetype-py/examples/font-info.py | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 third_party/freetype-py/examples/font-info.py (limited to 'third_party/freetype-py/examples/font-info.py') diff --git a/third_party/freetype-py/examples/font-info.py b/third_party/freetype-py/examples/font-info.py new file mode 100644 index 0000000..015ee94 --- /dev/null +++ b/third_party/freetype-py/examples/font-info.py @@ -0,0 +1,42 @@ +# ----------------------------------------------------------------------------- +# +# FreeType high-level python API - Copyright 2011 Nicolas P. Rougier +# Distributed under the terms of the new BSD license. +# +# ----------------------------------------------------------------------------- +from freetype import * + +if __name__ == '__main__': + import sys + + if len(sys.argv) < 2: + print("Usage: %s font_filename" % sys.argv[0]) + sys.exit() + + face = Face(sys.argv[1]) + + print 'Family name: ', face.family_name + print 'Style name: ', face.style_name + print 'Charmaps: ', [charmap.encoding_name for charmap in face.charmaps] + print + print 'Face number: ', face.num_faces + print 'Glyph number: ', face.num_glyphs + print 'Available sizes: ', face.available_sizes + print + print 'units per em: ', face.units_per_EM + print 'ascender: ', face.ascender + print 'descender: ', face.descender + print 'height: ', face.height + print + print 'max_advance_width: ', face.max_advance_width + print 'max_advance_height: ', face.max_advance_height + print + print 'underline_position: ', face.underline_position + print 'underline_thickness:', face.underline_thickness + print + print 'Has horizontal: ', face.has_horizontal + print 'Has vertical: ', face.has_vertical + print 'Has kerning: ', face.has_kerning + print 'Is fixed width: ', face.is_fixed_width + print 'Is scalable: ', face.is_scalable + print -- cgit v1.2.3