Exemple #1
0
 def __init__(self, bbox):
     LTComponent.__init__(self, bbox)
     self._chars = []
     self._figs = []
     self._curves = []
     self.type = None
     self.font = None
     return
Exemple #2
0
 def __init__(self, baseline, font):
     LTComponent.__init__(self, (+INF, +INF, -INF, -INF))
     self._chars = []
     self._text = []
     self.baseline = baseline
     self.font = font
     self.type = None
     return
Exemple #3
0
 def __init__(self,baseline,font):
     LTComponent.__init__(self, (+INF, +INF, -INF, -INF))
     self._chars   = []
     self._text    = []
     self.baseline = baseline
     self.font     = font
     self.type     = None
     return
Exemple #4
0
 def __init__(self, bbox):
     LTComponent.__init__(self, bbox)
     self._chars  = []
     self._figs   = []
     self._curves = []
     self.type = None
     self.font = None
     return
Exemple #5
0
    def __init__(self, network):
        if len(network) <= 2:
            raise self.EmptyTableError

        # construct rows and columns borders by distinct x and y's.
        self._rows_borders = sorted(list(
            set(point.y for point in network.points)))
        self._columns_borders = sorted(list(
            set(point.x for point in network.points)))

        LTComponent.__init__(self, (self._columns_borders[0],
                                    self._rows_borders[0],
                                    self._columns_borders[-1],
                                    self._rows_borders[-1]))

        self._cells = self._create_cells(network)
        self._elements = self._build_elements(self._cells)
Exemple #6
0
	def newLTCharInit(self, matrix, font, fontsize, scaling, rise,
				text, textwidth, textdisp):
		LTText.__init__(self)
		# Patched in line
		self.font = font
		self.fontsize = fontsize
		self._text = text
		self.matrix = matrix
		self.fontname = font.fontname
		self.adv = textwidth * fontsize * scaling
		# compute the boundary rectangle.
		if font.is_vertical():
			# vertical
			width = font.get_width() * fontsize
			(vx, vy) = textdisp
			if vx is None:
				vx = width//2
			else:
				vx = vx * fontsize * .001
			vy = (1000 - vy) * fontsize * .001
			tx = -vx
			ty = vy + rise
			bll = (tx, ty+self.adv)
			bur = (tx+width, ty)
		else:
			# horizontal
			height = font.get_height() * fontsize
			descent = font.get_descent() * fontsize
			ty = descent + rise
			bll = (0, ty)
			bur = (self.adv, ty+height)
		(a, b, c, d, e, f) = self.matrix
		self.upright = (0 < a*d*scaling and b*c <= 0)
		(x0, y0) = apply_matrix_pt(self.matrix, bll)
		(x1, y1) = apply_matrix_pt(self.matrix, bur)
		if x1 < x0:
			(x0, x1) = (x1, x0)
		if y1 < y0:
			(y0, y1) = (y1, y0)
		LTComponent.__init__(self, (x0, y0, x1, y1))
		if font.is_vertical():
			self.size = self.width
		else:
			self.size = self.height
		return
Exemple #7
0
 def __init__(self, bbox):
     LTComponent.__init__ (self, bbox)
     self.text_lines = []
Exemple #8
0
 def __init__(self, bbox, text):
     LTComponent.__init__ (self, bbox)
     self.text = text
Exemple #9
0
 def __init__(self, ltimage):
     assert(isinstance(ltimage, LTImage))
     LTComponent.__init__(self, ltimage.bbox)
     self._name = ltimage.name
     self._stream = ltimage.stream