File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1818from ezdxf .fonts .font_measurements import FontMeasurements
1919from ezdxf .tools .text import plain_text , text_wrap
2020from .text_renderer import TextRenderer
21+ from .properties import TextStyleProperties
2122
2223"""
2324Search 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:
You can’t perform that action at this time.
0 commit comments