Ejemplo n.º 1
0
 def render(self):
     mylabel = CoreMarkupLabel(text=fa_icon(self.fa_name),
                               font_size=self.fa_font_size,
                               color=self.fa_icon_color)
     mylabel.refresh()
     texture = mylabel.texture
     texture_size = list(texture.size)
     self.canvas.add(Rectangle(texture=texture, size=texture_size))
Ejemplo n.º 2
0
    def _create_label(self):
        # create the core label class according to markup value
        if self._label is not None:
            cls = self._label.__class__
        else:
            cls = None

        if cls is not CoreMarkupLabel:
            # markup have change, we need to change our rendering method.
            d = TerminalWidgetKivy._font_properties
            dkw = dict(list(zip(d, [getattr(self, x) for x in d])))
            self._label = CoreMarkupLabel(**dkw)

        self._update_line_options()
Ejemplo n.º 3
0
 def _create_label(self):
     # create the core label class according to markup value
     if self._label is not None:
         cls = self._label.__class__
     else:
         cls = None
     markup = self.markup
     if (markup and cls is not CoreMarkupLabel) or \
        (not markup and cls is not CoreLabel):
         # markup have change, we need to change our rendering method.
         d = Label._font_properties
         dkw = dict(list(zip(d, [getattr(self, x) for x in d])))
         if markup:
             self._label = CoreMarkupLabel(**dkw)
         else:
             self._label = CoreLabel(**dkw)
Ejemplo n.º 4
0
 def _create_label(self):
     # create the core label class according to markup value
     if self._label is not None:
         cls = self._label.__class__
     else:
         cls = None
     markup = self.markup
     if (markup and cls is not CoreMarkupLabel) or \
        (not markup and cls is not CoreLabel):
         # markup have change, we need to change our rendering method.
         d = Label._font_properties
         dkw = dict(zip(d, [getattr(self, x) for x in d]))
         # XXX font_size core provider compatibility
         if Label.font_size.get_format(self) == 'px':
             dkw['font_size'] *= 1.333
         if markup:
             self._label = CoreMarkupLabel(**dkw)
         else:
             self._label = CoreLabel(**dkw)
Ejemplo n.º 5
0
Archivo: label.py Proyecto: tkurze/kivy
    def _create_label(self):
        # create the core label class according to markup value
        if self._label is not None:
            cls = self._label.__class__
        else:
            cls = None
        markup = self.markup
        if (markup and cls is not CoreMarkupLabel) or \
           (not markup and cls is not CoreLabel):
            # markup have change, we need to change our rendering method.
            dkw = {x: getattr(self, x) for x in self._font_properties}
            dkw['usersize'] = self.text_size
            if self.disabled:
                dkw['color'] = self.disabled_color
                dkw['outline_color'] = self.disabled_outline_color

            if markup:
                self._label = CoreMarkupLabel(**dkw)
            else:
                self._label = CoreLabel(**dkw)
Ejemplo n.º 6
0
 def _create_line_label(self):
     d = TerminalWidgetKivy._font_properties
     dkw = dict(list(zip(d, [getattr(self, x) for x in d])))
     return CoreMarkupLabel(**dkw)