def shade(pen, shade):
    # Not used in recipes above, but maybe useful for somebody.
    # Reliable way to crash makeOTF

    vstep = 50
    hstep = 100
    if shade == '25':
        boxWidth = 20
        boxHeight = 30
    if shade == '50':
        boxWidth = 40
        boxHeight = 50
    if shade == '75':
        boxWidth = 45
        boxHeight = 70

    for w in xrange(0, WIDTH, hstep):
        for h in xrange(
            MEDIAN - BLOCK_HEIGHT / 2,
            MEDIAN + BLOCK_HEIGHT / 2,
            vstep * 2
        ):
            box(
                boxPen,
                (w, h),
                (w + boxWidth, h + boxHeight)
            )
            box(
                boxPen,
                (w + hstep / 2, h + vstep),
                (w + boxWidth + hstep / 2, h + boxHeight + vstep)
            )
Shading patterns, consisting of little boxes.
dataset/ETHPy150Open adobe-type-tools/box-drawing/boxDrawing.py/shade