def get_font(self, textfont, pointsize, fontweight, fontstyle, underline): """Returns font for given attribute strings Parameters ---------- textfont: String \tString that describes the type of font pointsize: Integer \tFont size in points fontweight: Integer in (wx.NORMAL, wx.BOLD) \tFontsize integer fontstyle: Integer in (wx.NORMAL, wx.ITALICS) \tString that describes the font style underlined: Bool \tFont is underlined if True """ # Get a real font from textfont string font = get_font_from_data(textfont) font.SetPointSize(self.get_zoomed_fontsize(pointsize)) font.SetWeight(fontweight) font.SetStyle(fontstyle) font.SetUnderlined(underline) return font
def _zoom_labels(self, zoom): """Adjust grid label font to zoom factor""" labelfont = self.grid.GetLabelFont() default_fontsize = get_font_from_data(config["font"]).GetPointSize() - 2 labelfont.SetPointSize(max(1, int(round(default_fontsize * zoom)))) self.grid.SetLabelFont(labelfont)