def __init__(self, parent, wrapper = None, hyphenator = None, translator = None, x_align = 'left'): BuildingBlock.__init__(self, parent) self.wrapper_cfg = wrapper self.hyphenator_cfg = hyphenator self.translator_cfg = translator self.x_align = x_align self.render_count = 0
def __init__(self, text, width, number, parent, align = 'left', last_in_para = False, refs = None, targets = None, pager = None): BuildingBlock.__init__(self, parent, add_to_parent = False) # parent is the frame the line belongs to. self.raw_text = text # text may contain unresolved ref markers. Hence we call it raw text for now. self.width = width self.number = number # counter for lines within a frame. Used to get the y pos. self.align = align self.refs = refs # list of references. self.targets = targets # list of targets self.text = '' # to store the text after resolving the refs self.pager = pager self.last_in_para = last_in_para # avoid block alignment of last line in paragraph
def __init__(self, parent, x_anchor = None, x_hook = '', x_align = '', x_offset = 0, right_indent = 0, y_anchor = None, y_hook = '', y_align = '', y_offset = 0, lines_below = 0, max_width = 0, width_mode = 'auto', max_height = 0, height_mode = 'auto', new_page_after = False): BuildingBlock.__init__(self, parent) # initialization self.lines = 0 # horizontal position self.x_anchor = x_anchor # the frame whose x position will be used x_anchor.x_dep.append(self) self.x_hook = x_hook # the anchor frame's part to draw on (left, right, center) self.x_align = x_align # the part of self to align with the hook (left, right, center) self.x_offset = x_offset # absolute offset relative to the hook etc. self.right_indent = right_indent # vertical position self.y_anchor = y_anchor y_anchor.y_dep.append(self) self.y_hook = y_hook self.y_align = y_align self.y_offset = y_offset # width self.max_width = max_width self.width_mode = width_mode # 'fixed' or 'auto', i.e. the content determines the width # height self.max_height = max_height self.height_mode = height_mode self.lines_below = lines_below
def __init__(self, max_width): BuildingBlock.__init__(self, None) self.width = self.max_width = max_width