Example #1
0
def measure_mroot(node):
    if len(node.children) != 2:
        node.error("Invalid content of 'mroot' element: element should have exactly two children")

    if len(node.children) < 2:            
        node.rootindex = None
        measure_msqrt(node)
    else:
        setNodeBase(node, node.children[0])
        node.rootindex = node.children[1]
        enclosures.addRadicalEnclosure(node)
        node.width += max(0, node.rootindex.width - node.cornerWidth)
        node.height += max(0, node.rootindex.height + node.rootindex.depth - node.cornerHeight)        
        node.ascender = node.height
Example #2
0
def measure_msqrt(node):
    # Create an explicit mrow if there's more than one child
    createImplicitRow(node)
    enclosures.addRadicalEnclosure(node)