# Made for usage in DrawBot, www.drawbot.com # ----------------------------------------------------------------------------- # # BitcountReference.py # # This script the PDF document with Bitcount refernce information. # import pagebot from pagebot import newFS from pagebot.fonttoolbox.objects.family import getFamilyFontPaths from pagebot.contributions.filibuster.blurb import blurb from pagebot.toolbox.transformer import path2ScriptId if __name__ == '__main__': scriptGlobals = pagebot.getGlobals(path2ScriptId(__file__)) #for k in sorted(getFamilyFontPaths('Bitpath')): # print k if not hasattr(scriptGlobals, 'initialized'): scriptGlobals.initialized = True scriptGlobals.s1 = blurb.getBlurb('article_content', noTags=True) scriptGlobals.s2 = blurb.getBlurb('article_content', noTags=True) scriptGlobals.s3 = blurb.getBlurb('article_content', noTags=True) scriptGlobals.s4 = blurb.getBlurb('article_content', noTags=True) scriptGlobals.s5 = blurb.getBlurb('article_content', noTags=True) F = 50 R = 10 x = y = 20
from pagebot.style import getRootStyle, A4, A3, A2, CENTER, NO_COLOR, TOP, BOTTOM, MIDDLE, INLINE, ONLINE, OUTLINE, LEFT # Document is the main instance holding all information about the document together (pages, views, etc.) from pagebot.document import Document # Import all element classes that can be placed on a page. from pagebot.elements import * # Import all layout condition classes from pagebot.conditions import * from pagebot.toolbox.transformer import path2ScriptId from pagebot import getGlobals from pagebot.elements.views.strings.fsstring import newFsString # Get set of globals, unique for this script file name. # This is used to store random information (such as blurb article text), to be consistent # thought multiple runs of the script. Restart DrawBot to clean the cash and start fresh. scriptGlobals = getGlobals(path2ScriptId(__file__)) # Some fixed content, as the filling in this example is not robust, # as there is no overfill function yet. t = u"""Amy's Sun paper hit by hackers. Ignoring the fact that the problem, “was resolved through troubleshooting procedures and restored at midnight,” wrote KLM spokesman Liz Ali III in an e-mail to BSN. Ignoring the fact that the computer malfunction brought Sky Team’s system of scheduling departures, reservations and processing passengers to a halt at airports across Norfolk Island. The problem left passengers stranded for hours in grounded planes, airport lobbies and security lines. """ topT = u"""Amy's Sun paper hit by hackers. Ignoring the fact that the problem, was resolved through general procedures.""" # Allow some interactive size changed by sliders to show responsive behavior. MinPageW = A3[0]*0.9 # Minimum width of the page. MaxPageW = A3[0]*1.2 # Maximum siwidthze of the page. MinPageH = A3[1]*0.9 # Minimum height of the page. MaxPageH = A3[1]*1.2 # Maximum height of the page. PageWidth, PageHeight = A3 # Small newspaper size PADDING = PageWidth/18 # Padding based on size (= in book layout called margin) of the page.