def __init__(self, lang): self._ebuttd_content = bindings.ttd( timeBase='media', head=bindings.d_head_type( styling=bindings.d_styling_type.create_default_value(), layout=bindings.d_layout_type.create_default_value()), lang=lang)
def _link_adjusted_fonts_styling(self, adjusted_fonts, root_element): if not adjusted_fonts: return if root_element.head is None: root_element.head = d_head_type() if root_element.head.styling is None: root_element.head.styling = d_styling_type() root_element.head.styling.style.extend(adjusted_fonts.values())
def __init__(self, lang): self._ebuttd_content = bindings.ttd( timeBase='media', head=bindings.d_head_type( styling=bindings.d_styling_type.create_default_value(), layout=bindings.d_layout_type.create_default_value() ), lang=lang )
def convert_head(self, head_in, dataset): new_elem = d_head_type() head_children = self.convert_children(head_in, dataset) for item in head_children: if isinstance(item, d_styling_type): new_elem.styling = item elif isinstance(item, d_layout_type): new_elem.layout = item else: new_elem.append(item) # We need default values here in case styling or layout is omitted from the source document. if not self._children_contain(new_elem, d_styling_type): new_elem.styling = d_styling_type.create_default_value() if not self._children_contain(new_elem, d_layout_type): log.info('converter added a default layout') log.info([item.value for item in new_elem.orderedContent()]) new_elem.layout = d_layout_type.create_default_value() return new_elem
def convert_head(self, head_in, dataset): new_elem = d_head_type( ) head_children = self.convert_children(head_in, dataset) for item in head_children: if isinstance(item, d_styling_type): new_elem.styling = item elif isinstance(item, d_layout_type): new_elem.layout = item else: new_elem.append(item) # We need default values here in case styling or layout is omitted from the source document. if not self._children_contain(new_elem, d_styling_type): new_elem.styling = d_styling_type.create_default_value() if not self._children_contain(new_elem, d_layout_type): log.info('converter added a default layout') log.info([item.value for item in new_elem.orderedContent()]) new_elem.layout = d_layout_type.create_default_value() return new_elem