def test_bounding_box_text(assert_pixels):
    assert_pixels('''
        BB
        BR
    ''', '''
      <style>
        @page { size: 2px }
        svg { display: block }
      </style>
      <svg width="2px" height="2px" xmlns="http://www.w3.org/2000/svg">
        <defs>
          <linearGradient id="grad" x1="0" y1="0" x2="1" y2="1"
            gradientUnits="objectBoundingBox">
            <stop stop-color="blue" offset="55%"></stop>
            <stop stop-color="red" offset="55%"></stop>
          </linearGradient>
        </defs>
        <text x="0" y="1" font-family="weasyprint" font-size="2"
              fill="url(#grad)">
          A
        </text>
      </svg>
    ''')
,
tests/draw/svg/test_bounding_box.py