6#if !defined(QT_NO_RAWFONT)
12#include <private/qguiapplication_p.h>
13#include <qpa/qplatformintegration.h>
14#include <qpa/qplatformfontdatabase.h>
16#include <QtCore/qendian.h>
17#include <QtCore/qfile.h>
18#include <QtGui/qpainterpath.h>
521 if (!d->
isValid() || numChars <= 0) {
533 glyphs.
glyphs = glyphIndexes;
603 advances[
i] =
QPointF(tmpAdvances[
i].toReal(), 0.0);
664 if (os2Table.
size() > 86) {
666 const uchar *
const bigEndianUnicodeRanges =
data + 42;
667 const uchar *
const bigEndianCodepageRanges =
data + 78;
672 for (
size_t i = 0;
i <
sizeof unicodeRanges /
sizeof *unicodeRanges; ++
i)
673 unicodeRanges[
i] = qFromBigEndian<quint32>(bigEndianUnicodeRanges +
i *
sizeof(
quint32));
675 for (
size_t i = 0;
i <
sizeof codepageRanges /
sizeof *codepageRanges; ++
i)
676 codepageRanges[
i] = qFromBigEndian<quint32>(bigEndianCodepageRanges +
i *
sizeof(
quint32));
686 return writingSystems;
730 fe = multiEngine->
engine(0);
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
constexpr char16_t unicode() const noexcept
Returns the numeric Unicode value of the QChar.
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
T * data() const noexcept
Returns a pointer to the shared data object.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
static QFontEngine * findFont(const QFontDef &request, int script, bool preferScriptOverFamily=false)
WritingSystem
\value Any \value Latin \value Greek \value Cyrillic \value Armenian \value Hebrew \value Arabic \val...
QFontEngine * engine(int at) const
virtual QFixed capHeight() const =0
virtual QFixed descent() const
virtual QImage bitmapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t, const QColor &color=QColor())
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
virtual qreal maxCharWidth() const =0
virtual QFixed ascent() const
virtual QFontEngine * cloneWithSize(qreal) const
bool canRender(uint ucs4) const
virtual QImage alphaMapForGlyph(glyph_t)
virtual QImage alphaRGBMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t)
QByteArray getSfntTable(uint tag) const
virtual QFixed averageCharWidth() const
virtual void doKerning(QGlyphLayout *, ShaperFlags) const
virtual QFixed lineThickness() const
virtual QFixed underlinePosition() const
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const
virtual QFixed leading() const
virtual QFixed xHeight() const
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const =0
virtual QFixed emSquareSize() const
static QFontPrivate * get(const QFont &font)
QFontEngine * engineForScript(int script) const
HintingPreference hintingPreference() const
Style
This enum describes the different styles of glyphs that are used to display text.
static QPlatformIntegration * platformIntegration()
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
void resize(qsizetype size)
void append(parameter_type t)
\inmodule QtCore\reentrant
static QRawFontPrivate * get(const QRawFont &font)
QFont::HintingPreference hintingPreference
void loadFromData(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
void setFontEngine(QFontEngine *engine)
The QRawFont class provides access to a single physical instance of a font.
bool supportsCharacter(uint ucs4) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString familyName() const
Returns the family name of this QRawFont.
int weight() const
Returns the weight of this QRawFont.
QRawFont & operator=(const QRawFont &other)
Assigns other to this QRawFont.
QRectF boundingRect(quint32 glyphIndex) const
Returns the smallest rectangle containing the glyph with the given glyphIndex.
QList< QPointF > advancesForGlyphIndexes(const QList< quint32 > &glyphIndexes) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
qreal leading() const
Returns the leading of this QRawFont in pixel units.
qreal ascent() const
Returns the ascent of this QRawFont in pixel units.
qreal averageCharWidth() const
Returns the average character width of this QRawFont in pixel units.
AntialiasingType
This enum represents the different ways a glyph can be rasterized in the function alphaMapForGlyph().
QRawFont()
Constructs an invalid QRawFont.
qreal pixelSize() const
Returns the pixel size set for this QRawFont.
QFont::Style style() const
Returns the style of this QRawFont.
size_t qHash(const QRawFont &font, size_t seed) noexcept
Returns the hash value for font.
qreal xHeight() const
Returns the xHeight of this QRawFont in pixel units.
qreal underlinePosition() const
Returns the position from baseline for drawing underlines below the text rendered with this font.
QByteArray fontTable(const char *tagName) const
Retrieves the sfnt table named tagName from the underlying physical font, or an empty byte array if n...
bool 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.
QFont::HintingPreference hintingPreference() const
Returns the hinting preference used to construct this QRawFont.
QImage alphaMapForGlyph(quint32 glyphIndex, 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,...
qreal unitsPerEm() const
Returns the number of design units define the width and height of the em square for this QRawFont.
void 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 p...
qreal maxCharWidth() const
Returns the width of the widest character in the font.
static QRawFont fromFont(const QFont &font, QFontDatabase::WritingSystem writingSystem=QFontDatabase::Any)
Fetches the physical representation based on a font query.
qreal descent() const
Returns the descent of this QRawFont in pixel units.
void setPixelSize(qreal pixelSize)
Sets the pixel size with which this font should be rendered to pixelSize.
qreal capHeight() const
Returns the cap height of this QRawFont in pixel units.
qreal lineThickness() const
Returns the thickness for drawing lines (underline, overline, etc.) along with text drawn in this fon...
~QRawFont()
Destroys the QRawFont.
QList< QFontDatabase::WritingSystem > supportedWritingSystems() const
Returns a list of writing systems supported by the font according to designer supplied information in...
QPainterPath pathForGlyph(quint32 glyphIndex) const
This function returns the shape of the glyph at a given glyphIndex in the underlying font if the QRaw...
void 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 pixel...
QList< quint32 > glyphIndexesForString(const QString &text) const
Converts the string of unicode points given by text to glyph indexes using the CMAP table in the unde...
bool operator==(const QRawFont &other) const
Returns true if this QRawFont is equal to other.
QString styleName() const
Returns the style name of this QRawFont.
bool isValid() const
Returns true if the QRawFont is valid and false otherwise.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QChar * data()
Returns a pointer to the data stored in the QString.
The QSupportedWritingSystems class is used when registering fonts with the internal Qt fontdatabase.
Combined button and popup list for selecting options.
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Q_GUI_EXPORT int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
#define MAKE_TAG(ch1, ch2, ch3, ch4)
GLenum const void GLbitfield GLsizei numGlyphs
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLsizeiptr const void * fontData
GLuint GLenum GLenum transform
GLsizei const GLchar *const * path
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
QNetworkRequest request(url)
constexpr qreal toReal() const