From 20406b943c53c982f69bf10c93871c9d3138e61b Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Sat, 6 Mar 2004 02:29:20 +0000 Subject: [PATCH] Padding in paragraphs. svn: r2974 --- gramps2/ChangeLog | 1 + gramps2/src/docgen/LPRDoc.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 958f44e32..edce4ce9b 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,7 @@ 2004-03-04 Alex Roitman * 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 * src/docgen/LPRDoc.py: New paragraph formatting algorithm. diff --git a/gramps2/src/docgen/LPRDoc.py b/gramps2/src/docgen/LPRDoc.py index 2023a24ec..10810d86d 100644 --- a/gramps2/src/docgen/LPRDoc.py +++ b/gramps2/src/docgen/LPRDoc.py @@ -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):