44 #if !defined(QT_NO_RAWFONT) 49 #include <QtCore/qendian.h> 214 QFile file(fileName);
441 int nglyphs = text.
size();
452 for (
int i=0; i<nglyphs; ++i)
475 glyphs.
glyphs = glyphIndexes;
491 int numGlyphs = glyphIndexes.
size();
498 for (
int i=0; i<numGlyphs; ++i)
519 glyphs.
glyphs =
const_cast<HB_Glyph *
>(glyphIndexes);
528 for (
int i=0; i<numGlyphs; ++i)
555 const quint32 *tagId =
reinterpret_cast<const quint32 *
>(tagName);
577 if (os2Table.
size() > 86) {
579 quint32 *bigEndianUnicodeRanges =
reinterpret_cast<quint32 *
>(data + 42);
580 quint32 *bigEndianCodepageRanges =
reinterpret_cast<quint32 *
>(data + 78);
585 for (
int i=0; i<4; ++i) {
622 str[0] =
QChar(ucs4);
643 #if defined(Q_WS_MAC) 652 for (
int i = 0; i < list.
size(); i++) {
666 fe = multiEngine->
engine(0);
669 fe = multiEngine->
engine(0);
699 delete oldFontEngine;
708 if (fontEngine != 0) {
709 fontEngine->ref.deref();
710 if (fontEngine->cache_count == 0 && fontEngine->ref == 0)
719 #endif // QT_NO_RAWFONT
QRawFont & operator=(const QRawFont &other)
Assigns other to this QRawFont.
virtual QFixed averageCharWidth() const
HintingPreference
This enum describes the different levels of hinting that can be applied to glyphs to improve legibili...
virtual QImage alphaMapForGlyph(glyph_t)
qreal averageCharWidth() const
Returns the average character width of this QRawFont in pixel units.
#define QT_END_NAMESPACE
This macro expands to.
AntialiasingType
This enum represents the different ways a glyph can be rasterized in the function alphaMapForGlyph()...
QVector< 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...
char * data()
Returns a pointer to the data stored in the byte array.
HintingPreference hintingPreference() const
Returns the currently preferred hinting level for glyphs rendered with this font. ...
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool isValid() const
Returns true if the QRawFont is valid and false otherwise.
qreal descent() const
Returns the descent of this QRawFont in pixel units.
The QByteArray class provides an array of bytes.
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...
The QPointF class defines a point in the plane using floating point precision.
The QTextLine class represents a line of text inside a QTextLayout.
qreal pixelSize() const
Returns the pixel size set for this QRawFont.
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
T qFromBigEndian(const uchar *src)
QVector< QPointF > advancesForGlyphIndexes(const QVector< quint32 > &glyphIndexes) const
Returns the QRawFont's advances for each of the glyphIndexes in pixel units.
QList< QFontDatabase::WritingSystem > supportedWritingSystems() const
Returns a list of writing systems supported by the font according to designer supplied information in...
qreal leading() const
Returns the leading of this QRawFont in pixel units.
static QFontPrivate * get(const QFont &font)
bool ref()
Atomically increments the value of this QAtomicInt.
qreal unitsPerEm() const
Returns the number of design units define the width and height of the em square for this QRawFont...
The QString class provides a Unicode character string.
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const =0
QFont::Style style() const
Returns the style of this QRawFont.
virtual Type type() const =0
virtual QFontEngine * cloneWithSize(qreal) const
The QChar class provides a 16-bit Unicode character.
QChar * data()
Returns a pointer to the data stored in the QString.
int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t)
static ushort highSurrogate(uint ucs4)
Returns the high surrogate value of a ucs4 code point.
static ushort lowSurrogate(uint ucs4)
Returns the low surrogate value of a ucs4 code point.
bool supportsCharacter(quint32 ucs4) const
Returns true if the font has a glyph that corresponds to the UCS-4 encoded character ucs4...
virtual qreal maxCharWidth() const =0
QByteArray fontTable(const char *tagName) const
Retrieves the sfnt table named tagName from the underlying physical font, or an empty byte array if n...
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
T * data() const
Returns a pointer to the shared data object.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool requiresSurrogates(uint ucs4)
Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low part...
int size() const
Returns the number of characters in this string.
void platformLoadFromData(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
virtual bool canRender(const QChar *string, int len)=0
QRawFont()
Constructs an invalid QRawFont.
const T & at(int i) const
Returns the item at index position i in the list.
bool deref()
Atomically decrements the value of this QAtomicInt.
virtual QFixed ascent() const =0
virtual QFixed descent() const =0
void append(const T &t)
Inserts value at the end of the vector.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
QList< QFontDatabase::WritingSystem > qt_determine_writing_systems_from_truetype_bits(quint32 unicodeRange[4], quint32 codePageRange[2])
~QRawFont()
Destroys the QRawFont.
qreal ascent() const
Returns the ascent of this QRawFont in pixel units.
QRawFont rawFont() const
Returns the font selected for this QGlyphRun object.
Style
This enum describes the different styles of glyphs that are used to display text. ...
QList< QGlyphRun > glyphRuns() const
Returns the glyph indexes and positions for all glyphs in this QTextLayout.
static QRawFont fromFont(const QFont &font, QFontDatabase::WritingSystem writingSystem=QFontDatabase::Any)
Fetches the physical representation based on a font query.
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
static QString writingSystemSample(WritingSystem writingSystem)
Returns a string with sample characters from writingSystem.
virtual QFixed xHeight() const
QFontEngine * engineForScript(int script) const
qreal xHeight() const
Returns the xHeight of this QRawFont in pixel units.
virtual void loadEngine(int at)=0
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
void * qMemCopy(void *dest, const void *src, size_t n)
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
void resize(int totalGlyphs)
void setPixelSize(qreal pixelSize)
Sets the pixel size with which this font should be rendered to pixelSize.
#define Q_ASSERT_X(cond, where, what)
The QTextLayout class is used to lay out and render text.
The QFile class provides an interface for reading from and writing to files.
The QRawFont class provides access to a single physical instance of a font.
The QFont class specifies a font used for drawing text.
QTextLine createLine()
Returns a new text line to be laid out if there is text to be inserted into the layout; otherwise ret...
QString family() const
Returns the requested font family name, i.e.
int size() const
Returns the number of items in the list.
QFont::HintingPreference hintingPreference
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
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...
QString familyName() const
Returns the family name of this QRawFont.
virtual QFixed emSquareSize() const
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...
QByteArray readAll()
Reads all available data from the device, and returns it as a QByteArray.
int size() const
Returns the number of bytes in this byte array.
T * data()
Returns a pointer to the data stored in the vector.
qreal maxCharWidth() const
Returns the width of the widest character in the font.
QFont::HintingPreference hintingPreference() const
Returns the hinting preference used to construct this QRawFont.
void endLayout()
Ends the layout process.
int weight() const
Returns the weight of this QRawFont.
QString styleName() const
Returns the style name of this QRawFont.
bool operator==(const QRawFont &other) const
Returns true if this QRawFont is equal to other.
static QString fileName(const QString &fileUrl)
int size() const
Returns the number of items in the vector.
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...
QExplicitlySharedDataPointer< QRawFontPrivate > d
void beginLayout()
Begins the layout process.
QPainterPath pathForGlyph(quint32 glyphIndex) const
This function returns the shape of the glyph at a given glyphIndex in the underlying font if the QRaw...
QFontEngine * engine(int at) const
virtual QFixed leading() const =0
QByteArray getSfntTable(uint) const