1// qrawfont.sip generated by MetaSIP 2// 3// This file is part of the QtGui Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23%If (PyQt_RawFont) 24 25class QRawFont 26{ 27%TypeHeaderCode 28#include <qrawfont.h> 29%End 30 31public: 32 enum AntialiasingType 33 { 34 PixelAntialiasing, 35 SubPixelAntialiasing, 36 }; 37 38 QRawFont(); 39 QRawFont(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting); 40 QRawFont(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting); 41 QRawFont(const QRawFont &other); 42 ~QRawFont(); 43 bool isValid() const; 44 bool operator==(const QRawFont &other) const; 45 bool operator!=(const QRawFont &other) const; 46 QString familyName() const; 47 QString styleName() const; 48 QFont::Style style() const; 49 int weight() const; 50 QVector<unsigned int> glyphIndexesForString(const QString &text) const; 51 QVector<QPointF> advancesForGlyphIndexes(const QVector<unsigned int> &glyphIndexes) const; 52%If (Qt_5_1_0 -) 53 QVector<QPointF> advancesForGlyphIndexes(const QVector<unsigned int> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const; 54%End 55 QImage alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType = QRawFont::SubPixelAntialiasing, const QTransform &transform = QTransform()) const; 56 QPainterPath pathForGlyph(quint32 glyphIndex) const; 57 void setPixelSize(qreal pixelSize); 58 qreal pixelSize() const; 59 QFont::HintingPreference hintingPreference() const; 60 qreal ascent() const; 61 qreal descent() const; 62 qreal leading() const; 63 qreal xHeight() const; 64 qreal averageCharWidth() const; 65 qreal maxCharWidth() const; 66 qreal unitsPerEm() const; 67 void loadFromFile(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/; 68 void loadFromData(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/; 69 bool supportsCharacter(uint ucs4) const; 70 bool supportsCharacter(QChar character) const; 71 QList<QFontDatabase::WritingSystem> supportedWritingSystems() const; 72 QByteArray fontTable(const char *tagName) const; 73 static QRawFont fromFont(const QFont &font, QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any); 74 QRectF boundingRect(quint32 glyphIndex) const; 75 qreal lineThickness() const; 76 qreal underlinePosition() const; 77 void swap(QRawFont &other /Constrained/); 78%If (Qt_5_1_0 -) 79 80 enum LayoutFlag 81 { 82 SeparateAdvances, 83 KernedAdvances, 84 UseDesignMetrics, 85 }; 86 87%End 88%If (Qt_5_1_0 -) 89 typedef QFlags<QRawFont::LayoutFlag> LayoutFlags; 90%End 91%If (Qt_5_8_0 -) 92 qreal capHeight() const; 93%End 94%If (Qt_5_8_0 -) 95 long __hash__() const; 96%MethodCode 97 sipRes = qHash(*sipCpp); 98%End 99 100%End 101}; 102 103%End 104%If (Qt_5_1_0 -) 105QFlags<QRawFont::LayoutFlag> operator|(QRawFont::LayoutFlag f1, QFlags<QRawFont::LayoutFlag> f2); 106%End 107