@@ -58,13 +58,13 @@ def first_line_metrics(first_line, text, layout, resume_at, space_collapse,
58
58
59
59
class Layout :
60
60
"""Object holding PangoLayout-related cdata pointers."""
61
- def __init__ (self , context , font_size , style , justification_spacing = 0 ,
61
+ def __init__ (self , context , style , justification_spacing = 0 ,
62
62
max_width = None ):
63
63
self .justification_spacing = justification_spacing
64
- self .setup (context , font_size , style )
64
+ self .setup (context , style )
65
65
self .max_width = max_width
66
66
67
- def setup (self , context , font_size , style ):
67
+ def setup (self , context , style ):
68
68
self .context = context
69
69
self .style = style
70
70
self .first_line_direction = 0
@@ -94,7 +94,7 @@ def setup(self, context, font_size, style):
94
94
95
95
assert not isinstance (style ['font_family' ], str ), (
96
96
'font_family should be a list' )
97
- font_description = get_font_description (style , font_size )
97
+ font_description = get_font_description (style )
98
98
self .layout = ffi .gc (
99
99
pango .pango_layout_new (pango_context ),
100
100
gobject .g_object_unref )
@@ -203,8 +203,7 @@ def add_attr(start, end, spacing):
203
203
def set_tabs (self ):
204
204
if isinstance (self .style ['tab_size' ], int ):
205
205
layout = Layout (
206
- self .context , self .style ['font_size' ], self .style ,
207
- self .justification_spacing )
206
+ self .context , self .style , self .justification_spacing )
208
207
layout .set_text (' ' * self .style ['tab_size' ])
209
208
line , _ = layout .get_first_line ()
210
209
width , _ = line_size (line , self .style )
@@ -222,7 +221,7 @@ def deactivate(self):
222
221
del self .layout , self .language , self .style
223
222
224
223
def reactivate (self , style ):
225
- self .setup (self .context , style [ 'font_size' ], style )
224
+ self .setup (self .context , style )
226
225
self .set_text (self .text , justify = True )
227
226
228
227
@@ -236,8 +235,7 @@ def create_layout(text, style, context, max_width, justification_spacing):
236
235
or ``None`` for unlimited width.
237
236
238
237
"""
239
- layout = Layout (
240
- context , style ['font_size' ], style , justification_spacing , max_width )
238
+ layout = Layout (context , style , justification_spacing , max_width )
241
239
242
240
# Make sure that max_width * Pango.SCALE == max_width * 1024 fits in a
243
241
# signed integer. Treat bigger values same as None: unconstrained width.
0 commit comments