justvanrossum / drawbot-skia

A cross-platform subset of the DrawBot drawing API, using Skia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The subset of Drawbot that is currently supported

justvanrossum opened this issue · comments

Currently supported Drawbot functions:

  • size(width, height)
  • newPage(width, height)
  • frameDuration(duration)
  • width()
  • height()
  • rect(x, y, w, h)
  • oval(x, y, w, h)
  • line(pt1, pt2)
  • polygon(firstPoint, *points, close=True)
  • drawPath(path)
  • clipPath(path)
  • fill(*args)
  • stroke(*args)
  • strokeWidth(value)
  • lineCap(lineCap)
  • lineJoin(lineJoin)
  • lineDash(firstValue, *values)
  • blendMode(blendMode)
  • miterLimit(miterLimit)
  • linearGradient(...)
  • radialGradient(...) limited to a single center point and a zero start radius
  • font(fontNameOrPath, fontSize=None)
  • fontSize(size)
  • openTypeFeatures(*, resetFeatures=False, **features)
  • fontVariations(*, resetVariations=False, **variations)
  • textSize(txt)
  • language(language)
  • text(txt, position, align=None) single line, single style only for now
  • image(imagePath, position, alpha=1.0) limited to pixel formats, PDF is not supported
  • translate(x, y)
  • rotate(angle, center=(0, 0))
  • scale(sx, sy=None, center=(0, 0))
  • skew(sx, sy=0, center=(0, 0))
  • transform(matrix, center=(0, 0))
  • savedState()
  • saveImage(fileName) currently limited to PNG, JPG, MP4 and PDF

BezierPath currently supports:

  • path.moveTo(pt)
  • path.lineTo(pt)
  • path.curveTo(pt1, pt2, pt3, *pts)
  • path.qCurveTo(pt1, pt2, *pts)
  • path.arc(center, radius, startAngle, endAngle, clockwise)
  • path.arcTo(point1, point2, radius)
  • path.closePath()
  • path.endPath() segment pen method / point pen method
  • path.beginPath() point pen method
  • path.addPoint(...) point pen method
  • path.rect(x, y, w, h)
  • path.oval(x, y, w, h)
  • path.polygon(firstPoint, *points, close=True)
  • path.text(txt, ...)
  • path.pointInside(point)
  • path.bounds()
  • path.controlPointBounds()
  • path.appendPath(other)
  • path.copy()
  • path.reverse()
  • path.translate(x, y)
  • path.scale(x, y=None, center=(0, 0))
  • path.rotate(angle, center=(0, 0))
  • path.skew(x, y=0, center=(0, 0))
  • path.transform(transform, center=(0, 0))
  • path.drawToPen(pen)
  • path.drawToPointPen(pen)
  • path.removeOverlap()
  • path.union(other) and path.__or__(other)
  • path.intersection(other) and path.__and__(other)
  • path.difference(other) and path.__mod__(other)
  • path.xor(other) and path.__xor__(other)

For an overview of changes and additions per release, see https://github.com/justvanrossum/drawbot-skia/blob/master/CHANGELOG.md