<commit_before>from fontTools.ttLib import TTFont
import sys
import os


def set_vertical_metrics(ttfont):
    """Apply fixes needed for web fonts."""

    # set vertical metrics to old values
    ttfont['hhea'].ascent = 1900
    ttfont['hhea'].descent = -500

    ttfont['OS/2'].sTypoAscender = 1946
    ttfont['OS/2'].sTypoDescender = -512
    ttfont['OS/2'].sTypoLineGap = 0
    ttfont['OS/2'].usWinAscent = 1946
    ttfont['OS/2'].usWinDescent = 512

    # Enable fsSelection bit 7 (use typo metrics)
    ttfont["OS/2"].fsSelection |= (1 << 7)


def update_nametable(ttfont):
    family_name = ttfont['name'].getName(16, 3, 1, 1033) or \
                  ttfont['name'].getName(1, 3, 1, 1033)
    style_name = ttfont['name'].getName(17, 3, 1, 1033) or \
                 ttfont['name'].getName(2, 3, 1, 1033)
    full_name = family_name.toUnicode() + " " + style_name.toUnicode()
    if full_name == "Roboto Regular":
        full_name = "Roboto"
    if full_name == "Roboto Condensed Regular":
        full_name = "Roboto Condensed"
    ttfont['name'].setName(full_name, 3,3,1,1033)
    ttfont['name'].setName(full_name, 4,3,1,1033)<commit_msg>revert web metrics<commit_after>from fontTools.ttLib import TTFont
import sys
import os


def set_vertical_metrics(ttfont):
    """Apply fixes needed for web fonts."""

    # set vertical metrics to old values
    ttfont['hhea'].ascent = 1900
    ttfont['hhea'].descent = -500

    ttfont['OS/2'].sTypoAscender = 1536
    ttfont['OS/2'].sTypoDescender = -512
    ttfont['OS/2'].sTypoLineGap = 102
    ttfont['OS/2'].usWinAscent = 1946
    ttfont['OS/2'].usWinDescent = 512


def update_nametable(ttfont):
    family_name = ttfont['name'].getName(16, 3, 1, 1033) or \
                  ttfont['name'].getName(1, 3, 1, 1033)
    style_name = ttfont['name'].getName(17, 3, 1, 1033) or \
                 ttfont['name'].getName(2, 3, 1, 1033)
    full_name = family_name.toUnicode() + " " + style_name.toUnicode()
    if full_name == "Roboto Regular":
        full_name = "Roboto"
    if full_name == "Roboto Condensed Regular":
        full_name = "<NAME>"
    ttfont['name'].setName(full_name, 3,3,1,1033)
    ttfont['name'].setName(full_name, 4,3,1,1033)
{'fraction_non_alphanumeric': 0.15297321833862915, 'fraction_numerical': 0.06718111665910123, 'mean_word_length': 3.2548262548262548, 'pattern_counts': {'":': 4, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6856112', 'n_tokens_mistral': 901, 'n_tokens_neox': 781, 'n_words': 168}