def draw(self):
        fillColor = self.fillColor
        strokeColor = self.strokeColor
        g = Group()
        bg = self.background
        bd = self.border
        bdw = self.borderWidth
        shadow = self.shadow
        x, y = self.x, self.y
        if bg:
            if shadow is not None and 0<=shadow<1:
                shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow)
            self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow)
        self._paintLogo(g,fillColor=fillColor,strokeColor=strokeColor)
        g.skew(kx=self.skewX, ky=self.skewY)
        g.shift(self._dx,self._dy)
        G = Group()
        G.add(g)
        _w, _h = 130, 86
        w, h = self.width, self.height
        if bg or (bd and bdw):
            G.insert(0,Rect(0,0,_w,_h,fillColor=bg,strokeColor=bd,strokeWidth=bdw))
        if w!=_w or h!=_h: G.scale(w/float(_w),h/float(_h))

        angle = self.angle
        if self.angle:
            w, h = w/2., h/2.
            G.shift(-w,-h)
            G.rotate(angle)
            G.shift(w,h)
        G.shift(x,y)
        return G
Beispiel #2
0
 def draw(self):
     sx = 0.5
     fillColor = self.fillColor
     strokeColor = self.strokeColor
     shadow = Color(fillColor.red * sx, fillColor.green * sx,
                    fillColor.blue * sx)
     g = Group()
     g2 = Group()
     g.add(
         Rect(fillColor=fillColor,
              strokeColor=fillColor,
              x=0,
              y=0,
              width=self._w,
              height=self._h))
     sx = (self._w - 2) / self._sw()
     g2.scale(sx, 1)
     self._addPage(g2, strokeWidth=3, dx=2, dy=-2.5, color=shadow)
     self._addPage(g2, strokeWidth=3, color=strokeColor)
     g2.scale(1 / sx, 1)
     g2.add(self._getText(x=1, y=0, color=shadow))
     g2.add(self._getText(x=0, y=1, color=strokeColor))
     g2.scale(sx, 1)
     g2.skew(kx=10, ky=0)
     g2.shift(0, 38)
     g.add(g2)
     g.scale(self.width / self._w, self.height / self._h)
     g.shift(self.x, self.y)
     return g
Beispiel #3
0
    def draw(self):
        fillColor = self.fillColor
        strokeColor = self.strokeColor
        g = Group()
        bg = self.background
        bd = self.border
        bdw = self.borderWidth
        shadow = self.shadow
        x, y = self.x, self.y
        if bg:
            if shadow is not None and 0 <= shadow < 1:
                shadow = Color(bg.red * shadow, bg.green * shadow,
                               bg.blue * shadow)
            self._paintLogo(g, dy=-2.5, dx=2, fillColor=shadow)
        self._paintLogo(g,
                        fillColor=fillColor,
                        strokeColor=strokeColor,
                        _ocolors=getattr(self, '_ocolors', None),
                        _pagecolors=getattr(self, '_pagecolors', None))
        g.skew(kx=self.skewX, ky=self.skewY)
        g.shift(self._dx, self._dy)
        G = Group()
        G.add(g)
        _w, _h = 130, 86
        w, h = self.width, self.height
        if bg or (bd and bdw):
            G.insert(
                0,
                Rect(0,
                     0,
                     _w,
                     _h,
                     fillColor=bg,
                     strokeColor=bd,
                     strokeWidth=bdw))
        if w != _w or h != _h: G.scale(w / float(_w), h / float(_h))

        angle = self.angle
        if self.angle:
            w, h = w / 2., h / 2.
            G.shift(-w, -h)
            G.rotate(angle)
            G.shift(w, h)
        xFlip = getattr(self, 'xFlip', 0) and -1 or 0
        yFlip = getattr(self, 'yFlip', 0) and -1 or 0
        if xFlip or yFlip:
            sx = xFlip or 1
            sy = yFlip or 1
            G.shift(sx * x + w * xFlip, sy * y + yFlip * h)
            G = Group(G, transform=(sx, 0, 0, sy, 0, 0))
        else:
            G.shift(x, y)
        return G
Beispiel #4
0
    def draw(self):
        fillColor = self.fillColor
        strokeColor = self.strokeColor
        g = Group()
        bg = self.background
        bd = self.border
        bdw = self.borderWidth
        shadow = self.shadow
        x, y = self.x, self.y
        if bg:
            if shadow is not None and 0 <= shadow < 1:
                shadow = Color(bg.red * shadow, bg.green * shadow, bg.blue * shadow)
            self._paintLogo(g, dy=-2.5, dx=2, fillColor=shadow)
        self._paintLogo(
            g,
            fillColor=fillColor,
            strokeColor=strokeColor,
            _ocolors=getattr(self, "_ocolors", None),
            _pagecolors=getattr(self, "_pagecolors", None),
        )
        g.skew(kx=self.skewX, ky=self.skewY)
        g.shift(self._dx, self._dy)
        G = Group()
        G.add(g)
        _w, _h = 130, 86
        w, h = self.width, self.height
        if bg or (bd and bdw):
            G.insert(0, Rect(0, 0, _w, _h, fillColor=bg, strokeColor=bd, strokeWidth=bdw))
        if w != _w or h != _h:
            G.scale(w / float(_w), h / float(_h))

        angle = self.angle
        if self.angle:
            w, h = w / 2.0, h / 2.0
            G.shift(-w, -h)
            G.rotate(angle)
            G.shift(w, h)
        xFlip = getattr(self, "xFlip", 0) and -1 or 0
        yFlip = getattr(self, "yFlip", 0) and -1 or 0
        if xFlip or yFlip:
            sx = xFlip or 1
            sy = yFlip or 1
            G.shift(sx * x + w * xFlip, sy * y + yFlip * h)
            G = Group(G, transform=(sx, 0, 0, sy, 0, 0))
        else:
            G.shift(x, y)
        return G
 def draw(self):
     sx = 0.5
     fillColor = self.fillColor
     strokeColor = self.strokeColor
     shadow = Color(fillColor.red*sx,fillColor.green*sx,fillColor.blue*sx)
     g = Group()
     g2= Group()
     g.add(Rect(fillColor=fillColor, strokeColor=fillColor, x=0, y=0, width=self._w, height=self._h))
     sx = (self._w-2)/self._sw()
     g2.scale(sx,1)
     self._addPage(g2,strokeWidth=3,dx=2,dy=-2.5,color=shadow)
     self._addPage(g2,strokeWidth=3,color=strokeColor)
     g2.scale(1/sx,1)
     g2.add(self._getText(x=1,y=0,color=shadow))
     g2.add(self._getText(x=0,y=1,color=strokeColor))
     g2.scale(sx,1)
     g2.skew(kx=10, ky=0)
     g2.shift(0,38)
     g.add(g2)
     g.scale(self.width/self._w,self.height/self._h)
     g.shift(self.x,self.y)
     return g
Beispiel #6
0
    Rect(0,
         0,
         bottom_width,
         bottom_thickness,
         strokeWidth=0.02,
         fillColor=colors.white))
btmtop = Group(
    Rect(0,
         0,
         bottom_width,
         bottom_depth,
         strokeWidth=0.02,
         fillColor=colors.white))
btmtop.translate(0, bottom_thickness)
btmtop.shift(0, bottom_thickness)
btmtop.skew(iso_angle, 0)
btmright = Group(
    Rect(0,
         0,
         bottom_depth,
         bottom_thickness,
         strokeWidth=0.02,
         fillColor=colors.white))
btmright.translate(bottom_width, 0)
btmright.shift(bottom_width, 0)
btmright.skew(0, 90 - iso_angle)

d.add(btmfront)
d.add(btmtop)
d.add(btmright)