Chemical Data Processing Library Python API - Version 1.2.0
|
Implements the FontMetrics interface for the Qt rendering backend. More...
Public Member Functions | |
None | __init__ (PyQt5.QtGui.QPaintDevice paint_dev) |
Constructs a font metrics object for Qt's default font and the given paint device. More... | |
None | setFont (Vis.Font font) |
Specifies the font for which to obtain the metrics. More... | |
float | getAscent () |
Returns the ascent of the font. More... | |
float | getDescent () |
Returns the descent of the font. More... | |
float | getHeight () |
Returns the height of the font. More... | |
float | getLeading () |
Returns the leading of the font. More... | |
float | getWidth () |
float | getBounds (str string, Vis.Rectangle2D bounds) |
Public Member Functions inherited from CDPL.Vis.FontMetrics | |
None | __init__ () |
Initializes the FontMetrics instance. | |
int | getObjectID () |
Returns the numeric identifier (ID) of the wrapped C++ class instance. More... | |
None | setFont (Font font) |
Specifies the font for which to obtain the metrics. More... | |
float | getWidth (str string) |
None | getBounds (str string, Rectangle2D bounds) |
Additional Inherited Members | |
Properties inherited from CDPL.Vis.FontMetrics | |
objectID = property(getObjectID) | |
Implements the FontMetrics interface for the Qt rendering backend.
QtFontMetrics
is implemented by wrapping a corresponding QFontMetrics
instance created for the font specified by setFont(). For more information about QFontMetrics
and the Qt Toolkit see [QTDOC].
None CDPL.Vis.QtBackend.QtFontMetrics.__init__ | ( | PyQt5.QtGui.QPaintDevice | paint_dev | ) |
Constructs a font metrics object for Qt's default font and the given paint device.
paint_dev | A reference to the Qt paint device, or None if unspecified. |
None CDPL.Vis.QtBackend.QtFontMetrics.setFont | ( | Vis.Font | font | ) |
Specifies the font for which to obtain the metrics.
font | Specifies the font for which to retrieve the metrics. |
float CDPL.Vis.QtBackend.QtFontMetrics.getAscent | ( | ) |
Returns the ascent of the font.
The ascent is the maximum distance from the baseline to the highest position characters extend to. Some font designers break this rule, e.g. when they put more than one accent on top of a character, or to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small.
Reimplemented from CDPL.Vis.FontMetrics.
float CDPL.Vis.QtBackend.QtFontMetrics.getDescent | ( | ) |
Returns the descent of the font.
The descent is the distance from the baseline to the lowest position characters extend to. Some font designers break this rule, e.g. to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small.
Reimplemented from CDPL.Vis.FontMetrics.
float CDPL.Vis.QtBackend.QtFontMetrics.getHeight | ( | ) |
Returns the height of the font.
The returned height is the sum of the ascent and descent plus some possible implementation dependent extra space.
Reimplemented from CDPL.Vis.FontMetrics.
float CDPL.Vis.QtBackend.QtFontMetrics.getLeading | ( | ) |
Returns the leading of the font.
The leading, or interline spacing, is the logical amount of space to be reserved between the descent of one line of text and the ascent of the next line.
Reimplemented from CDPL.Vis.FontMetrics.
float CDPL.Vis.QtBackend.QtFontMetrics.getWidth | ( | ) |
float CDPL.Vis.QtBackend.QtFontMetrics.getBounds | ( | str | string, |
Vis.Rectangle2D | bounds | ||
) |
string | |
bounds |