def METHOD_NAME(self, font: Style) -> None:
    font_family = font.get("font-family")
    font_size = font.get("font-size")
    font_weight = font.get("font-weight")
    font_style = font.get("font-style")
    assert font_family, "Font family should be set"
    assert font_size, "Font size should be set"
    font_id = (font_family, font_size, font_weight, font_style)
    if font_id == self.font_id:
        return
    self.font_id = font_id
    fd = Pango.FontDescription.new()
    fd.set_family(font_family)
    fd.set_absolute_size(font_size * Pango.SCALE)
    if font_weight:
        assert isinstance(font_weight, FontWeight)
        fd.set_weight(getattr(Pango.Weight, font_weight.name))
    if font_style:
        assert isinstance(font_style, FontStyle)
        fd.set_style(getattr(Pango.Style, font_style.name))
    self.layout.set_font_description(fd)
    underline = (
        font.get("text-decoration", TextDecoration.NONE) == TextDecoration.UNDERLINE
    )
    attrs = Pango.AttrList.new()
    attrs.insert(
        Pango.attr_underline_new(
            Pango.Underline.SINGLE if underline else Pango.Underline.NONE
        )
    )
    self.layout.set_attributes(attrs)