base fix for feature request 5483
svn: r19892
This commit is contained in:
parent
6527b43def
commit
d1bef05130
@ -1229,13 +1229,17 @@ class GtkDocText(GtkDocBaseElement):
|
|||||||
# line spacing is not defined in ParagraphStyle
|
# line spacing is not defined in ParagraphStyle
|
||||||
spacingfractionfont = 0.2
|
spacingfractionfont = 0.2
|
||||||
|
|
||||||
def __init__(self, style, vertical_alignment, text, x, y, angle=0):
|
def __init__(self, style, vertical_alignment, text, x, y,
|
||||||
|
angle=0, mark=None):
|
||||||
GtkDocBaseElement.__init__(self, style)
|
GtkDocBaseElement.__init__(self, style)
|
||||||
self._align_y = vertical_alignment
|
self._align_y = vertical_alignment
|
||||||
self._text = text
|
self._text = text
|
||||||
self._x = x
|
self._x = x
|
||||||
self._y = y
|
self._y = y
|
||||||
self._angle = angle
|
self._angle = angle
|
||||||
|
self._marklist = []
|
||||||
|
if mark:
|
||||||
|
self._marklist = [mark]
|
||||||
|
|
||||||
def draw(self, cr, layout, width, dpi_x, dpi_y):
|
def draw(self, cr, layout, width, dpi_x, dpi_y):
|
||||||
text_x = self._x * dpi_x / 2.54
|
text_x = self._x * dpi_x / 2.54
|
||||||
@ -1297,6 +1301,12 @@ class GtkDocText(GtkDocBaseElement):
|
|||||||
|
|
||||||
return layout_height
|
return layout_height
|
||||||
|
|
||||||
|
def get_marks(self):
|
||||||
|
"""
|
||||||
|
Return the index mark for this text
|
||||||
|
"""
|
||||||
|
return self._marklist
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# CairoDoc class
|
# CairoDoc class
|
||||||
@ -1557,7 +1567,7 @@ links (like ODF) and write PDF from that format.
|
|||||||
new_polygon = GtkDocPolygon(style, path)
|
new_polygon = GtkDocPolygon(style, path)
|
||||||
self._active_element.add_child(new_polygon)
|
self._active_element.add_child(new_polygon)
|
||||||
|
|
||||||
def draw_box(self, style_name, text, x, y, w, h):
|
def draw_box(self, style_name, text, x, y, w, h, mark=None):
|
||||||
# we handle the box and...
|
# we handle the box and...
|
||||||
style_sheet = self.get_style_sheet()
|
style_sheet = self.get_style_sheet()
|
||||||
style = style_sheet.get_draw_style(style_name)
|
style = style_sheet.get_draw_style(style_name)
|
||||||
@ -1580,10 +1590,10 @@ links (like ODF) and write PDF from that format.
|
|||||||
|
|
||||||
new_text = GtkDocText(paragraph_style, 'center',
|
new_text = GtkDocText(paragraph_style, 'center',
|
||||||
self.__markup(text),
|
self.__markup(text),
|
||||||
x + x_offset , y + h / 2, angle=0)
|
x + x_offset , y + h / 2, angle=0, mark=mark)
|
||||||
self._active_element.add_child(new_text)
|
self._active_element.add_child(new_text)
|
||||||
|
|
||||||
def draw_text(self, style_name, text, x, y):
|
def draw_text(self, style_name, text, x, y, mark=None):
|
||||||
style_sheet = self.get_style_sheet()
|
style_sheet = self.get_style_sheet()
|
||||||
style = style_sheet.get_draw_style(style_name)
|
style = style_sheet.get_draw_style(style_name)
|
||||||
paragraph_style_name = style.get_paragraph_style()
|
paragraph_style_name = style.get_paragraph_style()
|
||||||
@ -1591,10 +1601,10 @@ links (like ODF) and write PDF from that format.
|
|||||||
paragraph_style.set_alignment(PARA_ALIGN_LEFT)
|
paragraph_style.set_alignment(PARA_ALIGN_LEFT)
|
||||||
|
|
||||||
new_text = GtkDocText(paragraph_style, 'top',
|
new_text = GtkDocText(paragraph_style, 'top',
|
||||||
self.__markup(text), x, y, angle=0)
|
self.__markup(text), x, y, angle=0, mark=mark)
|
||||||
self._active_element.add_child(new_text)
|
self._active_element.add_child(new_text)
|
||||||
|
|
||||||
def center_text(self, style_name, text, x, y):
|
def center_text(self, style_name, text, x, y, mark=None):
|
||||||
style_sheet = self.get_style_sheet()
|
style_sheet = self.get_style_sheet()
|
||||||
style = style_sheet.get_draw_style(style_name)
|
style = style_sheet.get_draw_style(style_name)
|
||||||
paragraph_style_name = style.get_paragraph_style()
|
paragraph_style_name = style.get_paragraph_style()
|
||||||
@ -1602,10 +1612,10 @@ links (like ODF) and write PDF from that format.
|
|||||||
paragraph_style.set_alignment(PARA_ALIGN_CENTER)
|
paragraph_style.set_alignment(PARA_ALIGN_CENTER)
|
||||||
|
|
||||||
new_text = GtkDocText(paragraph_style, 'top',
|
new_text = GtkDocText(paragraph_style, 'top',
|
||||||
self.__markup(text), x, y, angle=0)
|
self.__markup(text), x, y, angle=0, mark=mark)
|
||||||
self._active_element.add_child(new_text)
|
self._active_element.add_child(new_text)
|
||||||
|
|
||||||
def rotate_text(self, style_name, text, x, y, angle):
|
def rotate_text(self, style_name, text, x, y, angle, mark=None):
|
||||||
style_sheet = self.get_style_sheet()
|
style_sheet = self.get_style_sheet()
|
||||||
style = style_sheet.get_draw_style(style_name)
|
style = style_sheet.get_draw_style(style_name)
|
||||||
paragraph_style_name = style.get_paragraph_style()
|
paragraph_style_name = style.get_paragraph_style()
|
||||||
@ -1613,7 +1623,7 @@ links (like ODF) and write PDF from that format.
|
|||||||
paragraph_style.set_alignment(PARA_ALIGN_CENTER)
|
paragraph_style.set_alignment(PARA_ALIGN_CENTER)
|
||||||
|
|
||||||
new_text = GtkDocText(paragraph_style, 'center',
|
new_text = GtkDocText(paragraph_style, 'center',
|
||||||
self.__markup([text]), x, y, angle)
|
self.__markup(text), x, y, angle, mark=mark)
|
||||||
self._active_element.add_child(new_text)
|
self._active_element.add_child(new_text)
|
||||||
|
|
||||||
# paginating and drawing interface
|
# paginating and drawing interface
|
||||||
|
Loading…
Reference in New Issue
Block a user