qrawfont.sip 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // qrawfont.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. %If (PyQt_RawFont)
  22. class QRawFont
  23. {
  24. %TypeHeaderCode
  25. #include <qrawfont.h>
  26. %End
  27. public:
  28. enum AntialiasingType
  29. {
  30. PixelAntialiasing,
  31. SubPixelAntialiasing,
  32. };
  33. QRawFont();
  34. QRawFont(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
  35. QRawFont(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
  36. QRawFont(const QRawFont &other);
  37. ~QRawFont();
  38. bool isValid() const;
  39. bool operator==(const QRawFont &other) const;
  40. bool operator!=(const QRawFont &other) const;
  41. QString familyName() const;
  42. QString styleName() const;
  43. QFont::Style style() const;
  44. int weight() const;
  45. QList<unsigned int> glyphIndexesForString(const QString &text) const;
  46. QList<QPointF> advancesForGlyphIndexes(const QList<unsigned int> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const;
  47. QList<QPointF> advancesForGlyphIndexes(const QList<unsigned int> &glyphIndexes) const;
  48. QImage alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType = QRawFont::SubPixelAntialiasing, const QTransform &transform = QTransform()) const;
  49. QPainterPath pathForGlyph(quint32 glyphIndex) const;
  50. void setPixelSize(qreal pixelSize);
  51. qreal pixelSize() const;
  52. QFont::HintingPreference hintingPreference() const;
  53. qreal ascent() const;
  54. qreal descent() const;
  55. qreal leading() const;
  56. qreal xHeight() const;
  57. qreal averageCharWidth() const;
  58. qreal maxCharWidth() const;
  59. qreal unitsPerEm() const;
  60. void loadFromFile(const QString &fileName, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/;
  61. void loadFromData(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) /ReleaseGIL/;
  62. bool supportsCharacter(uint ucs4) const;
  63. bool supportsCharacter(QChar character) const;
  64. QList<QFontDatabase::WritingSystem> supportedWritingSystems() const;
  65. QByteArray fontTable(const char *tagName) const;
  66. %If (Qt_6_7_0 -)
  67. QByteArray fontTable(QFont::Tag tag) const;
  68. %End
  69. static QRawFont fromFont(const QFont &font, QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any);
  70. QRectF boundingRect(quint32 glyphIndex) const;
  71. qreal lineThickness() const;
  72. qreal underlinePosition() const;
  73. void swap(QRawFont &other /Constrained/);
  74. enum LayoutFlag /BaseType=Flag/
  75. {
  76. SeparateAdvances,
  77. KernedAdvances,
  78. UseDesignMetrics,
  79. };
  80. typedef QFlags<QRawFont::LayoutFlag> LayoutFlags;
  81. qreal capHeight() const;
  82. Py_hash_t __hash__() const;
  83. %MethodCode
  84. sipRes = qHash(*sipCpp);
  85. %End
  86. %If (Qt_6_11_0 -)
  87. quint32 glyphCount() const;
  88. %End
  89. %If (Qt_6_11_0 -)
  90. QString glyphName(quint32 glyphIndex) const;
  91. %End
  92. };
  93. %End