May 2019
Intermediate to advanced
542 pages
13h 37m
English
Just like frames must be created with a frame format, text content must be created with a character format, which defines properties such as the font and alignment of the text. Before we start adding content to our frames, we should define some common character formats to use for different parts of the document.
This is done using the QTextCharFormat class, as follows:
std_format = qtg.QTextCharFormat() logo_format = qtg.QTextCharFormat() logo_format.setFont( qtg.QFont('Impact', 24, qtg.QFont.DemiBold)) logo_format.setUnderlineStyle( qtg.QTextCharFormat.SingleUnderline) logo_format.setVerticalAlignment( qtg.QTextCharFormat.AlignMiddle) label_format = qtg.QTextCharFormat() label_format.setFont(qtg.QFont('Sans', 12, qtg.QFont.Bold)) ...Read now
Unlock full access