def __init__(self, family="", face="", colour="", size="", hjust=None,
                 vjust=None, angle=0, lineheight=0, color=""):
        self.target = None
        self.properties = {}
        if family:
            self.properties["family"] = family
        if face:
            if face == "plain":
                self.properties["style"] = "normal"
            elif face == "italic":
                self.properties["style"] = "italic"
            elif face == "bold":
                self.properties["weight"] = "bold"
            elif face == "bold.italic":
                self.properties["style"] = "italic"
                self.properties["weight"] = "bold"
        if colour or color:
            if colour:
                self.properties["color"] = colour
            else:
                self.properties["color"] = color
        if size:
            self.properties["size"] = size
        if hjust is not None:
            self.properties["ha"] = self._translate_hjust(hjust)
        if vjust is not None:
            self.properties["va"] = self._translate_vjust(vjust)
        if angle:
            self.properties["rotation"] = angle
        if lineheight is not None:
            # I'm not sure if this is the right translation. Couldn't find an
            # example and this property doesn't seem to have any effect.
            # -gdowding
            self.properties["linespacing"] = lineheight
Set element_text properties according to the ggplot2 API.
dataset/ETHPy150Open yhat/ggplot/ggplot/themes/element_text.py/element_text.__init__