mcfonts.render.formatting¶
Bonus functions to compliment rendering.
These functions are not used anywhere in the built-in rendering system, but were prototyped for a more advanced, "formatting-aware" system. That system was axed in favor of a more plain layout system, and these functions remain.
Implementors and developers are welcome to use any of these items, and while they should function generally, thye have not been extensively tested or checked for accuracy. Some may need to be re-written.
Module Contents¶
-
bold(image: PIL.Image.Image, offset: int =
1) PIL.Image.Image¶ Bold-ify an image by placing a copy of it offset pixels to the right.
If necessary, canvas is extended.
- color_as_rgb_255(color: str) tuple[int, int, int]¶
Transform a 6-digit hex color string into a tuple of its RGB values, out of 255.
- color_int_as_rgb_255(color: int) tuple[int, int, int]¶
Transform a color as an integer into its components, out of 255.
-
italic(image: PIL.Image.Image, angle_rad: float =
radians(70)) tuple[PIL.Image.Image, int, int]¶ Italicize an image by shearing it.
-
line(image: PIL.Image.Image, color: tuple[int, int, int], y: int, thickness: int =
1) PIL.Image.Image¶ Draw a horizontal bar across the image.
-
shadow(image: PIL.Image.Image, color: int | None, offset: tuple[int, int], brightness_factor: float =
SHADOW_BRIGHTNESS_FACTOR) PIL.Image.Image¶ Create a shadow on an image.
-
DEFAULT_COLOR : Final[tuple[int, int, int]] =
(255, 255, 255)¶
-
SHADOW_BRIGHTNESS_FACTOR : Final[float] =
0.25¶
-
SHADOW_OPACITY : Final[int] =
63¶