code: def set_font(self, pango_layout):
          
  
          wx2pango_weights = {
              wx.FONTWEIGHT_BOLD: pango.WEIGHT_BOLD,
              wx.FONTWEIGHT_LIGHT: pango.WEIGHT_LIGHT,
              wx.FONTWEIGHT_NORMAL: None,  # Do not set a weight by default
          }
  
          wx2pango_styles = {
              wx.FONTSTYLE_NORMAL: None,  # Do not set a style by default
              wx.FONTSTYLE_SLANT: pango.STYLE_OBLIQUE,
              wx.FONTSTYLE_ITALIC: pango.STYLE_ITALIC,
          }
  
          cell_attributes = self.code_array.cell_attributes[self.key]
  
          # Text font attributes
          textfont = cell_attributes["textfont"]
          pointsize = cell_attributes["pointsize"]
          fontweight = cell_attributes["fontweight"]
          fontstyle = cell_attributes["fontstyle"]
          underline = cell_attributes["underline"]
          strikethrough = cell_attributes["strikethrough"]
  
          # Now construct the pango font
          font_description = pango.FontDescription(
              " ".join([textfont, str(pointsize)]))
          pango_layout.set_font_description(font_description)
  
          attrs = pango.AttrList()
  
          # Underline
          attrs.insert(pango.AttrUnderline(underline, 0, MAX_RESULT_LENGTH))
  
          # Weight
          weight = wx2pango_weights[fontweight]
          if weight is not None:
              attrs.insert(pango.AttrWeight(weight, 0, MAX_RESULT_LENGTH))
  
          # Style
          style = wx2pango_styles[fontstyle]
          if style is not None:
              attrs.insert(pango.AttrStyle(style, 0, MAX_RESULT_LENGTH))
  
          # Strikethrough
          attrs.insert(pango.AttrStrikethrough(strikethrough, 0,
                                               MAX_RESULT_LENGTH))
  
          pango_layout.set_attributes(attrs)
docs: Sets the font for draw_text