Ejemplo n.º 1
0
def update_version_and_revision(font):
    """Update version and revision numbers."""

    version_number = roboto_data.get_version_number()
    version_record = 'Version %s; %d' % (version_number, date.today().year)
    font_data.set_name_record(font, 5, version_record)
    font['head'].fontRevision = float(version_number)
Ejemplo n.º 2
0
class TestMetaInfo(font_tests.TestMetaInfo):
    """Bugs:
    https://github.com/google/roboto/issues/142
    https://code.google.com/a/google.com/p/roboto/issues/detail?id=8
    https://code.google.com/a/google.com/p/roboto/issues/detail?id=29
    """

    loaded_fonts = FONTS
    mark_heavier_as_bold = False
    mark_italic_as_oblique = True
    test_us_weight = None

    expected_version = roboto_data.get_version_number()

    # fsType of 0 marks the font free for installation, embedding, etc.
    expected_os2_fsType = 0
    expected_os2_achVendID = 'GOOG'
Ejemplo n.º 3
0
def apply_temporary_fixes(font):
    """Apply some temporary fixes."""

    from datetime import date

    version_number = roboto_data.get_version_number()
    version_record = 'Version %s; %d' % (version_number, date.today().year)

    for record in font['name'].names:
        if record.nameID == 5:
            if record.platformID == 1 and record.platEncID == 0:  # MacRoman
                record.string = version_record
            elif record.platformID == 3 and record.platEncID == 1:
                # Windows UCS-2
                record.string = version_record.encode('UTF-16BE')
            else:
                assert False