当前位置: 首页>>代码示例>>Python>>正文


Python basePen.BasePen类代码示例

本文整理汇总了Python中fontTools.pens.basePen.BasePen的典型用法代码示例。如果您正苦于以下问题:Python BasePen类的具体用法?Python BasePen怎么用?Python BasePen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BasePen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, glyphSet, optimise=False):
     BasePen.__init__(self, glyphSet)
     self._commands = []
     self._lastCommand = None
     self._lastX = None
     self._lastY = None
     self.optimise = optimise
开发者ID:sannorozco,项目名称:responsiveLettering,代码行数:7,代码来源:mathImageSVGPathPen.py

示例2: __init__

	def __init__(self, otherPen, selected = [], *splits ):
		BasePen.__init__(self, {})
		self.otherPen = otherPen
		self.currentPt = None
		self.firstPt = None
		self.selected = selected
		self.splits = splits
开发者ID:mcguffin,项目名称:SplitBezier,代码行数:7,代码来源:SplitBezier.py

示例3: __init__

    def __init__(self, glyphSet, bounds, moveSegment=(0, 0)):
        BasePen.__init__(self, glyphSet)

        self.allSegments = set()
        self.segments = set()
        self.bounds = bounds
        self.moveSegment = moveSegment
开发者ID:andreirobu,项目名称:Touche,代码行数:7,代码来源:findPossibleOverlappingSegmentsPen.py

示例4: __init__

 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
开发者ID:420peacemaker,项目名称:roboto,代码行数:7,代码来源:curveFitPen.py

示例5: __init__

	def __init__(self, glyphSet, x, y, scale, pathobject):
		BasePen.__init__(self, glyphSet)
		self.scale = scale

		self.pathobject = pathobject
		self.x = x
		self.y = y
开发者ID:yanone,项目名称:ynlib,代码行数:7,代码来源:pens.py

示例6: __init__

    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

        """
开发者ID:sugarlabs,项目名称:edit-fonts-activity,代码行数:27,代码来源:gtkpen.py

示例7: __init__

    def __init__(self, glyphSet, path=None):
        BasePen.__init__(self, glyphSet)
        if path is None:
            from PyQt5.QtGui import QPainterPath

            path = QPainterPath()
        self.path = path
开发者ID:Mortimer2013,项目名称:Emoji-Tools,代码行数:7,代码来源:qtPen.py

示例8: __init__

 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
开发者ID:robofab-developers,项目名称:fontPens,代码行数:7,代码来源:flattenPen.py

示例9: __init__

    def __init__(self, glyphSet, path=None):
        BasePen.__init__(self, glyphSet)
        if path is None:
            from AppKit import NSBezierPath

            path = NSBezierPath.bezierPath()
        self.path = path
开发者ID:Mortimer2013,项目名称:Emoji-Tools,代码行数:7,代码来源:cocoaPen.py

示例10: __init__

	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
开发者ID:SayCV,项目名称:tools-FDK,代码行数:8,代码来源:filterPen.py

示例11: __init__

 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
开发者ID:jenskutilek,项目名称:TypoLabs2016,代码行数:8,代码来源:20+HPGL+Converter.py

示例12: __init__

	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
开发者ID:SayCV,项目名称:tools-FDK,代码行数:8,代码来源:marginPen.py

示例13: __init__

 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
开发者ID:asaumierdemers,项目名称:BroadNibBackground,代码行数:8,代码来源:BroadNibBackground.py

示例14: __init__

	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
开发者ID:MrBrezina,项目名称:fonttools,代码行数:9,代码来源:momentsPen.py

示例15: __init__

	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
开发者ID:anthrotype,项目名称:fonttools,代码行数:10,代码来源:perimeterPen.py


注:本文中的fontTools.pens.basePen.BasePen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。