@@ -429,22 +429,22 @@ def findMarkers(self, reCompiled=None):
429429 def textOverflow (self , w , h , align = LEFT ):
430430 """Answers the overflowing of from the box (0, 0, w, h) as a new
431431 DrawBotString in the current context."""
432- b = self .context .b
433432 wpt , hpt = upt (w , h )
433+ box = (0 , 0 , wpt , hpt )
434434
435- # Sets the hyphenation flag from style, as in DrawBot this is set by a
435+ # Sets the hyphenation flag from style. In DrawBot this is set by a
436436 # global function, not as FormattedString attribute.
437- # TODO: Attributes don't seem to maintain in the string or overfill copy.
437+
438+ # TODO: Attributes don't seem to stay the same in the string or overfill copy.
438439 language = self .language or 'en'
439440 hyphenation = self .hyphenation or True
440- b .language (language )
441- b .hyphenation (hyphenation )
442- overflow = self .__class__ (b .textOverflow (self .s , ( 0 , 0 , wpt , hpt ) , align ), self .context )
441+ self . context . b .language (language )
442+ self . context . b .hyphenation (hyphenation )
443+ overflow = self .__class__ (self . context . b .textOverflow (self .s , box , align ), self .context )
443444
444445 # Pass on these parameters to the new constructed DrawBotString.
445446 overflow .language = language
446447 overflow .hyphenation = hyphenation
447- #print('OVERFLOW', overflow.language, overflow.hyphenation, overflow[:30])
448448 return overflow
449449
450450 def getBaselines (self , w , h = None ):
0 commit comments