This commit is contained in:
Kovid Goyal 2024-11-07 20:27:55 +05:30
parent 5d6911a503
commit 09888e4bc3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -196,7 +196,7 @@ class Text(Element):
) )
def set_av_char_width(self): def set_av_char_width(self):
self.average_character_width = max(self.width/len(self.text_as_string),0.1) # Ensure never zero self.average_character_width = max(0.1, self.width/max(1, len(self.text_as_string))) # Ensure never zero
def coalesce(self, other, page_number, left_margin, right_margin): def coalesce(self, other, page_number, left_margin, right_margin):
if self.opts.verbose > 2: if self.opts.verbose > 2: