Skip to content

Commit

Permalink
Provide a protocol for Fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Dec 21, 2021
1 parent 7f189b3 commit 349d041
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions shared-bindings/fontio/BuiltinFont.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
#include "shared-bindings/util.h"
#include "supervisor/shared/translate.h"

//| from typing_extensions import Protocol
//|
//| class FontProtocol(Protocol):
//| """A protocol shared by `BuiltinFont` and classes in ``adafruit_bitmap_font``"""
//| def get_bounding_box(self) -> Union[Tuple[int, int], Tuple[int, int, int, int]]:
//| """Retrieve the maximum bounding box of any glyph in the font.
//|
//| The four element version is ``(width, height, x_offset, y_offset)``.
//| The two element version is ``(width, height)``, in which
//| ``x_offset`` and ``y_offset`` are assumed to be zero."""
//| pass
//|
//| @abstractmethod
//| def get_glyph(self, codepoint: int) -> Optional[Glyph]:
//| """Retrieve the Glyph for a given code point
//|
//| If the code point is not present in the font, `None` is returned."""
//| pass
//|

//| class BuiltinFont:
//| """A font built into CircuitPython"""
//|
Expand Down

0 comments on commit 349d041

Please sign in to comment.