Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

reportlab python add font style

from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

pdfmetrics.registerFont(TTFont('Vera', 'Vera.ttf'))
pdfmetrics.registerFont(TTFont('VeraBd', 'VeraBd.ttf'))
pdfmetrics.registerFont(TTFont('VeraIt', 'VeraIt.ttf'))
pdfmetrics.registerFont(TTFont('VeraBI', 'VeraBI.ttf'))

canvas.setFont('Vera', 32)
canvas.drawString(10, 150, "Some text encoded in UTF-8")
canvas.drawString(10, 100, "In the Vera TT Font!")
Comment

PREVIOUS NEXT
Code Example
Python :: get mean using python 
Python :: manage python environment in jupyterlab 
Python :: how to add labels on bar of barchart seaborn 
Python :: python min value index from an array 
Python :: python built in functions 
Python :: netcdf in python 
Python :: pop list python 
Python :: split paragraphs in python 
Python :: Update All Python Packages On Windows 
Python :: a int and float. python 
Python :: python slicing 
Python :: how to read json from python 
Python :: Python program to find N largest elements from a list 
Python :: convert python script to exe 
Python :: python delete elements from list / range 
Python :: Customizable TKinter Buttons Python 
Python :: get reactions from message discord.py 
Python :: numpy copy a array vertical 
Python :: hide turtle 
Python :: how to get the length of a string in python 
Python :: df concat multiple columns 
Python :: simple heatmap 
Python :: has no attribute python 
Python :: pandas series 
Python :: round to nearest multiple of 5 python 
Python :: hist pandas 
Python :: VALUE ERROR EXCEPTION 
Python :: python condition question 
Python :: python list as queue 
Python :: black code formatter 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =