def _get_font(self, pys_style):
        """Returns xlwt.Font for pyspread style"""

        # Return None if there is no font
        if "textfont" not in pys_style:
            return

        font = xlwt.Font()

        font.name = pys_style["textfont"]

        if "pointsize" in pys_style:
            font.height = pys_style["pointsize"] * 20.0

        if "fontweight" in pys_style:
            font.bold = (pys_style["fontweight"] == wx.BOLD)

        if "fontstyle" in pys_style:
            font.italic = (pys_style["fontstyle"] == wx.ITALIC)

        if "textcolor" in pys_style:
            textcolor = wx.Colour()
            textcolor.SetRGB(pys_style["textcolor"])
            font.colour_index = self.color2idx(*textcolor.Get())

        if "underline" in pys_style:
            font.underline_type = pys_style["underline"]

        if "strikethrough" in pys_style:
            font.struck_out = pys_style["strikethrough"]

        return font
def _get_font ( self , pys_style ) : if "textfont" not in pys_style : return font = xlwt . Font ( ) font . name = pys_style [ "textfont" ] if "pointsize" in pys_style : font . height = pys_style [ "pointsize" ] * 20.0 if "fontweight" in pys_style : font . bold = ( pys_style [ "fontweight" ] == wx . BOLD ) if "fontstyle" in pys_style : font . italic = ( pys_style [ "fontstyle" ] == wx . ITALIC ) if "textcolor" in pys_style : textcolor = wx . Colour ( ) textcolor . SetRGB ( pys_style [ "textcolor" ] ) font . colour_index = self . color2idx ( * textcolor . Get ( ) ) if "underline" in pys_style : font . underline_type = pys_style [ "underline" ] if "strikethrough" in pys_style : font . struck_out = pys_style [ "strikethrough" ] return font
Returns xlwt.Font for pyspread style