PythonQt.QtGui.QRawFont · declarations 001
Back to PythonQt.QtGui.QRawFont
AntialiasingType
instance-attribute
AntialiasingType: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
KernedAdvances
instance-attribute
KernedAdvances: Any
LayoutFlag
instance-attribute
LayoutFlag: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LayoutFlags
instance-attribute
LayoutFlags: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PixelAntialiasing
instance-attribute
PixelAntialiasing: Any
SeparateAdvances
instance-attribute
SeparateAdvances: Any
SubPixelAntialiasing
instance-attribute
SubPixelAntialiasing: Any
UseDesignMetrics
instance-attribute
UseDesignMetrics: Any
advancesForGlyphIndexes
advancesForGlyphIndexes(glyphIndexes: Any, advances: Any, numGlyphs: Any, layoutFlags: Any) -> tuple
X.advancesForGlyphIndexes(glyphIndexes, advances, numGlyphs, layoutFlags) -> tuple
Supplemental documentation: Qt 5 reference:
QVector\<QPointF> QRawFont::advancesForGlyphIndexes(const QVector\<quint32> \&glyphIndexes, QRawFont::LayoutFlags layoutFlags) const
Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. How the advances are calculated is controlled by layoutFlags.
This function was introduced in Qt 5.1.
See also QTextLine::horizontalAdvance() and QFontMetricsF::width().
QVector\<QPointF> QRawFont::advancesForGlyphIndexes(const QVector\<quint32> \&glyphIndexes) const
This is an overloaded function.
Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The advance of each glyph is calculated separately.
See also QTextLine::horizontalAdvance() and QFontMetricsF::width().
bool QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs) const
This is an overloaded function.
Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array glyphIndexes while the results are returned through advances, both of them must have numGlyphs elements. The advance of each glyph is calculated separately
See also QTextLine::horizontalAdvance() and QFontMetricsF::width().
bool QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs, QRawFont::LayoutFlags layoutFlags) const
Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array glyphIndexes while the results are returned through advances, both of them must have numGlyphs elements. How the advances are calculated is controlled by layoutFlags.
This function was introduced in Qt 5.1.
See also QTextLine::horizontalAdvance() and QFontMetricsF::width().
Upstream PySide2 reference signatures (binding differences may apply):
advancesForGlyphIndexes(self, glyphIndexes: typing.List[int]) -> typing.List[PySide2.QtCore.QPointF]
advancesForGlyphIndexes(self, glyphIndexes: typing.List[int], layoutFlags: PySide2.QtGui.QRawFont.LayoutFlags) -> typing.List[PySide2.QtCore.QPointF]
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#advancesForGlyphIndexes
alphaMapForGlyph
alphaMapForGlyph(glyphIndex: int, antialiasingType: Any, transform: Any) -> Any
X.alphaMapForGlyph(glyphIndex, antialiasingType, transform) -> PythonQt.QtGui.QImage
Supplemental documentation: Qt 5 reference:
QImage QRawFont::alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType \= SubPixelAntialiasing, const QTransform \&transform \= QTransform()) const
This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.
If the font is a color font, then the resulting image will contain the rendered glyph at the current pixel size. In this case, the antialiasingType will be ignored.
Otherwise, if antialiasingType is set to QRawFont::SubPixelAntialiasing, then the resulting image will be in QImage::Format_RGB32 and the RGB values of each pixel will represent the subpixel opacities of the pixel in the rasterization of the glyph. Otherwise, the image will be in the format of QImage::Format_Indexed8 and each pixel will contain the opacity of the pixel in the rasterization.
See also pathForGlyph() and QPainter::drawGlyphRun().
Upstream PySide2 reference signatures (binding differences may apply):
alphaMapForGlyph(self, glyphIndex: int, antialiasingType: PySide2.QtGui.QRawFont.AntialiasingType=..., transform: PySide2.QtGui.QTransform=...) -> PySide2.QtGui.QImage
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#alphaMapForGlyph
ascent
ascent() -> float
X.ascent() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::ascent() const
Returns the ascent of this QRawFont in pixel units.
The ascent of a font is the distance from the baseline to the highest position characters extend to. In practice, 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.
See also QFontMetricsF::ascent().
Upstream PySide2 reference signatures (binding differences may apply):
ascent(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#ascent
averageCharWidth
averageCharWidth() -> float
X.averageCharWidth() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::averageCharWidth() const
Returns the average character width of this QRawFont in pixel units.
See also QFontMetricsF::averageCharWidth().
Upstream PySide2 reference signatures (binding differences may apply):
averageCharWidth(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#averageCharWidth
boundingRect
boundingRect(glyphIndex: int) -> Any
X.boundingRect(glyphIndex) -> PythonQt.QtCore.QRectF
Supplemental documentation: Qt 5 reference:
QRectF QRawFont::boundingRect(quint32 glyphIndex) const
Returns the smallest rectangle containing the glyph with the given glyphIndex.
This function was introduced in Qt 5.0.
Upstream PySide2 reference signatures (binding differences may apply):
boundingRect(self, glyphIndex: int) -> PySide2.QtCore.QRectF
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#boundingRect
descent
descent() -> float
X.descent() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::descent() const
Returns the descent of this QRawFont in pixel units.
The descent is the distance from the base line to the lowest point characters extend to. In practice, 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.
See also QFontMetricsF::descent().
Upstream PySide2 reference signatures (binding differences may apply):
descent(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#descent
familyName
familyName() -> str
X.familyName() -> str
Supplemental documentation: Qt 5 reference:
QString QRawFont::familyName() const
Returns the family name of this QRawFont.
Upstream PySide2 reference signatures (binding differences may apply):
familyName(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#familyName
fontTable
fontTable(tagName: str) -> Any
X.fontTable(tagName) -> PythonQt.QtCore.QByteArray
Supplemental documentation: Qt 5 reference:
QByteArray QRawFont::fontTable(const char *tagName) const
Retrieves the sfnt table named tagName from the underlying physical font, or an empty byte array if no such table was found. The returned font table's byte order is Big Endian, like the sfnt format specifies. The tagName must be four characters long and should be formatted in the default endianness of the current platform.
Upstream PySide2 reference signatures (binding differences may apply):
fontTable(self, tagName: str) -> PySide2.QtCore.QByteArray
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#fontTable
fromFont
fromFont(font: Any, writingSystem: Any) -> Any
X.fromFont(font, writingSystem) -> PythonQt.QtGui.QRawFont
Supplemental documentation: Qt 5 reference:
[static] QRawFont QRawFont::fromFont(const QFont \&font, QFontDatabase::WritingSystem writingSystem \= QFontDatabase::Any)
Fetches the physical representation based on a font query. The physical font returned is the font that will be preferred by Qt in order to display text in the selected writingSystem.
Warning: This function is potentially expensive and should not be called in performance sensitive code.
Upstream PySide2 reference signatures (binding differences may apply):
fromFont(font: PySide2.QtGui.QFont, writingSystem: PySide2.QtGui.QFontDatabase.WritingSystem=...) -> PySide2.QtGui.QRawFont
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#fromFont
glyphIndexesForChars
glyphIndexesForChars(chars: Any, numChars: Any, glyphIndexes: Any, numGlyphs: Any) -> bool
X.glyphIndexesForChars(chars, numChars, glyphIndexes, numGlyphs) -> bool
Supplemental documentation: Qt 5 reference:
bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *glyphIndexes, int *numGlyphs) const
Converts a string of unicode points to glyph indexes using the CMAP table in the underlying font. The function works like glyphIndexesForString() except it take an array (chars), the results will be returned though glyphIndexes array and number of glyphs will be set in numGlyphs. The size of glyphIndexes array must be at least numChars, if that's still not enough, this function will return false, then you can resize glyphIndexes from the size returned in numGlyphs.
See also glyphIndexesForString(), advancesForGlyphIndexes(), QGlyphRun, QTextLayout::glyphRuns(), and QTextFragment::glyphRuns().
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#glyphIndexesForChars
glyphIndexesForString
glyphIndexesForString(text: str) -> tuple
X.glyphIndexesForString(text) -> tuple
Supplemental documentation: Qt 5 reference:
QVector\<quint32> QRawFont::glyphIndexesForString(const QString \&text) const
Converts the string of unicode points given by text to glyph indexes using the CMAP table in the underlying font, and returns a vector containing the result.
Note that, in cases where there are other tables in the font that affect the shaping of the text, the returned glyph indexes will not correctly represent the rendering of the text. To get the correctly shaped text, you can use QTextLayout to lay out and shape the text, then call QTextLayout::glyphs() to get the set of glyph index list and QRawFont pairs.
See also advancesForGlyphIndexes(), glyphIndexesForChars(), QGlyphRun, QTextLayout::glyphRuns(), and QTextFragment::glyphRuns().
Upstream PySide2 reference signatures (binding differences may apply):
glyphIndexesForString(self, text: str) -> typing.List[int]
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#glyphIndexesForString
hintingPreference
hintingPreference() -> Any
X.hintingPreference()
Supplemental documentation: Qt 5 reference:
QFont::HintingPreference QRawFont::hintingPreference() const
Returns the hinting preference used to construct this QRawFont.
See also QFont::hintingPreference().
Upstream PySide2 reference signatures (binding differences may apply):
hintingPreference(self) -> PySide2.QtGui.QFont.HintingPreference
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#hintingPreference
isValid
isValid() -> bool
X.isValid() -> bool
Supplemental documentation: Qt 5 reference:
bool QRawFont::isValid() const
Returns true if the QRawFont is
valid and false otherwise.
Upstream PySide2 reference signatures (binding differences may apply):
isValid(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#isValid
leading
leading() -> float
X.leading() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::leading() const
Returns the leading of this QRawFont in pixel units.
This is the natural inter-line spacing.
See also QFontMetricsF::leading().
Upstream PySide2 reference signatures (binding differences may apply):
leading(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#leading
lineThickness
lineThickness() -> float
X.lineThickness() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::lineThickness() const
Returns the thickness for drawing lines (underline, overline, etc.) along with text drawn in this font.
Upstream PySide2 reference signatures (binding differences may apply):
lineThickness(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#lineThickness
loadFromData
loadFromData(fontData: Any, pixelSize: float, hintingPreference: Any) -> None
X.loadFromData(fontData, pixelSize, hintingPreference)
Supplemental documentation: Qt 5 reference:
void QRawFont::loadFromData(const QByteArray \&fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
Replaces the current QRawFont with the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.
The fontData must contain a TrueType or OpenType font.
See also loadFromFile().
Upstream PySide2 reference signatures (binding differences may apply):
loadFromData(self, fontData: PySide2.QtCore.QByteArray, pixelSize: float, hintingPreference: PySide2.QtGui.QFont.HintingPreference) -> None
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#loadFromData
loadFromFile
loadFromFile(fileName: str, pixelSize: float, hintingPreference: Any) -> None
X.loadFromFile(fileName, pixelSize, hintingPreference)
Supplemental documentation: Qt 5 reference:
void QRawFont::loadFromFile(const QString \&fileName, qreal pixelSize, QFont::HintingPreference hintingPreference)
Replaces the current QRawFont with the contents of the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.
The file must reference a TrueType or OpenType font.
See also loadFromData().
Upstream PySide2 reference signatures (binding differences may apply):
loadFromFile(self, fileName: str, pixelSize: float, hintingPreference: PySide2.QtGui.QFont.HintingPreference) -> None
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#loadFromFile
maxCharWidth
maxCharWidth() -> float
X.maxCharWidth() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::maxCharWidth() const
Returns the width of the widest character in the font.
See also QFontMetricsF::maxWidth().
Upstream PySide2 reference signatures (binding differences may apply):
maxCharWidth(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#maxCharWidth
operator_assign
operator_assign(other: Any) -> Any
X.operator_assign(other) -> PythonQt.QtGui.QRawFont
pathForGlyph
pathForGlyph(glyphIndex: int) -> Any
X.pathForGlyph(glyphIndex) -> PythonQt.QtGui.QPainterPath
Supplemental documentation: Qt 5 reference:
QPainterPath QRawFont::pathForGlyph(quint32 glyphIndex) const
This function returns the shape of the glyph at a given glyphIndex in the underlying font if the QRawFont is valid. Otherwise, it returns an empty QPainterPath.
The returned glyph will always be unhinted.
See also alphaMapForGlyph() and QPainterPath::addText().
Upstream PySide2 reference signatures (binding differences may apply):
pathForGlyph(self, glyphIndex: int) -> PySide2.QtGui.QPainterPath
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#pathForGlyph
pixelSize
pixelSize() -> float
X.pixelSize() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::pixelSize() const
Returns the pixel size set for this QRawFont. The pixel size affects how glyphs are rasterized, the size of glyphs returned by pathForGlyph(), and is used to convert internal metrics from design units to logical pixel units.
See also setPixelSize().
Upstream PySide2 reference signatures (binding differences may apply):
pixelSize(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#pixelSize
setPixelSize
setPixelSize(pixelSize: float) -> None
X.setPixelSize(pixelSize)
Supplemental documentation: Qt 5 reference:
void QRawFont::setPixelSize(qreal pixelSize)
Sets the pixel size with which this font should be rendered to pixelSize.
See also pixelSize().
Upstream PySide2 reference signatures (binding differences may apply):
setPixelSize(self, pixelSize: float) -> None
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#setPixelSize
style
style() -> Any
X.style()
Supplemental documentation: Qt 5 reference:
QFont::Style QRawFont::style() const
Returns the style of this QRawFont.
See also QFont::style().
Upstream PySide2 reference signatures (binding differences may apply):
style(self) -> PySide2.QtGui.QFont.Style
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#style
styleName
styleName() -> str
X.styleName() -> str
Supplemental documentation: Qt 5 reference:
QString QRawFont::styleName() const
Returns the style name of this QRawFont.
See also QFont::styleName().
Upstream PySide2 reference signatures (binding differences may apply):
styleName(self) -> str
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#styleName
supportedWritingSystems
supportedWritingSystems() -> tuple
X.supportedWritingSystems() -> tuple
Supplemental documentation: Qt 5 reference:
QList\<QFontDatabase::WritingSystem> QRawFont::supportedWritingSystems() const
Returns a list of writing systems supported by the font according to designer supplied information in the font file. Please note that this does not guarantee support for a specific unicode point in the font. You can use the supportsCharacter() to check support for a single, specific character.
Note: The list is determined based on the unicode ranges and codepage ranges set in the font's OS/2 table and requires such a table to be present in the underlying font file.
See also supportsCharacter().
Upstream PySide2 reference signatures (binding differences may apply):
supportedWritingSystems(self) -> typing.List[PySide2.QtGui.QFontDatabase.WritingSystem]
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#supportedWritingSystems
supportsCharacter
supportsCharacter(character: Any) -> bool
X.supportsCharacter(character) -> bool
Supplemental documentation: Qt 5 reference:
bool QRawFont::supportsCharacter(QChar character) const
Returns true if the font has a glyph that corresponds to the given character.
See also supportedWritingSystems().
bool QRawFont::supportsCharacter(uint ucs4) const
This is an overloaded function.
Returns true if the font has a glyph that corresponds to the UCS-4 encoded character
ucs4.
See also supportedWritingSystems().
Upstream PySide2 reference signatures (binding differences may apply):
supportsCharacter(self, character: str) -> bool
supportsCharacter(self, ucs4: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#supportsCharacter
swap
swap(other: Any) -> None
X.swap(other)
Supplemental documentation: Qt 5 reference:
void QRawFont::swap(QRawFont \&other)
Swaps this raw font with other. This function is very fast and never fails.
This function was introduced in Qt 5.0.
Upstream PySide2 reference signatures (binding differences may apply):
swap(self, other: PySide2.QtGui.QRawFont) -> None
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#swap
underlinePosition
underlinePosition() -> float
X.underlinePosition() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::underlinePosition() const
Returns the position from baseline for drawing underlines below the text rendered with this font.
Upstream PySide2 reference signatures (binding differences may apply):
underlinePosition(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#underlinePosition
unitsPerEm
unitsPerEm() -> float
X.unitsPerEm() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::unitsPerEm() const
Returns the number of design units define the width and height of the em square for this QRawFont. This value is used together with the pixel size when converting design metrics to pixel units, as the internal metrics are specified in design units and the pixel size gives the size of 1 em in pixels.
See also pixelSize() and setPixelSize().
Upstream PySide2 reference signatures (binding differences may apply):
unitsPerEm(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#unitsPerEm
weight
weight() -> int
X.weight() -> int
Supplemental documentation: Qt 5 reference:
int QRawFont::weight() const
Returns the weight of this QRawFont.
See also QFont::weight().
Upstream PySide2 reference signatures (binding differences may apply):
weight(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#weight
xHeight
xHeight() -> float
X.xHeight() -> float
Supplemental documentation: Qt 5 reference:
qreal QRawFont::xHeight() const
Returns the xHeight of this QRawFont in pixel units.
This is often but not always the same as the height of the character 'x'.
See also QFontMetricsF::xHeight().
Upstream PySide2 reference signatures (binding differences may apply):
xHeight(self) -> float
Source: https://doc.qt.io/archives/qt-5.15/qrawfont.html#xHeight