Fix incorrect widths of spaces between words.

This commit is contained in:
Andrey Golovizin 2014-09-15 22:26:08 +02:00
parent 1847bbcd9e
commit b7d6319ebf

View file

@ -242,7 +242,7 @@ class Line(PageObject):
if next_glyph is not None:
distance = glyph.optical_distance(next_glyph)
if distance >= min_distance:
space_after = Space(self, self.image.space(glyph.right, self.top, distance, self.height), self.baseline - self.top)
space_after = Space(self, self.image[:, glyph.right:next_glyph.left], self.baseline - self.top)
yield Word(self, current_word_glyphs, space_after)
current_word_glyphs = []
if current_word_glyphs: