예제 #1
0
파일: dvifile.py 프로젝트: atal2003/test
    def putrule(self, height, width, advancepos, fontmap):
        self.flushtext(fontmap)
        x1 = self.pos[_POS_H] * self.pyxconv
        y1 = -self.pos[_POS_V] * self.pyxconv
        w = width * self.pyxconv
        h = height * self.pyxconv

        if height > 0 and width > 0:
            if self.debug:
                self.debugfile.write(
                    "%d: %srule height %d, width %d (???x??? pixels)\n" %
                    (self.filepos, advancepos and "set"
                     or "put", height, width))
            self.actpage.fill(path.rect_pt(x1, y1, w, h))
        else:
            if self.debug:
                self.debugfile.write(
                    "%d: %srule height %d, width %d (invisible)\n" %
                    (self.filepos, advancepos and "set"
                     or "put", height, width))

        if advancepos:
            if self.debug:
                self.debugfile.write(
                    " h:=%d+%d=%d, hh:=???\n" %
                    (self.pos[_POS_H], width, self.pos[_POS_H] + width))
            self.pos[_POS_H] += width * self.scale
예제 #2
0
 def dobackground(self):
     if self.did(self.dobackground):
         return
     if self.backgroundattrs is not None:
         self.draw(
             path.rect_pt(self.xpos_pt, self.ypos_pt, self.width_pt,
                          self.height_pt), self.backgroundattrs)
예제 #3
0
    def putrule(self, height, width, advancepos, fontmap):
        self.flushtext(fontmap)
        x1 = self.pos[_POS_H] * self.pyxconv
        y1 = -self.pos[_POS_V] * self.pyxconv
        w = width * self.pyxconv
        h = height * self.pyxconv

        if height > 0 and width > 0:
            if self.debug:
                self.debugfile.write(
                    "%d: %srule height %d, width %d (???x??? pixels)\n"
                    % (self.filepos, advancepos and "set" or "put", height, width)
                )
            self.actpage.fill(path.rect_pt(x1, y1, w, h))
        else:
            if self.debug:
                self.debugfile.write(
                    "%d: %srule height %d, width %d (invisible)\n"
                    % (self.filepos, advancepos and "set" or "put", height, width)
                )

        if advancepos:
            if self.debug:
                self.debugfile.write(" h:=%d+%d=%d, hh:=???\n" % (self.pos[_POS_H], width, self.pos[_POS_H] + width))
            self.pos[_POS_H] += width * self.scale
예제 #4
0
 def dobackground(self):
     if self.did(self.dobackground):
         return
     if self.backgroundattrs is not None:
         self.layer("background").draw(path.rect_pt(self.xpos_pt, self.ypos_pt, self.width_pt, self.height_pt),
                                       self.backgroundattrs)