Code Monkey home page Code Monkey logo

drawbot-skia's People

Contributors

jansindl3r avatar jenskutilek avatar justvanrossum avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drawbot-skia's Issues

Dependency issues

First, pillow is required to run the test suite and doesn't seem to be mentioned as a test dependency anywhere. I must be blind, it's right there in requirements-dev.txt.

Second it seems numpy should be listed as a test dependency, not as a regular dependency. It is used directly for tests. I looked through the skip-python code based and it seems the same there, it is never used directly in the library but it is used for the test suite. As such they seem to have it specified properly and the only improper thing is where this shows up and moving it to test deps would be appropriate:

"numpy", # unlisted skia-python dependency, TODO: is this true?

Error while import drawbot_skia

Hi! I just installed Drawbot Skia and I got this error:

Traceback (most recent call last):
  File "./test.py", line 3, in <module>
    from drawbot_skia.drawbot import *
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/drawbot_skia/drawbot.py", line 1, in <module>
    from .drawing import Drawing
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/drawbot_skia/drawing.py", line 4, in <module>
    import skia
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/skia.cpython-37m-darwin.so, 2): Symbol not found: _XML_ErrorString
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/skia.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/skia.cpython-37m-darwin.so

This is my script

from drawbot_skia.drawbot import *

rect(100, 100, 100, 100)
saveImage('test.jpeg')

And I runned it with python ./test.py

Am I doing something wrong? Iโ€™m on OS: Mac Os Mojave 10.14.6

drawbot-skia and Django

Hey Just, this kind of left field. I have ported some drawbot code to drawbot-skia for use on a website. I use Django as my webserver. When I run the drawbot-skia code through a Django view and get it to output a skia SVG, it will output the file. Reload the page and it will output another file with a number variation. Reload again and it just keeps going. If I manually delete those files and reload the page. All the files that I have deleted are but back. Do this too quickly and you get the following warning:

drawbot_skia.errors.DrawbotError: size() can't be called if there's already a canvas active

It is odd that it is saying the canvas is still active even thought there is del canvas in the _def saveImage_svg()

I feel that this file behaviour has something to do with the FILEWStream part. Like it leaves the stream open or something. Because the underlying python-skia library is in C it is impossible for me to figure out what is going on. Outside of Django this works fine.

So I know this is a vague question but have you seen this behaviour before? Any idea why it might be doing this? Ultimately I would just like to grab the SVG and put it in the HTML page.

Talk soon, Maarten

newPage() requires arguments

newPage() requires argument, though mac's drawbot doesn't. This breaks compatibility of code that can be shared in class for both drawbot app and drawbot-skia. Is it intentional? Can I make a PR?

drawBot compatibility test

would writing tests checking stuff like these between drawbot-skia and drawbot be desirable?

rect.__code__.co_argcount
rect.__defaults__
rect.__code__.co_varnames

if yes, I would like to do it!

tracking supported?

i miss the tracking method to work with text, as described in drawbot://www.drawbot.com/_downloads/tracking.py
are there any plans to implement it?
or is it already implemented under a different name?

integration in jupyter notebook?

hi and thanks for the great work. i installed it yesterday on debian and everything seems to work well.

is there any way to integrate it in a jupyter notebook, as it is the case for the matplotlib? or what is your normal workflow in coding and watching the result?

cheers -
joachim

blendMode SVG looks wrong

the svg output of blendMode is quite different from the other outputs, and looks wrong.
it happens on rendering for me, and is the same in the apitests_expected_output.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

The subset of Drawbot that is currently supported

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

functions not possible?

i cannot get functions to use, for instance:

def myline(x1,y1,x2,y2):
line((x1,x2),(y1,y2))

size(700,250)
myline(100,100,200,50)

no error, but also no output.

i also tried different variants, like:

def myline(x1,y1,x2,y2):
path = BezierPath()
path.line((x1,y1),(x2,y2))
path.closePath()
drawPath(path)

am i missing anything, or is this simply not supposed to work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.