Exemplo n.º 1
0
def test_fix_bitmask():
    fixer = fix_bitmask(3)
    assert fixer(0) == 0
    assert fixer(1) == 1
    assert fixer(2) == 2
    assert fixer(3) == 3
    assert fixer(4) == 0
    assert fixer(5) == 1
Exemplo n.º 2
0
        # Determines how much border there is around the text.
        # (45) + (90) + (63) all three required, if one of them is used
        'box_fill_scale':
        DXFAttr(45, dxfversion='AC1021'),

        # background fill type flags:
        # 0 = off
        # 1 = color -> (63) < (421) or (431)
        # 2 = drawing window color
        # 3 = use background color (1 & 2)
        # 16 = text frame ODA specification 20.4.46
        'bg_fill':
        DXFAttr(90,
                dxfversion='AC1021',
                validator=validator.is_valid_bitmask(BG_FILL_MASK),
                fixer=validator.fix_bitmask(BG_FILL_MASK)),

        # background fill color as ACI, required even true color is used
        'bg_fill_color':
        DXFAttr(
            63,
            dxfversion='AC1021',
            validator=validator.is_valid_aci_color,
        ),

        # 420-429? : background fill color as true color value, (63) also required
        # but ignored
        'bg_fill_true_color':
        DXFAttr(421, dxfversion='AC1021'),

        # 430-439? : background fill color as color name ???, (63) also required