styles = getSampleStyleSheet() #print styles.list() styleN = styles['Normal'] styleI = ParagraphStyle(name='', parent=styles['Italic'], alignment=2) styleT = ParagraphStyle(name='Title', parent=styles['Title'], fontName='Helvetica') fb5 = ReportlabFB(None, inch) fb5.u_height = 1.25 fb5.u_width = 5.75 fb7 = ReportlabFB(None, inch) fb7.u_height = 1.1 fb7.u_width = 5.75 #Arpeggio Patterns doc = SimpleDocTemplate("arpeggios.pdf", bottomMargin = 0.25*inch) story = [] story.append(Paragraph('Major Arpeggio Patterns',styleT)) md = enumerate(major_dots) for t,d in md: story.append(FBFlowable(fb5,d,label='Position %s'%(t+1),labelpos=0)) story.append(Paragraph(major_uri,styleI))
from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont pdfmetrics.registerFont(TTFont("DejaVuSans", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf")) styles = getSampleStyleSheet() # print styles.list() styleN = styles["Normal"] styleI = ParagraphStyle(name="", parent=styles["Italic"], alignment=2) styleT = ParagraphStyle(name="Title", parent=styles["Title"], fontName="DejaVuSans", alignment=TA_LEFT) fb7 = ReportlabFB(None, inch) fb7.u_height = 1.1 fb7.u_width = 5.75 fb7.num_frets = 20.0 # mode Patterns from segovia_scales import scales sharp = u"\u266F" flat = u"\u266D" doc = SimpleDocTemplate("segovia_scales.pdf", pagesize=letter, bottomMargin=0.25 * inch, topMargin=0.75 * inch) story = [] count = 0 for title, patterns in scales: title = title.replace("#", sharp).replace("b", flat) if count > 0 and count % 2 == 0:
frameWidth, frameHeight, topPadding=0, bottomPadding=0, rightPadding=0, leftPadding=0, ) frames.append(column) template = PageTemplate(frames=frames) doc.addPageTemplates(template) fbfc = ReportlabFB(None, inch) fbfc.u_height = 1 fbfc.u_width = (frameWidth / inch) * 0.98 fbfc.do_fret_markers = True fbfc.numbered_frets = [] g = 0 fbfc.base_color = (g, g, g, 1) def add_string(l, s): return [(x[0], s + " String", x[1], x[2]) for x in l] sharp = u"\u266F" flat = u"\u266D" def add_accidental(n):