Padding in paragraphs.

svn: r2974
This commit is contained in:
Alex Roitman 2004-03-06 02:29:20 +00:00
parent fd210a00cc
commit 2389e64bae
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,7 @@
2004-03-04 Alex Roitman <shura@alex.neuro.umn.edu>
* src/docgen/LPRDoc.py: Support for paragraph's margins and
the first indent properties. Font-specific line spacing.
Padding in paragraphs.
2004-03-04 Alex Roitman <shura@alex.neuro.umn.edu>
* src/docgen/LPRDoc.py: New paragraph formatting algorithm.

View File

@ -322,7 +322,8 @@ class GnomePrintParagraph:
end_word = len(textlist)
self.lines.append((start_piece,start_word,end_piece,end_word,avail_width))
self.height = nlines * self.fontstyle.get_size()
self.height = nlines * self.fontstyle.get_size() \
+ 2 * cm2u(self.style.get_padding())
def get_lines(self):
"""
@ -437,7 +438,7 @@ class LPRDoc(BaseDoc.BaseDoc):
self.__x, self.__y = self.write_paragraph(self.paragraph,
self.__x, self.__y,
self.right_margin - self.left_margin)
self.__y = self.__advance_line(self.__y)
#self.__y = self.__advance_line(self.__y)
self.paragraph = None
def start_bold(self):
@ -693,6 +694,9 @@ class LPRDoc(BaseDoc.BaseDoc):
x = left_margin
y = self.__y
if y != self.top_margin:
y = y - cm2u(paragraph.style.get_padding())
# Loop over lines which were assembled by paragraph.format()
for (start_piece,start_word,end_piece,end_word,avail_width) \
in paragraph.get_lines():
@ -761,6 +765,7 @@ class LPRDoc(BaseDoc.BaseDoc):
x = left_margin
x = x - cm2u(paragraph.style.get_left_margin())
y = y - cm2u(paragraph.style.get_padding())
return (x,y)
def __output_table(self):