Skip to content

djrrb/drawbotlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drawbotlab

Some helpers for DrawBot that I tend to use and reuse. I used to just copy/paste these things into my drawbot scripts, but it seems cleaner to just call them and use them like this:

from drawbotlab.color import RGBColor
from drawbotlab.shape import roundedRect
myBlue = RGBColor(b=1)
myBlue.setFill()
roundedRect(50, 50, 200, 100, r=20)

Requires an installation of the python drawBot library (from drawBot import *). The glyph module requires RoboFab and fontTools.

Drawbotlab doesn't have an installer or anything like that. To use it, simply place the folder, or a pth file pointing to the folder, in your Python site-packages.

What’s inside?

Color

  • RGBColor and CMYKColor objects, for easy color definition and selection.
  • Genericized fillColor() and strokeColor() functions, that accept color objects, RGB tuples, or CMYK tuples

Glyph

  • DrawBot pen for converting from robofab glyph
  • drawGlyph(), which acts like the function in the DrawBot RoboFont Extension
  • ufoText(), which acts like Drawbot's native text() but draws from a robofab font
  • ufoTextSize(), which gets the dimensions of a UFO-based textblock

Shape

  • roundedRect(x, y, width, height, [radius, curvature]), which acts like rect() but less pointy!

Math

About

Some helpers for drawBot.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages