Exemple #1
0
def rendering_modes(char):
    face = ft.Face(ft_util.vera_path())
    face.select_charmap(ft.ENCODING.UNICODE)
    face.set_char_size(48)

    for i, mode in enumerate([
            ft.LOAD.TARGET_MONO, ft.LOAD.TARGET_NORMAL, ft.LOAD.TARGET_LCD,
            ft.LOAD.TARGET_LCD_V
    ]):
        glyph = face.load_char_unicode(char, ft.LOAD.RENDER | mode)
        bitmap = glyph.bitmap
        if mode == ft.LOAD.TARGET_MONO:
            bitmap = bitmap.convert()

        array = np.array(bitmap)

        plt.subplot(1, 4, i + 1)
        plt.xticks([])
        plt.yticks([])

        if i < 2:
            plt.imshow(array, interpolation='nearest', cmap=plt.cm.gray)
        else:
            plt.imshow(array, interpolation='nearest')

        plt.xlabel(repr(bitmap.pixel_mode))

    plt.show()
Exemple #2
0
def test_outline():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(ord('B'))

    assert glyph.outline.contours.to_list() == [8, 17, 32]
    assert glyph.outline.tags.to_list() == [
        61, 17, 9, 0, 0, 9, 0, 0, 9, 25, 17, 9, 0, 0, 9, 0, 0, 9, 25, 9, 0, 0,
        9, 0, 0, 25, 0, 0, 9, 0, 0, 25, 1
    ]
    assert glyph.outline.points.to_list() == [[640, 1088], [640, 256],
                                              [1130, 256], [1402, 256],
                                              [1664, 461], [1664, 673],
                                              [1664, 886], [1402, 1088],
                                              [1130, 1088], [640, 2048],
                                              [640, 1344], [1093, 1344],
                                              [1317, 1344], [1536, 1518],
                                              [1536, 1696], [1536, 1873],
                                              [1317, 2048], [1093, 2048],
                                              [320, 2304], [1115, 2304],
                                              [1471, 2304], [1856, 2005],
                                              [1856, 1729], [1856, 1516],
                                              [1656, 1263], [1462, 1232],
                                              [1710, 1183], [1984, 872],
                                              [1984, 640], [1984, 334],
                                              [1548, 0], [1146, 0], [320, 0]]
    assert glyph.outline.flags == 1
Exemple #3
0
def test_outline_to_points_and_codes():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(ord('B'))

    points, codes = glyph.outline.to_points_and_codes()
    points = np.array(points)
    codes = np.array(codes)

    assert_array_equal(
        points,
        [[10.0, 17.0], [10.0, 4.0], [17.65625, 4.0], [21.90625, 4.0],
         [23.953125, 5.59375], [26.0, 7.203125], [26.0, 10.515625],
         [26.0, 13.84375], [23.953125, 15.421875], [21.90625, 17.0],
         [17.65625, 17.0], [10.0, 17.0], [10.0, 32.0], [10.0, 21.0],
         [17.078125, 21.0], [20.578125, 21.0], [22.28125, 22.359375],
         [24.0, 23.71875], [24.0, 26.5], [24.0, 29.265625], [22.28125, 30.625],
         [20.578125, 32.0], [17.078125, 32.0], [10.0, 32.0], [5.0, 36.0],
         [17.421875, 36.0], [22.984375, 36.0], [25.984375, 33.65625],
         [29.0, 31.328125], [29.0, 27.015625], [29.0, 23.6875],
         [27.4375, 21.703125], [25.875, 19.734375], [22.84375, 19.25],
         [26.71875, 18.484375], [28.859375, 16.046875], [31.0, 13.625],
         [31.0, 10.0], [31.0, 5.21875], [27.59375, 2.609375], [24.1875, 0.0],
         [17.90625, 0.0], [5.0, 0.0], [5.0, 36.0]])

    assert_array_equal(codes, [
        1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2,
        1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2
    ])
Exemple #4
0
def test_get_glyph_name():
    face = ft.Face(vera_path())

    names = (".notdef .null nonmarkingreturn space exclam quotedbl numbersign "
             "dollar percent ampersand quotesingle parenleft").split()

    for i, name in enumerate(names):
        assert face.get_glyph_name(i) == name
Exemple #5
0
def test_kerning():
    face = ft.Face(vera_path())
    face.set_char_size(24, 24, 300, 300)
    assert face.face_flags & ft.FACE_FLAG.KERNING
    A = face.get_char_index(ord('A'))
    V = face.get_char_index(ord('V'))
    assert face.get_kerning(A, V, ft.KERNING.UNSCALED) == (-2.046875, 0.0)
    assert face.get_kerning(A, V, ft.KERNING.DEFAULT) == (-6, 0)
Exemple #6
0
def test_lcd_glyph():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65, ft.LOAD.RENDER | ft.LOAD.TARGET_LCD)

    array = np.array(glyph.bitmap)
    assert array.shape == (36, 33, 3)
    assert array.dtype == np.uint8
Exemple #7
0
def test_size():
    face = ft.Face(vera_path())
    face.set_char_size(12, 12, 300, 300)
    assert face.size.metrics.x_ppem == 50
    assert face.size.metrics.y_ppem == 50
    assert face.size.metrics.x_scale == 1.5625
    assert face.size.metrics.y_scale == 1.5625
    assert 46.0 <= face.size.metrics.ascender <= 47.0
    assert face.size.metrics.descender == -12.0
    assert face.size.metrics.max_advance == 67.0
Exemple #8
0
def test_bitflag_magic():
    face = ft.Face(vera_path())
    assert repr(
        face.face_flags
    ) == "freetypy.FACE_FLAG.EXTERNAL_STREAM | freetypy.FACE_FLAG.GLYPH_NAMES | freetypy.FACE_FLAG.HINTER | freetypy.FACE_FLAG.HORIZONTAL | freetypy.FACE_FLAG.KERNING | freetypy.FACE_FLAG.SCALABLE | freetypy.FACE_FLAG.SFNT"
    assert face.face_flags == (ft.FACE_FLAG.SCALABLE
                               | ft.FACE_FLAG.EXTERNAL_STREAM
                               | ft.FACE_FLAG.SFNT | ft.FACE_FLAG.KERNING
                               | ft.FACE_FLAG.HORIZONTAL
                               | ft.FACE_FLAG.GLYPH_NAMES
                               | ft.FACE_FLAG.HINTER)
Exemple #9
0
def test_face_from_file_like():
    import io
    buf = io.BytesIO()

    with open(vera_path(), 'rb') as fd:
        buf.write(fd.read())

    buf.seek(0)

    face = ft.Face(buf)

    _test_face(face)
Exemple #10
0
def test_subglyphs():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)

    # TODO: Vera doesn't seem to have any subglyphs, so
    # we can't use it to test this

    for charcode, glyph_index in face.get_chars():
        glyph = face.load_glyph(glyph_index)
        if glyph.format == ft.GLYPH_FORMAT.COMPOSITE:
            print(glyph_index)
Exemple #11
0
def test_different_charmap():
    face = ft.Face(vera_path())

    # The default charmap is in MacRoman ...
    face.set_charmap(0)
    macroman_id = face.get_char_index(0xCB)

    # ... which has a different encoding than the Unicode one
    face.set_charmap(1)
    unicode_id = face.get_char_index(0xC0)

    assert macroman_id == unicode_id
Exemple #12
0
def test_outline_decompose():
    class Decomposer(object):
        def __init__(self):
            self.entries = []

        def move_to(self, point):
            self.entries.append(('move_to', point))

        def line_to(self, point):
            self.entries.append(('line_to', point))

        def conic_to(self, a, b):
            self.entries.append(('conic_to', a, b))

        def cubic_to(self, a, b, c):
            self.entries.append(('cubic_to', a, b, c))

    d = Decomposer()

    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(ord('B'))

    glyph.outline.decompose(d)

    print(d.entries)

    assert d.entries == [
        ('move_to', (10.0, 17.0)), ('line_to', (10.0, 4.0)),
        ('line_to', (17.65625, 4.0)),
        ('conic_to', (21.90625, 4.0), (23.953125, 5.59375)),
        ('conic_to', (26.0, 7.203125), (26.0, 10.515625)),
        ('conic_to', (26.0, 13.84375), (23.953125, 15.421875)),
        ('conic_to', (21.90625, 17.0), (17.65625, 17.0)),
        ('line_to', (10.0, 17.0)), ('move_to', (10.0, 32.0)),
        ('line_to', (10.0, 21.0)), ('line_to', (17.078125, 21.0)),
        ('conic_to', (20.578125, 21.0), (22.28125, 22.359375)),
        ('conic_to', (24.0, 23.71875), (24.0, 26.5)),
        ('conic_to', (24.0, 29.265625), (22.28125, 30.625)),
        ('conic_to', (20.578125, 32.0), (17.078125, 32.0)),
        ('line_to', (10.0, 32.0)), ('move_to', (5.0, 36.0)),
        ('line_to', (17.421875, 36.0)),
        ('conic_to', (22.984375, 36.0), (25.984375, 33.65625)),
        ('conic_to', (29.0, 31.328125), (29.0, 27.015625)),
        ('conic_to', (29.0, 23.6875), (27.4375, 21.703125)),
        ('conic_to', (25.875, 19.734375), (22.84375, 19.25)),
        ('conic_to', (26.71875, 18.484375), (28.859375, 16.046875)),
        ('conic_to', (31.0, 13.625), (31.0, 10.0)),
        ('conic_to', (31.0, 5.21875), (27.59375, 2.609375)),
        ('conic_to', (24.1875, 0.0), (17.90625, 0.0)), ('line_to', (5.0, 0.0)),
        ('line_to', (5.0, 36.0))
    ]
Exemple #13
0
def test_bitmap():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65, ft.LOAD.RENDER)

    x = glyph.bitmap.to_list()
    assert x == A

    glyph = face.load_char(65, ft.LOAD.RENDER|ft.LOAD.TARGET_LCD)

    x = glyph.bitmap.to_list()
    assert len(x[0][0]) == 3
Exemple #14
0
def test_subset():
    face = ft.Face(vera_path())
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char_unicode('B')
    original_B = glyph.outline.to_string(' M ', ' L ', ' C ', ' Q ')

    with open(vera_path(), 'rb') as input_fd:
        output_fd = io.BytesIO()
        subset.subset_font(input_fd, output_fd, 'ABCD')

    output_fd.seek(0)

    face = ft.Face(output_fd)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char_unicode('B')
    s = glyph.outline.to_string(' M ', ' L ', ' C ', ' Q ')
    assert original_B == s

    # Not here
    glyph = face.load_char_unicode('X')
    s = glyph.outline.to_string(' M ', ' L ', ' C ', ' Q ')
    assert len(s) == 0
Exemple #15
0
def test_face_set_transform():
    face = ft.Face(vera_path())
    face.set_transform([[2, 0], [0, 2]], [20, 20])

    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65, 0)

    assert glyph.advance == (4352, 0)
    assert glyph.advance.x == 4352
    assert glyph.advance.y == 0
    x, y = glyph.advance
    assert x == 4352
    assert y == 0
Exemple #16
0
def test_postscript():
    face = ft.Face(vera_path())

    x = face.tt_postscript
    assert x.format_type == 2.0
    assert x.is_fixed_pitch == False
    assert x.italic_angle == 0.0
    assert x.max_mem_type1 == 0
    assert x.max_mem_type42 == 0
    assert x.min_mem_type1 == 0
    assert x.min_mem_type42 == 0
    assert x.underline_position == -213
    assert x.underline_thickness == 143
Exemple #17
0
def test_bbox():
    face = ft.Face(vera_path())

    bbox = face.bbox
    assert bbox.x_min == -375.0
    assert bbox.x_max == 2636.0
    assert bbox.y_min == -483.0
    assert bbox.y_max == 1901.0
    x_min, x_max, y_min, y_max = face.bbox
    assert bbox.x_min == -375.0
    assert bbox.x_max == 2636.0
    assert bbox.y_min == -483.0
    assert bbox.y_max == 1901.0
Exemple #18
0
def test_outline():
    face = ft.Face(vera_path())
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65)

    points = np.array(glyph.outline.points)
    assert points.shape == (11, 2)

    tags = np.array(glyph.outline.tags)
    assert tags.shape == (11, )

    contours = np.array(glyph.outline.contours)
    assert contours.shape == (2, )
    assert list(contours) == [2, 10]
Exemple #19
0
def test_bitmap_stickaround():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65, ft.LOAD.RENDER | ft.LOAD.TARGET_LCD)

    bitmap = glyph.bitmap

    del glyph
    del face

    array = np.array(bitmap)
    assert array.shape == (36, 33, 3)
    assert array.dtype == np.uint8
Exemple #20
0
def test_select_charmap():
    face = ft.Face(vera_path())

    assert face.charmap.encoding == ft.ENCODING.UNICODE

    face.select_charmap(ft.ENCODING.APPLE_ROMAN)

    assert face.charmap.encoding == ft.ENCODING.APPLE_ROMAN

    try:
        face.select_charmap(ft.ENCODING.WANSUNG)
    except ValueError:
        pass
    else:
        assert False, "Expected an exception"
Exemple #21
0
def test_glyph_render_after():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65, ft.LOAD.RENDER)
    array1 = np.array(glyph.bitmap)

    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65)
    glyph.render()
    array2 = np.array(glyph.bitmap)

    assert np.all(array1 == array2)

    old_bitmap = glyph.bitmap
    new_bitmap = glyph.render()

    array3 = np.array(old_bitmap)
    array4 = np.array(new_bitmap)

    assert np.all(array1 == array3)
    assert np.all(array3 == array4)
Exemple #22
0
def test_glyph_reload():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(65, ft.LOAD.RENDER)

    assert glyph.linear_hori_advance == 34.2041015625

    glyph2 = face.load_char(ord('l'), ft.LOAD.RENDER)

    assert glyph.linear_hori_advance == 34.2041015625
    assert glyph2.linear_hori_advance == 13.8916015625

    del face

    assert glyph.linear_hori_advance == 34.2041015625
Exemple #23
0
def test_tt_horiheader():
    face = ft.Face(vera_path())

    x = face.tt_horiheader
    assert x.ascender == 1901
    assert x.descender == -483
    assert x.line_gap == 0
    assert x.version == 1.0
    assert x.advance_width_max == 2748
    assert x.caret_offset == 0
    assert x.caret_slope_rise == 1
    assert x.caret_slope_run == 0
    assert x.metric_data_format == 0
    assert x.min_left_side_bearing == -375
    assert x.min_right_side_bearing == -375
    assert x.number_of_hmetrics == 268
    assert x.xmax_extent == 2636
Exemple #24
0
def test_outline_to_string():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    face.set_char_size(12, 12, 300, 300)
    glyph = face.load_char(ord('B'))

    s = glyph.outline.to_string(' M ', ' L ', ' C ', ' Q ')

    print(s)

    assert s == b'10 17 M 10 4 L 17.65625 4 L 21.90625 4 23.953125 5.59375 Q 26 7.203125 26 10.515625 Q 26 13.84375 23.953125 15.421875 Q 21.90625 17 17.65625 17 Q 10 17 L 10 32 M 10 21 L 17.078125 21 L 20.578125 21 22.28125 22.359375 Q 24 23.71875 24 26.5 Q 24 29.265625 22.28125 30.625 Q 20.578125 32 17.078125 32 Q 10 32 L 5 36 M 17.421875 36 L 22.984375 36 25.984375 33.65625 Q 29 31.328125 29 27.015625 Q 29 23.6875 27.4375 21.703125 Q 25.875 19.734375 22.84375 19.25 Q 26.71875 18.484375 28.859375 16.046875 Q 31 13.625 31 10 Q 31 5.21875 27.59375 2.609375 Q 24.1875 0 17.90625 0 Q 5 0 L 5 36 L '

    s = glyph.outline.to_string(' M ', ' L ', ' C ', ' Q ', prefix=True)

    print(s)

    assert s == b' M 10 17 L 10 4 L 17.65625 4 Q 21.90625 4 23.953125 5.59375 Q 26 7.203125 26 10.515625 Q 26 13.84375 23.953125 15.421875 Q 21.90625 17 17.65625 17 L 10 17 M 10 32 L 10 21 L 17.078125 21 Q 20.578125 21 22.28125 22.359375 Q 24 23.71875 24 26.5 Q 24 29.265625 22.28125 30.625 Q 20.578125 32 17.078125 32 L 10 32 M 5 36 L 17.421875 36 Q 22.984375 36 25.984375 33.65625 Q 29 31.328125 29 27.015625 Q 29 23.6875 27.4375 21.703125 Q 25.875 19.734375 22.84375 19.25 Q 26.71875 18.484375 28.859375 16.046875 Q 31 13.625 31 10 Q 31 5.21875 27.59375 2.609375 Q 24.1875 0 17.90625 0 L 5 0 L 5 36'
Exemple #25
0
def test_constant_magic():
    face = ft.Face(vera_path())

    sfntnames = face.sfnt_names

    assert repr(sfntnames[0].platform_id) == "freetypy.TT_PLATFORM.MACINTOSH"
    assert sfntnames[0].platform_id == ft.TT_PLATFORM.MACINTOSH
    assert 'freetypy.TT_PLATFORM.Constant' in str(
        type(sfntnames[0].platform_id))

    assert repr(sfntnames[0].encoding_id) == "freetypy.TT_MAC_ID.ROMAN"
    assert sfntnames[0].encoding_id == ft.TT_MAC_ID.ROMAN

    assert repr(sfntnames[0].name_id) == 'freetypy.TT_NAME_ID.COPYRIGHT'

    assert type(sfntnames[0].string) == type('')
    assert type(sfntnames[0].string_bytes) == type(b'')
Exemple #26
0
def test_layout():
    face = ft.Face(vera_path())
    face.select_charmap(ft.ENCODING.UNICODE)
    face.set_char_size(24.0)

    layout = ft.Layout(face, "The quick brown fox jumped over the lazy dog")

    assert layout.ink_bbox.width == 553.984375
    assert layout.ink_bbox.ascent == 18.0
    assert layout.ink_bbox.depth == -5.0

    assert tuple(layout.layout_bbox)[:3] == (0.0, -6.0, 555.984375)

    assert layout.glyph_indices.to_list() == [
        55, 75, 72, 3, 84, 88, 76, 70, 78, 3, 69, 85, 82, 90, 81, 3, 73, 82,
        91, 3, 77, 88, 80, 83, 72, 71, 3, 82, 89, 72, 85, 3, 87, 75, 72, 3, 79,
        68, 93, 92, 3, 71, 82, 74
    ]
Exemple #27
0
def test_lookup_by_unicode():
    face = ft.Face(vera_path())
    face.set_charmap(0)
    glyph_macroman = face.get_char_index(0xCB)
    glyph_macroman_wrong = face.get_char_index_unicode('\u00cb')
    glyph_unicode = face.get_char_index_unicode('\u00c0')
    assert glyph_macroman == glyph_unicode
    assert glyph_macroman != glyph_macroman_wrong
    assert glyph_macroman == 173

    face.set_charmap(1)
    glyph_unicode_wrong = face.get_char_index(0xCB)
    glyph_unicode_right = face.get_char_index(0xC0)
    glyph_unicode_right2 = face.get_char_index_unicode('\u00c0')

    assert glyph_unicode_wrong != glyph_unicode
    assert glyph_unicode_right == glyph_unicode
    assert glyph_unicode_right2 == glyph_unicode
    assert glyph_unicode == 173
Exemple #28
0
def test_tt_header():
    face = ft.Face(vera_path())

    x = face.tt_header
    assert x.checksum_adjust == 206572268
    assert x.created == datetime.datetime(2003, 4, 9, 15, 46)
    assert x.flags == 31
    assert x.font_direction == 1
    assert x.font_revision == 2.0
    assert x.lowest_rec_ppem == 8
    assert x.mac_style == 0
    assert x.magic_number == 0x5f0f3cf5
    assert x.modified == datetime.datetime(2003, 4, 16, 1, 51, 13)
    assert x.table_version == 1.0
    assert x.units_per_em == 2048
    assert x.x_max == 2636
    assert x.x_min == -375
    assert x.y_max == 1901
    assert x.y_min == -483
Exemple #29
0
def test_charmap():
    face = ft.Face(vera_path())

    charmaps = face.charmaps
    assert len(charmaps) == 2

    assert charmaps[0].face is face
    assert charmaps[0].encoding == ft.ENCODING.APPLE_ROMAN
    assert charmaps[0].platform_id == ft.TT_PLATFORM.MACINTOSH
    assert charmaps[0].encoding_id == ft.TT_MAC_ID.ROMAN
    assert charmaps[1].face is face
    assert charmaps[1].encoding == ft.ENCODING.UNICODE
    assert charmaps[1].platform_id == ft.TT_PLATFORM.MICROSOFT
    assert charmaps[1].encoding_id == ft.TT_MS_ID.UNICODE_CS

    assert charmaps[0].get_format() == 0
    assert charmaps[1].get_format() == 4

    assert charmaps[0].get_language_id() == ft.TT_MAC_LANGID.ENGLISH
    assert charmaps[1].get_language_id() == 0
Exemple #30
0
def test_sfntnames():
    face = ft.Face(vera_path())

    sfntnames = face.sfnt_names

    assert len(sfntnames) == 22

    values = set((x.name_id, x.string) for x in sfntnames)
    assert values == set([
        (ft.TT_NAME_ID.COPYRIGHT,
         'Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.'),
        (ft.TT_NAME_ID.FONT_FAMILY, 'Bitstream Vera Sans'),
        (ft.TT_NAME_ID.FONT_SUBFAMILY, 'Roman'),
        (ft.TT_NAME_ID.UNIQUE_ID, 'Bitstream Vera Sans'),
        (ft.TT_NAME_ID.FULL_NAME, 'Bitstream Vera Sans'),
        (ft.TT_NAME_ID.VERSION_STRING, 'Release 1.10'),
        (ft.TT_NAME_ID.PS_NAME, 'BitstreamVeraSans-Roman'),
        (ft.TT_NAME_ID.TRADEMARK,
         'Bitstream Vera is a trademark of Bitstream, Inc.'),
        (ft.TT_NAME_ID.MANUFACTURER, 'Bitstream Inc.'),
        (ft.TT_NAME_ID.VENDOR_URL, 'http://www.bitstream.com'),
        (ft.TT_NAME_ID.LICENSE,
         'Copyright (c) 2003 by Bitstream, Inc.\r\nAll Rights Reserved.\r\nBitstream Vera is a trademark of Bitstream, Inc.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.\r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.\r\n\r\nExcept as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.'
         ),
        (ft.TT_NAME_ID.COPYRIGHT,
         'Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved.'),
        (ft.TT_NAME_ID.FONT_FAMILY, 'Bitstream Vera Sans'),
        (ft.TT_NAME_ID.FONT_SUBFAMILY, 'Roman'),
        (ft.TT_NAME_ID.UNIQUE_ID, 'Bitstream Vera Sans'),
        (ft.TT_NAME_ID.FULL_NAME, 'Bitstream Vera Sans'),
        (ft.TT_NAME_ID.VERSION_STRING, 'Release 1.10'),
        (ft.TT_NAME_ID.PS_NAME, 'BitstreamVeraSans-Roman'),
        (ft.TT_NAME_ID.TRADEMARK,
         'Bitstream Vera is a trademark of Bitstream, Inc.'),
        (ft.TT_NAME_ID.MANUFACTURER, 'Bitstream Inc.'),
        (ft.TT_NAME_ID.VENDOR_URL, 'http://www.bitstream.com'),
        (ft.TT_NAME_ID.LICENSE,
         'Copyright (c) 2003 by Bitstream, Inc.\r\nAll Rights Reserved.\r\nBitstream Vera is a trademark of Bitstream, Inc.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:\r\n\r\nThe above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.\r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.\r\n\r\nExcept as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.'
         )
    ])