<commit_before>#!/usr/bin/env python
from __future__ import division

from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm, mm, inch

from locale import *

class YearCalendar(object):
    def __init__(self, year, locale=DefaultLocale()):
        self.year = year
        self.locale = locale

        # Page size and margins (overridable)
        self.pagesize = A4
        self.margins = (1*cm,) * 4   # top, right, bottom, left

        self.max_picture_height = self.content_height / 2
        self.max_table_height = self.content_height / 3

        self.title_font_name = "DejavuBold"
        self.title_bottom_margin = 0.5 * cm
        self.title_font_size = 32 #pt

    @property
    def width(self):
        return self.pagesize[0]

    @property
    def height(self):<commit_msg>Use Dejavu font with metrics<commit_after>#!/usr/bin/env python
from __future__ import division

from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm, mm, inch
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

from locale import *

class YearCalendar(object):
    def __init__(self, year, locale=DefaultLocale()):
        self.year = year
        self.locale = locale

        # Page size and margins (overridable)
        self.pagesize = A4
        self.margins = (1*cm,) * 4   # top, right, bottom, left

        self.max_picture_height = self.content_height / 2
        self.max_table_height = self.content_height / 3

        # Register used fonts
        pdfmetrics.registerFont(TTFont("Dejavu", "DejaVuSans.ttf"))
        pdfmetrics.registerFont(TTFont("DejavuBold", "DejaVuSans-Bold.ttf"))

        self.title_font_name = "DejavuBold"
        self.title_bottom_margin = 0.5 * cm
        self.title_font_size = 32 #pt

    @property
    def width(self):
        return self.pagesize[0]

    @property
    def height(self):
{'fraction_non_alphanumeric': 0.0920183019827148, 'fraction_numerical': 0.011184544992374174, 'mean_word_length': 2.9047619047619047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6896138', 'n_tokens_mistral': 643, 'n_tokens_neox': 611, 'n_words': 156}