def parse(self, f):

        line = f.readline()
        line = line.strip()

        if line.startswith('info '):
            found = self.bold_re.search(line)
            if found:
                self.bold = int(found.group(1))

            found = self.italic_re.search(line)
            if found:
                self.italic = int(found.group(1))

            LOG.info("bold: %d", self.bold)
            LOG.info("italic: %d", self.italic)

            line = f.readline()
            line = line.strip()

        # Common
        if not line.startswith('common '):
            raise Exception('Common information espected, found: ' + line)

        found = self.page_width_re.search(line)
        if not found:
            raise Exception('ScaleW espected, found: ' + line)

        self.page_width = int(found.group(1))

        LOG.info("page width: %d", self.page_width)

        found = self.page_height_re.search(line)
        if not found:
            raise Exception('ScaleH espected, found: ' + line)

        self.page_height = int(found.group(1))

        LOG.info("page height: %d", self.page_height)

        found = self.line_height_re.search(line)
        if not found:
            raise Exception('Line Height espected, found: ' + line)

        self.line_height = int(found.group(1))

        LOG.info("line height: %d", self.line_height)

        found = self.base_re.search(line)
        if not found:
            raise Exception('Base espected, found: ' + line)

        self.baseline = int(found.group(1))

        LOG.info("baseline: %d", self.baseline)

        found = self.num_pages_re.search(line)
        if not found:
            raise Exception('Num pages espected, found: ' + line)

        num_pages = int(found.group(1))
        self.texture_pages = [None] * num_pages

        LOG.info("num texture pages: %d", num_pages)

        # Pages
        line = f.readline()
        line = line.strip()
        while line.startswith('page'):
            self.__read_page(line)
            line = f.readline()
            line = line.strip()

        found = self.num_chars_re.search(line)
        if not found:
            raise Exception('Chars count espected, found: ' + line)

        self.num_glyphs = int(found.group(1))
        if self.num_glyphs <= 0:
            raise Exception('No glyphs found!')

        LOG.info("num glyphs: %d", self.num_glyphs)

        line = f.readline()
        line = line.strip()
        while line.startswith('char'):
            self.__read_char(line)
            line = f.readline()
            line = line.strip()

        # Kernings
        found = self.num_kernings_re.search(line)
        if found:
            num_kernings = int(found.group(1))
            if num_kernings > 0:
                line = f.readline()
                line = line.strip()
                while line.startswith('kerning'):
                    self.__read_kerning(line)
                    line = f.readline()
                    line = line.strip()
        else:
            num_kernings = 0

        LOG.info("num kernings: %d", num_kernings)
This tests a bug that was discovered on May 28, 2014 that
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/bmfont2json.py/Bmfont2json.parse--crossover with--dataset/ETHPy150Open wreckage/django-happenings/tests/integration_tests/test_get_next_event.py/NextEventTest.test_next_event_bugfix