本文整理汇总了Python中fontTools.pens.basePen.BasePen.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BasePen.__init__方法的具体用法?Python BasePen.__init__怎么用?Python BasePen.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fontTools.pens.basePen.BasePen
的用法示例。
在下文中一共展示了BasePen.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, optimise=False):
BasePen.__init__(self, glyphSet)
self._commands = []
self._lastCommand = None
self._lastX = None
self._lastY = None
self.optimise = optimise
示例2: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, otherPen, selected = [], *splits ):
BasePen.__init__(self, {})
self.otherPen = otherPen
self.currentPt = None
self.firstPt = None
self.selected = selected
self.splits = splits
示例3: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, bounds, moveSegment=(0, 0)):
BasePen.__init__(self, glyphSet)
self.allSegments = set()
self.segments = set()
self.bounds = bounds
self.moveSegment = moveSegment
示例4: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, otherPen, resolution=25):
BasePen.__init__(self,glyphSet)
self.resolution = resolution
self.otherPen = otherPen
self.subsegments = []
self.startContour = (0,0)
self.contourIndex = -1
示例5: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, x, y, scale, pathobject):
BasePen.__init__(self, glyphSet)
self.scale = scale
self.pathobject = pathobject
self.x = x
self.y = y
示例6: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, cr, pos, id='EDITOR', scale=1.0):
BasePen.__init__(self, glyphSet={})
self.cr = cr
self.id = id
# the position the glyph is at while drawing it in a string of glyphs
self.pos = pos
self.glyph = globals.GLYPH_BOX[self.id]['glyph']
self.font = self.glyph.font
# The advance width of the glyph
self.w = H = self.glyph.width
# The difference in the ascender and the descender values
self.h = self.font.info.ascender - self.font.info.descender
# the distance between the baseline and the descender
self.b = 0 - self.font.info.descender
# the scale of the drawing
self.scale = scale
H = globals.GLYPH_BOX[self.id]['height'] # noqa
W = globals.GLYPH_BOX[self.id]['width'] # noqa
"""
示例7: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, path=None):
BasePen.__init__(self, glyphSet)
if path is None:
from PyQt5.QtGui import QPainterPath
path = QPainterPath()
self.path = path
示例8: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, otherPen, steps=10, filterDoubles=True):
BasePen.__init__(self, {})
self.otherPen = otherPen
self.currentPt = None
self.firstPt = None
self.steps = steps
self.filterDoubles = filterDoubles
示例9: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, path=None):
BasePen.__init__(self, glyphSet)
if path is None:
from AppKit import NSBezierPath
path = NSBezierPath.bezierPath()
self.path = path
示例10: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, otherPen, approximateSegmentLength=5, segmentLines=False, filterDoubles=True):
self.approximateSegmentLength = approximateSegmentLength
BasePen.__init__(self, {})
self.otherPen = otherPen
self.currentPt = None
self.firstPt = None
self.segmentLines = segmentLines
self.filterDoubles = filterDoubles
示例11: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, scale=1):
BasePen.__init__(self, glyphSet)
self._scale = scale
self._init_seq = self._get_init_sequence()
self._hpgl = ""
self._end_seq = self._get_end_sequence()
self._pen_down = False
self._prev_segment = None
示例12: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, value, isHorizontal=True):
BasePen.__init__(self, glyphSet)
self.value = value
self.hits = {}
self.filterDoubles = True
self.contourIndex = None
self.startPt = None
self.isHorizontal = isHorizontal
示例13: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphSet, step, width, height, angle, shape):
BasePen.__init__(self, glyphSet)
self.step = step
self.width = width
self.height = height
self.angle = angle
self.shape = shape
self.firstPoint = None
示例14: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphset=None):
BasePen.__init__(self, glyphset)
self.area = 0
self.momentX = 0
self.momentY = 0
self.momentXX = 0
self.momentXY = 0
self.momentYY = 0
示例15: __init__
# 需要导入模块: from fontTools.pens.basePen import BasePen [as 别名]
# 或者: from fontTools.pens.basePen.BasePen import __init__ [as 别名]
def __init__(self, glyphset=None, tolerance=0.005):
BasePen.__init__(self, glyphset)
self.value = 0
self._mult = 1.+1.5*tolerance # The 1.5 is a empirical hack; no math
# Choose which algorithm to use for quadratic and for cubic.
# Quadrature is faster but has fixed error characteristic with no strong
# error bound. The cutoff points are derived empirically.
self._addCubic = self._addCubicQuadrature if tolerance >= 0.0015 else self._addCubicRecursive
self._addQuadratic = self._addQuadraticQuadrature if tolerance >= 0.00075 else self._addQuadraticExact