Ejemplo n.º 1
0
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:
        story.append(PageBreak())
Ejemplo n.º 2
0
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 = 14.0
fb7.numbered_frets = [3,5,7,9,12,]



import learn_notes as ln
days = zip(ln.strings + ln.strings, ln.notes, ln.frets + ln.frets)

doc = SimpleDocTemplate("12_days.pdf",  pagesize=letter, bottomMargin = 0.25*inch, topMargin = 0.75*inch)
story = []
count = 0
for i, day in enumerate(days):
    strings, notes, frets = day
    
    story.append(Paragraph('Day '+str(i+1),styleT))
    story.append(FBFlowable(fb7,notes))