MCPcopy Index your code
hub / github.com/Layout-Parser/layout-parser / _create_font_object

Function _create_font_object

src/layoutparser/visualization.py:93–100  ·  view source on GitHub ↗
(font_size=None, font_path=None)

Source from the content-addressed store, hash-verified

91
92
93def _create_font_object(font_size=None, font_path=None):
94
95 if font_size is None and font_path is None:
96 return DEFAULT_FONT_OBJECT
97 else:
98 return ImageFont.truetype(
99 font_path or DEFAULT_FONT_PATH, font_size or DEFAULT_FONT_SIZE
100 )
101
102
103def _create_new_canvas(canvas, arrangement, text_background_color):

Callers 2

draw_boxFunction · 0.85
draw_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected