diff options
| author | dherrada <dylan.herrada@gmail.com> | 2020-05-07 11:56:46 -0400 |
|---|---|---|
| committer | dherrada <dylan.herrada@gmail.com> | 2020-05-07 11:56:46 -0400 |
| commit | a3d5adb43c897d591baabaaf1e7ef83deedbd3ce (patch) | |
| tree | c0e05dc021779832eb0b498c2a096c2dc3b212c1 /shared-bindings/fontio | |
| parent | 2ebe3035dff0ce66b2fe65eb91d6889c4ba93b5c (diff) | |
Did _eve, fontio, framebufferio, and frequencyio
Diffstat (limited to 'shared-bindings/fontio')
| -rw-r--r-- | shared-bindings/fontio/BuiltinFont.c | 38 | ||||
| -rw-r--r-- | shared-bindings/fontio/Glyph.c | 29 | ||||
| -rw-r--r-- | shared-bindings/fontio/__init__.c | 4 |
3 files changed, 36 insertions, 35 deletions
diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index 74bc4d29e..f60c9e36c 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -36,25 +36,25 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" -//| .. currentmodule:: fontio +//| class BuiltinFont: +//| """.. currentmodule:: fontio //| -//| :class:`BuiltinFont` -- A font built into CircuitPython -//| ========================================================================================= +//| :class:`BuiltinFont` -- A font built into CircuitPython +//| ========================================================================================= //| -//| A font built into CircuitPython. +//| A font built into CircuitPython.""" //| -//| .. class:: BuiltinFont() -//| -//| Creation not supported. Available fonts are defined when CircuitPython is built. See the -//| `Adafruit_CircuitPython_Bitmap_Font <https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font>`_ -//| library for dynamically loaded fonts. +//| def __init__(self, ): +//| """Creation not supported. Available fonts are defined when CircuitPython is built. See the +//| `Adafruit_CircuitPython_Bitmap_Font <https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font>`_ +//| library for dynamically loaded fonts.""" +//| ... //| -//| .. attribute:: bitmap -//| -//| Bitmap containing all font glyphs starting with ASCII and followed by unicode. Use +//| bitmap: Any = ... +//| """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 -//| `terminalio.Terminal`. +//| `terminalio.Terminal`.""" //| STATIC mp_obj_t fontio_builtinfont_obj_get_bitmap(mp_obj_t self_in) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); @@ -69,9 +69,9 @@ const mp_obj_property_t fontio_builtinfont_bitmap_obj = { (mp_obj_t)&mp_const_none_obj}, }; -//| .. method:: get_bounding_box() -//| -//| Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height. +//| def get_bounding_box(self, ) -> Any: +//| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.""" +//| ... //| STATIC mp_obj_t fontio_builtinfont_obj_get_bounding_box(mp_obj_t self_in) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); @@ -81,9 +81,9 @@ 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); -//| .. method:: get_glyph(codepoint) -//| -//| Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available. +//| def get_glyph(self, codepoint: Any) -> Any: +//| """Returns a `fontio.Glyph` for the given codepoint or None if no glyph is available.""" +//| ... //| STATIC mp_obj_t fontio_builtinfont_obj_get_glyph(mp_obj_t self_in, mp_obj_t codepoint_obj) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/fontio/Glyph.c b/shared-bindings/fontio/Glyph.c index a23284152..6235dbc46 100644 --- a/shared-bindings/fontio/Glyph.c +++ b/shared-bindings/fontio/Glyph.c @@ -28,23 +28,24 @@ #include <stdint.h> -//| .. currentmodule:: fontio +//| class Glyph: +//| """.. currentmodule:: fontio //| -//| :class:`Glyph` -- Storage of glyph info -//| ========================================================================== +//| :class:`Glyph` -- Storage of glyph info +//| ==========================================================================""" //| -//| .. class:: Glyph(bitmap, tile_index, width, height, dx, dy, shift_x, shift_y) +//| def __init__(self, bitmap: displayio.Bitmap, tile_index: int, width: int, height: int, dx: int, dy: int, shift_x: int, shift_y: int): +//| """Named tuple used to capture a single glyph and its attributes. //| -//| Named tuple used to capture a single glyph and its attributes. -//| -//| :param displayio.Bitmap bitmap: the bitmap including the glyph -//| :param int tile_index: the tile index within the bitmap -//| :param int width: the width of the glyph's bitmap -//| :param int height: the height of the glyph's bitmap -//| :param int dx: x adjustment to the bitmap's position -//| :param int dy: y adjustment to the bitmap's position -//| :param int shift_x: the x difference to the next glyph -//| :param int shift_y: the y difference to the next glyph +//| :param displayio.Bitmap bitmap: the bitmap including the glyph +//| :param int tile_index: the tile index within the bitmap +//| :param int width: the width of the glyph's bitmap +//| :param int height: the height of the glyph's bitmap +//| :param int dx: x adjustment to the bitmap's position +//| :param int dy: y adjustment to the bitmap's position +//| :param int shift_x: the x difference to the next glyph +//| :param int shift_y: the y difference to the next glyph""" +//| ... //| const mp_obj_namedtuple_type_t fontio_glyph_type = { .base = { diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index cd0f5ab0f..478fc1806 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -33,7 +33,7 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/fontio/Glyph.h" -//| :mod:`fontio` --- Core font related data structures +//| """:mod:`fontio` --- Core font related data structures //| ========================================================================= //| //| .. module:: fontio @@ -48,7 +48,7 @@ //| :maxdepth: 3 //| //| BuiltinFont -//| Glyph +//| Glyph""" //| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { |
