Example #1
0
	def get_transformed_paths(self):
		ret = []
		for item in self.cache_cpath:
			if item:
				paths = libgeom.get_paths_from_glyph(item)
				if paths: ret += paths
		return ret
Example #2
0
	def to_curve(self):
		group = Group(self.config)
		subgroup = Group(self.config, group)
		for item in self.cache_cpath:
			paths = None
			if item: paths = libgeom.get_paths_from_glyph(item)
			if not paths:
				if len(subgroup.childs) == 1:
					subgroup.childs[0].parent = group
					group.childs.append(subgroup.childs[0])
					subgroup.childs = []
				elif len(subgroup.childs) > 1:
					subgroup.update()
					group.childs.append(subgroup)
					subgroup = Group(self.config, group)
			else:
				curve = Curve(self.config, group)
				curve.paths = paths
				curve.fill_trafo = [] + self.fill_trafo
				curve.stroke_trafo = []	 + self.stroke_trafo
				curve.style = deepcopy(self.style)
				curve.update()
				subgroup.childs.append(curve)

		if not subgroup in group.childs:
			if len(subgroup.childs) == 1:
				subgroup.childs[0].parent = group
				group.childs.append(subgroup.childs[0])
				subgroup.childs = []
			elif len(subgroup.childs) > 1:
				subgroup.update()
				group.childs.append(subgroup)

		group.update()
		return group