Skip to content

Commit a2a47d3

Browse files
Константин ТимошенкоКонстантин Тимошенко
authored andcommitted
chore: lint
chore: type
1 parent 2a32b56 commit a2a47d3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/ezdxf/addons/drawing/properties.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ class TextStyleProperties:
104104
def __init__(self, text_style: Optional[Textstyle] = None) -> None:
105105
self.name = "Standart"
106106
# width factor
107-
self.width = 1
107+
self.width = 1.0
108108
#oblique
109-
self.oblique = 0
109+
self.oblique = 0.0
110110
#height
111-
self.height = 1
111+
self.height = 1.0
112112
#resolved font face
113113
self.font: Optional[fonts.FontFace] = None
114114

@@ -893,11 +893,10 @@ def resolve_font(self, entity: DXFGraphic) -> Optional[fonts.FontFace]:
893893
style = entity.dxf.get("style", "Standard")
894894
return self.fonts.get(table_key(style))
895895

896-
def resolve_style(self, entity: DXFGraphic) -> Optional[dict]:
897-
"""Resolve the text style of `entity` to a font name.
898-
Returns ``None`` for the default font.
896+
def resolve_style(self, entity: DXFGraphic) -> Optional[TextStyleProperties]:
897+
"""Resolve the text style of `entity` to a TextStyleProperties.
898+
Returns ``None`` if not present.
899899
"""
900-
# todo: extended font data
901900
style = entity.dxf.get("style", "Standard")
902901
return self.text_styles.get(table_key(style))
903902

src/ezdxf/addons/drawing/text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from ezdxf.fonts.font_measurements import FontMeasurements
1919
from ezdxf.tools.text import plain_text, text_wrap
2020
from .text_renderer import TextRenderer
21+
from .properties import TextStyleProperties
2122

2223
"""
2324
Search google for 'typography' or 'font anatomy' for explanations of terms like
@@ -307,7 +308,7 @@ def simplified_text_chunks(
307308
render_engine: TextRenderer,
308309
*,
309310
font_face: fonts.FontFace,
310-
text_style: Optional[any] = None
311+
text_style: Optional[TextStyleProperties] = None
311312
) -> Iterable[tuple[str, Matrix44, float]]:
312313
"""Splits a complex text entity into simple chunks of text which can all be
313314
rendered the same way:

0 commit comments

Comments
 (0)