Welcome to PageBot’s documentation!

What is PageBot?

PageBot® is a scriptable page layout, vector graphics and typography environment that enables designers to create high quality documents in various print-ready and web-based formats. It is available as a Python library with multi-platform support based on Flat and as a Mac OS X extension that uses DrawBot.

PageBot consists of three abstraction levels:

  • Builders, the libraries and formats PageBot usesto generate the final result, for example DrawBot, Flat and markup languages.
  • Contexts that provide a fixed API for the builders.
  • Documents, Views and Elements, our format independent classes.

The official PageBot documentation can be found at pagebot.io.

Installation

Pagebot runs on Python 3. We recommend updating to version 3.7 / 3.8.

System Wide

Cross platform installation:

pip install pagebot

Upgrade to the latest if already installed:

pip install pagebot --upgrade

Virtual Environment

To setup pagebot and its requirements in a virtual environment:

pip install virtualenv
mkdir ~/virtualenvironment
virtualenv ~/virtualenvironment/pagebot
cd ~/virtualenvironment/pagebot/bin
source activate
pip install pagebot

Mac OS X

pip install pagebotosx

See also github.com/PageBot/PageBotOSX.

Usage

from pagebot.document import Document
from pagebot.elements import newRect
from pagebot.conditions import Center2Center, Middle2Middle
from pagebot.toolbox.units import pt
from pagebot.toolbox.color import color

W, H = pt(500, 400)
doc = Document(w=W, h=H, autoPages=1)
page = doc[1]

# Create a new rectangle element with position conditions
newRect(parent=page, fill=color('red'), size=pt(240, 140),
    # Show measure lines on the element.
    showDimensions=True, 
    conditions=[Center2Center(), Middle2Middle()])
# Make the page apply all conditions.
page.solve() 
# Export the document page as png, so it shows as web image.
doc.export('_export/RedSquare.png') 

Issue Tracking

Bugs, enhancements and requested features can be added to the GitHub issue tracker:

Feature Description

Current Functionality

Current features include:

  • Various types of Element objects can be placed on a page or inside other Element objects.
  • Grids can be defined through style measurements and views.
  • Page templates (or templates for any other element combination) can be defined and applied.
  • Automatic layout conditions for elements, for example even distribution across or floating down parent elements.
  • Specialized views on a Document, such as plain pages, spreads and other layout of page groups, optional with crop-marks, registration-mark, color-strips, file name, etc. The result of all views can be placed on pages as illustration.
  • Graphics - using all Drawbot drawing tools.
  • All image filtering supplied by Drawbot ImageObject.
  • Cascading styles, where Element values inherit from parent Elements, similar to CSS behavior.
  • Text flows are using the macOS FormattedString for all typographic parameters.
  • Random Text generator for headlines and articles.
  • Read text from MarkDown and XML (.MD .XML)
  • Support large amount of text processing functions:
    • centered, left, right and justified
    • Text to fit a box and elastic box to fit text
    • Tabular setting
    • Text Flow from one element to another.
    • Variable Font UI access and instance creation based on fontTools
    • Access to font metrics.
    • Outline Font access modification.
    • Space, groups and kerning access and modifcation.
    • OT layout and feature access and modification.
  • 3D Positioning of points, for future usage.
  • Motion Graphics, export as animated .gif and .mov files, keyframing timeline,
  • Export to PDF, PNG, JPG, SVG, (animated) GIF, MOV, XML, through programmable views.
  • Build web sites, pre-compiling all images used into the formats that can be displayed by browsers (.PNG .JPG .SVG)
  • Automatic table of contents, image references, quote references, etc. from composed documents.

Types of Publications

  • PageBot stationary and publications as scripted templates
  • Specimens for TN library
  • Recreation of legacy type specimens as PageBot templates
  • Magazines
  • Newspapers
  • Newsletters
  • Books
  • Parametric corporate identities including their styleguides, stationary and business card templates.
  • Parametric advertizements (connecting to existing ad-systems)
  • Online documents, such as single page websites
  • Wayfindng templates for signs and maps
  • T-Shirt templates
  • Templates with embedded information for graphic- and typographic education.

Unit Testing

PageBot uses Python’s native doctest library to perform unit tests:

Note: doctest can be run in Sublime with cmd-B

Future Developments

  • Element classes supporting various types of graphs, info-graphics, maps, PageBot document layout, Variable Font axes layout, font metrics.
  • Font class supporting CFF (.otf) and UFO.
  • Views for thumbnail page overview, combined booklet-sheets for print, site-maps, etc.
  • Add export of text to MarkDown .md files.
  • Add export to online documents, such as HTML/CSS/JS for specific designs of web pages, such as Kirby.
  • Export to WordPress® PHP sites.
  • Export to Ruby®/Sketchup® data files.
  • Add export to Angular® files.
  • Export to InDesign® and Illustrator®, as close as possible translating PageBot elements to the native file format of these applications.
  • Time line, definition and editing, length and fps.
  • Integrate the PageBot manual builder with other export functions of the library.
  • Add more unit-tests to guarantee the integrity of the library and output consistency.
  • Automatic support of ornament frames, in connection to the Element borders and the layout of exiting (TN) border fonts.

Licencing

  • The core library, tutorials and basic examples for PageBot are available under the MIT Open Source license. Some depencendies have been included in this repository and are available under their own licenses. See also the LICENSE.
PageBot® is a registered trademark U.S. Serial Number: 87-457,280 Owner: Buro Petr van Blokland + Claudia Mens VOF Docket/Reference Number: 1538-25}{

Getting started

  • Download the latest DrawBot

  • Some experience with DrawBot is recommended. Otherwise examine DrawBot Documentation

  • Install PageBot (from terminal)

      pip install pagebot
    
  • Run the following code in DrawBot. It should not give an error.

      import pagebot
    

Hello World

from pagebot.document import Document
from pagebot.elements import newText
from pagebot.fonttoolbox.objects.font import findFont

f = findFont('Roboto-Bold')
doc = Document(w=800, h=190) 
page = doc[1] 
newText('Hello World', x=30, y=0, font=f, fontSize=140, 
    textFill=0.2, parent=page)
doc.export('_export/HelloWorld.png') 

_images/HelloWorld_1.png

Calendar Publication

PageBot includes a lot of knowledge about design, embedded in default publication types.

from pagebot.publications.calendars import BaseCalendar

PageBot’s relation with DrawBot

The main difference between DrawBot and PageBot, is that in DrawBot all drawing instructions are executed directly on the canvas.

Instead, PageBot keeps all page elements alive, which allows adjustments in composition on an entire document, before exposing it to the canvas. In other words, PageBot is using DrawBot as “typesetting” canvas to expose finished pages and elements.

This gives access to all functions of DrawBot, while adding a lot of knowledge about publication styles, page composition, the content of fonts, related typographic values and color themes.

Contexts

PageBot supports “contexts”, and DrawBot is one of them. But other contexts are available, such as FlatContext and HtmlContext, to export document formats that DrawBot does not support, or in situations where DrawBot is not available (e.g. on a Linux web server).

pagebot

pagebot package

Subpackages

pagebot.base package
Submodules
pagebot.base.article module
pagebot.base.composer module
pagebot.base.typesetter module
Module contents
pagebot.conditions package
Submodules
pagebot.conditions.align module
pagebot.conditions.columns module
pagebot.conditions.condition module
pagebot.conditions.floating module
pagebot.conditions.flow module
pagebot.conditions.score module
pagebot.conditions.text module
Module contents
pagebot.contexts package
Subpackages
pagebot.contexts.basecontext package
Submodules
pagebot.contexts.basecontext.abstractcontext module
pagebot.contexts.basecontext.babelrun module
pagebot.contexts.basecontext.babelstring module
pagebot.contexts.basecontext.basebeziercontour module
pagebot.contexts.basecontext.basebezierpath module
pagebot.contexts.basecontext.basebezierpoint module
pagebot.contexts.basecontext.basebeziersegment module
pagebot.contexts.basecontext.basebuilder module
pagebot.contexts.basecontext.basecontext module
pagebot.contexts.basecontext.baseimageobject module
pagebot.contexts.basecontext.beziercontour module
pagebot.contexts.basecontext.bezierpath module
Module contents
pagebot.contexts.flatcontext package
Submodules
pagebot.contexts.flatcontext.flatbezierpath module
pagebot.contexts.flatcontext.flatbuilder module
pagebot.contexts.flatcontext.flatcontext module
Module contents
pagebot.contexts.markup package
Submodules
pagebot.contexts.markup.htmlbuilder module
pagebot.contexts.markup.htmlcontext module
pagebot.contexts.markup.sitebuilder module
pagebot.contexts.markup.svgbuilder module
pagebot.contexts.markup.svgcontext module
pagebot.contexts.markup.xmlbuilder module
Module contents
pagebot.contexts.sketchcontext package
Submodules
pagebot.contexts.sketchcontext.sketchbuilder module
pagebot.contexts.sketchcontext.sketchcontext module
Module contents
Module contents
pagebot.contributions package
Subpackages
pagebot.contributions.adobe package
Subpackages
pagebot.contributions.adobe.kerndump package
Submodules
pagebot.contributions.adobe.kerndump.dumpKerningFeatureFromOTF module
pagebot.contributions.adobe.kerndump.getKerningPairsFromOTF module
Module contents
Module contents
pagebot.contributions.filibuster package
Subpackages
pagebot.contributions.filibuster.content package
Submodules
pagebot.contributions.filibuster.content.aerospace module
pagebot.contributions.filibuster.content.articles module
pagebot.contributions.filibuster.content.auction module
pagebot.contributions.filibuster.content.automotive module
pagebot.contributions.filibuster.content.book_reference module
pagebot.contributions.filibuster.content.boymechanic module
pagebot.contributions.filibuster.content.classified module
pagebot.contributions.filibuster.content.commercial module
pagebot.contributions.filibuster.content.corporate module
pagebot.contributions.filibuster.content.creditcard module
pagebot.contributions.filibuster.content.design module
pagebot.contributions.filibuster.content.designarticle module
pagebot.contributions.filibuster.content.entertainment module
pagebot.contributions.filibuster.content.event module
pagebot.contributions.filibuster.content.filenames module
pagebot.contributions.filibuster.content.filibuster module
pagebot.contributions.filibuster.content.financial module
pagebot.contributions.filibuster.content.general module
pagebot.contributions.filibuster.content.geography module
pagebot.contributions.filibuster.content.horoscope module
pagebot.contributions.filibuster.content.internet module
pagebot.contributions.filibuster.content.jargon module
pagebot.contributions.filibuster.content.journalism module
pagebot.contributions.filibuster.content.legalese module
pagebot.contributions.filibuster.content.letterror module
pagebot.contributions.filibuster.content.literature module
pagebot.contributions.filibuster.content.living module
pagebot.contributions.filibuster.content.medical module
pagebot.contributions.filibuster.content.modernmedia module
pagebot.contributions.filibuster.content.music module
pagebot.contributions.filibuster.content.names module
pagebot.contributions.filibuster.content.navigation module
pagebot.contributions.filibuster.content.news module
pagebot.contributions.filibuster.content.politics module
pagebot.contributions.filibuster.content.portal module
pagebot.contributions.filibuster.content.quotations module
pagebot.contributions.filibuster.content.realestate module
pagebot.contributions.filibuster.content.reviews module
pagebot.contributions.filibuster.content.sciences module
pagebot.contributions.filibuster.content.siliconvalley module
pagebot.contributions.filibuster.content.sports module
pagebot.contributions.filibuster.content.staff module
pagebot.contributions.filibuster.content.stylewars module
pagebot.contributions.filibuster.content.superheroes module
pagebot.contributions.filibuster.content.twitter module
Module contents
Submodules
pagebot.contributions.filibuster.blurb module
pagebot.contributions.filibuster.blurbwriter module
pagebot.contributions.filibuster.example module
pagebot.contributions.filibuster.samplecontent module
pagebot.contributions.filibuster.test module
pagebot.contributions.filibuster.titlecase module
Module contents
pagebot.contributions.markdown package
Submodules
pagebot.contributions.markdown.footnotes module
pagebot.contributions.markdown.inline module
pagebot.contributions.markdown.literature module
Module contents
Module contents
pagebot.elements package
Subpackages
pagebot.elements.dating package
Submodules
pagebot.elements.dating.calendarmonth module
Module contents
pagebot.elements.designspacegraph package
Submodules
pagebot.elements.designspacegraph.designspacegraph module
pagebot.elements.designspacegraph.designspacegraph1 module
pagebot.elements.designspacegraph.designspacegraph2 module
pagebot.elements.designspacegraph.designspacegraph3 module
pagebot.elements.designspacegraph.designspacegraph4 module
pagebot.elements.designspacegraph.designspacegraph5 module
pagebot.elements.designspacegraph.designspacegraph6 module
pagebot.elements.designspacegraph.designspacegrapharrows module
pagebot.elements.designspacegraph.designspacegraphblackbows module
pagebot.elements.designspacegraph.designspacegraphworking module
Module contents
pagebot.elements.newspapers package
Submodules
pagebot.elements.newspapers.articles module
pagebot.elements.newspapers.headers module
Module contents
pagebot.elements.ui package
Module contents
pagebot.elements.variablefonts package
Submodules
pagebot.elements.variablefonts.animationframe module
pagebot.elements.variablefonts.basefontshow module
pagebot.elements.variablefonts.bezieranimation module
pagebot.elements.variablefonts.bio module
pagebot.elements.variablefonts.cube module
pagebot.elements.variablefonts.fittowidth module
pagebot.elements.variablefonts.fonticon module
pagebot.elements.variablefonts.glyphdimensions module
pagebot.elements.variablefonts.glyphset module
pagebot.elements.variablefonts.paragraphs module
pagebot.elements.variablefonts.sampler module
pagebot.elements.variablefonts.specimen module
pagebot.elements.variablefonts.stacked module
pagebot.elements.variablefonts.title module
pagebot.elements.variablefonts.typeramps module
pagebot.elements.variablefonts.variablecircle module
pagebot.elements.variablefonts.variablecube module
pagebot.elements.variablefonts.variablecube2 module
pagebot.elements.variablefonts.variableglyphs module
pagebot.elements.variablefonts.variablescatter module
pagebot.elements.variablefonts.waterfall module
pagebot.elements.variablefonts.widths module
Module contents
pagebot.elements.views package
Submodules
pagebot.elements.views.baseview module
pagebot.elements.views.gitview module
pagebot.elements.views.googleappsview module
pagebot.elements.views.googlecloudview module
pagebot.elements.views.htmlview module
pagebot.elements.views.mampview module
pagebot.elements.views.mapview module
pagebot.elements.views.pageview module
pagebot.elements.views.siteview module
Module contents
pagebot.elements.web package
Subpackages
pagebot.elements.web.barebonesslider package
Submodules
pagebot.elements.web.barebonesslider.siteelements module
Module contents
pagebot.elements.web.nanosite package
Submodules
pagebot.elements.web.nanosite.siteelements module
Module contents
pagebot.elements.web.simplesite package
Submodules
pagebot.elements.web.simplesite.siteelements module
Module contents
pagebot.elements.web.ui package
Submodules
pagebot.elements.web.ui.slide module
Module contents
Module contents
Submodules
pagebot.elements.alignments module
pagebot.elements.artboard module
pagebot.elements.beziercurve module
pagebot.elements.bezierpaths module
pagebot.elements.circle module
pagebot.elements.clippath module
pagebot.elements.codeblock module
pagebot.elements.conditions module
pagebot.elements.docwrap module
pagebot.elements.element module
pagebot.elements.flow module
pagebot.elements.galley module
pagebot.elements.glyphpath module
pagebot.elements.group module
pagebot.elements.image module
pagebot.elements.image2 module
pagebot.elements.imagedata module
pagebot.elements.imaging module
pagebot.elements.line module
pagebot.elements.mask module
pagebot.elements.oval module
pagebot.elements.page module
pagebot.elements.placer module
pagebot.elements.polygon module
pagebot.elements.quire module
pagebot.elements.rect module
pagebot.elements.ruler module
pagebot.elements.showings module
pagebot.elements.shrinking module
pagebot.elements.table module
pagebot.elements.template module
pagebot.elements.text module
pagebot.elements.textalignments module
pagebot.elements.textconditions module
Module contents
pagebot.fonttoolbox package
Subpackages
pagebot.fonttoolbox.analyzers package
Submodules
pagebot.fonttoolbox.analyzers.acomponent module
pagebot.fonttoolbox.analyzers.acontour module
pagebot.fonttoolbox.analyzers.apoint module
pagebot.fonttoolbox.analyzers.apointcontext module
pagebot.fonttoolbox.analyzers.apointcontextlist module
pagebot.fonttoolbox.analyzers.asegment module
pagebot.fonttoolbox.analyzers.fontanalyzer module
pagebot.fonttoolbox.analyzers.glyphanalyzer module
pagebot.fonttoolbox.analyzers.stems module
Module contents
pagebot.fonttoolbox.designspace package
Submodules
pagebot.fonttoolbox.designspace.axis module
pagebot.fonttoolbox.designspace.designspace module
pagebot.fonttoolbox.designspace.dsmodel module
pagebot.fonttoolbox.designspace.fontinfo module
pagebot.fonttoolbox.designspace.location module
Module contents
pagebot.fonttoolbox.objects package
Submodules
pagebot.fonttoolbox.objects.family module
pagebot.fonttoolbox.objects.font module
pagebot.fonttoolbox.objects.fontinfo module
pagebot.fonttoolbox.objects.glyph module
pagebot.fonttoolbox.objects.prevarfamily module
Module contents
pagebot.fonttoolbox.unicodes package
Submodules
pagebot.fonttoolbox.unicodes.unicoderanges module
pagebot.fonttoolbox.unicodes.unicoderangesdata module
Module contents
Submodules
pagebot.fonttoolbox.fontnames module
pagebot.fonttoolbox.fontpaths module
pagebot.fonttoolbox.variablefontaxes module
pagebot.fonttoolbox.variablefontbuilder module
Module contents
pagebot.mathematics package
Submodules
pagebot.mathematics.transform3d module
Module contents
pagebot.readers package
Submodules
pagebot.readers.mdreader module
pagebot.readers.rereader module
pagebot.readers.xmlreader module
Module contents
pagebot.resources package
Subpackages
pagebot.resources.color package
Module contents
pagebot.resources.images package
Module contents
pagebot.resources.languages package
Module contents
pagebot.resources.sketch package
Subpackages
pagebot.resources.sketch.Base_images package
Module contents
pagebot.resources.sketch.TemplateSquare_images package
Module contents
pagebot.resources.sketch.TemplateText_images package
Module contents
pagebot.resources.sketch.Template_images package
Module contents
Module contents
pagebot.resources.templates package
Module contents
pagebot.resources.testfonts package
Subpackages
pagebot.resources.testfonts.djr package
Subpackages
pagebot.resources.testfonts.djr.bungee package
Module contents
Module contents
pagebot.resources.testfonts.fontbureau package
Module contents
pagebot.resources.testfonts.google package
Subpackages
pagebot.resources.testfonts.google.roboto package
Subpackages
pagebot.resources.testfonts.google.roboto.axes package
Module contents
Module contents
Module contents
pagebot.resources.testfonts.typetr package
Module contents
Module contents
pagebot.resources.texts package
Module contents
Module contents
pagebot.server package
Subpackages
pagebot.server.tornadoserver package
Submodules
pagebot.server.tornadoserver.baseserver module
Module contents
Submodules
pagebot.server.adserver module
pagebot.server.flaskapp module
Module contents
pagebot.themes package
Submodules
pagebot.themes.backtothecity module
pagebot.themes.basetheme module
pagebot.themes.businessasusual module
pagebot.themes.fairytales module
pagebot.themes.freshandshiny module
pagebot.themes.happyholidays module
pagebot.themes.intothewoods module
pagebot.themes.seasoningthedish module
pagebot.themes.somethingintheair module
pagebot.themes.wordlywise module
Module contents
pagebot.toolbox package
Submodules
pagebot.toolbox.color module
pagebot.toolbox.columncalc module
pagebot.toolbox.dating module
pagebot.toolbox.drawing module
pagebot.toolbox.finder module
pagebot.toolbox.hyphenation module
pagebot.toolbox.loremipsum module
pagebot.toolbox.markers module
pagebot.toolbox.timemark module
pagebot.toolbox.transformer module
pagebot.toolbox.units module
Module contents
pagebot.web package
Submodules
pagebot.web.basesite module
Module contents

Submodules

pagebot.constants module

pagebot.document module

pagebot.errors module

pagebot.filepaths module

pagebot.gradient module

pagebot.publication module

pagebot.style module

pagebot.stylelib module

Module contents

Indices and tables