Added type hints to fontio

This commit is contained in:
dherrada 2020-07-03 10:08:25 -04:00
parent 783cc4de39
commit 48ea2271b7

View File

@ -46,7 +46,7 @@
//| ... //| ...
//| //|
//| bitmap: Any = ... //| bitmap: bitmap = ...
//| """Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use //| """Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use
//| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and //| `get_glyph` in most cases. This is useful for use with `displayio.TileGrid` and
//| `terminalio.Terminal`.""" //| `terminalio.Terminal`."""
@ -64,7 +64,7 @@ const mp_obj_property_t fontio_builtinfont_bitmap_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| def get_bounding_box(self) -> Any: //| def get_bounding_box(self) -> Tuple[int, int]:
//| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.""" //| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height."""
//| ... //| ...
//| //|
@ -76,7 +76,7 @@ STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) {
MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box); MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builtinfont_obj_get_bounding_box);
//| def get_glyph(self, codepoint: Any) -> Any: //| def get_glyph(self, codepoint: int) -> fontio.Glyph:
//| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available.""" //| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available."""
//| ... //| ...
//| //|