45 #include <private/qtextengine_p.h> 46 #include <private/qpaintengine_raster_p.h> 256 d->foundry = foundry;
547 qWarning(
"QAbstractFontEngine: renderGlyph is not implemented in font plugin!");
561 qWarning(
"QAbstractFontEngine: addGlyphOutlinesToPath is not implemented in font plugin!");
580 : engine(customEngine)
593 if (*nglyphs < len) {
603 for (
int i = 0; i < *nglyphs; ++i) {
604 glyphs->
glyphs[i] = glyphIndicies[i];
621 for (
int i = 0; i < nglyphs; ++i) {
633 int glyph_width =
qCeil((gm.
x + gm.
width).toReal()) - glyph_x;
634 int glyph_height =
qCeil((gm.
y + gm.
height).toReal()) - glyph_y;
636 if (glyph_width <= 0 || glyph_height <= 0)
654 for (
int i=0; i<256; ++i)
655 colors[i] =
qRgba(0, 0, 0, i);
656 indexed.setColorTable(colors);
658 for (
int y=0; y<im.
height(); ++y) {
661 for (
int x=0; x<im.
width(); ++x)
684 for (
int i=0; i<256; ++i)
685 colorMap[i] =
qRgba(0, 0, 0, i);
709 for (
int i = 0; i < glyphs.
numGlyphs; ++i)
792 for (
int i = 0; i < numGlyphs; ++i)
812 if (glyphs.
size() == 0)
815 for(
int i = 0; i < glyphs.
size(); i++) {
The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling...
static QFixed fromFixed(int fixed)
virtual int glyphCount() const
#define QT_END_NAMESPACE
This macro expands to.
virtual QStringList keys() const
Returns a list of foundries the font engine plugin provides.
void setColorTable(const QVector< QRgb > colors)
Sets the color table used to translate color indexes to QRgb values, to the specified colors...
QProxyFontEngine(QAbstractFontEngine *engine, const QFontDef &def)
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
QPaintEngineState * state
~QFontEngineInfo()
Destroys this QFontEngineInfo object.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void fill(uint pixel)
Fills the entire image with the given pixelValue.
QTransform transform() const
Returns the matrix in the current paint engine state.
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
QFontEngineInfo & operator=(const QFontEngineInfo &other)
Assigns other to this font engine info object, and returns a reference to this.
int bytesPerLine() const
Returns the number of bytes per image scanline.
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
QList< QFontDatabase::WritingSystem > writingSystems
virtual QFixed descent() const
The QString class provides a Unicode character string.
virtual QImage alphaMapForGlyph(glyph_t)
virtual QFixed leading() const
Fixed advance
The advance of the glyph.
static QFixed fromReal(qreal r)
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
The QChar class provides a 16-bit Unicode character.
Format format() const
Returns the format of the image.
QString family() const
the family name of the font
void resize(int size)
Sets the size of the vector to size.
void setStyle(QFont::Style style)
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
virtual ~QProxyFontEngine()
The QFontEnginePlugin class is the base class for font engine factory plugins in Qt for Embedded Linu...
bool drawAsOutline() const
void setWeight(int weight)
virtual QFixed lineThickness() const
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
QAbstractFontEngine::FixedPoint defines a point in the place using 26.6 fixed point precision...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
QList< QFontDatabase::WritingSystem > writingSystems() const
An empty list means that any writing system is supported.
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
The QFontEngineInfo class describes a specific font provided by a font engine plugin.
static const QCssKnownValue positions[NumKnownPositionModes - 1]
The QStringList class provides a list of strings.
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
virtual Capabilities capabilities() const =0
Implemented in subclasses to specify the font engine's capabilities.
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
QAbstractFontEngine(QObject *parent=0)
Constructs a new QAbstractFontEngine with the given parent.
void setPixelSize(qreal size)
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)=0
QFontEngineInfo()
Constructs a new empty QFontEngineInfo.
virtual GlyphMetrics glyphMetrics(uint glyph) const =0
Implemented in subclass to return the metrics for glyph.
void setFamily(const QString &name)
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
Style
This enum describes the different styles of glyphs that are used to display text. ...
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
void setWritingSystems(const QList< QFontDatabase::WritingSystem > &writingSystems)
virtual bool convertStringToGlyphIndices(const QChar *string, int length, uint *glyphs, int *numGlyphs, TextShapingFlags flags) const =0
Implemented in subclasses to convert the characters specified by string and length to glyph indicies...
uchar * bits()
Returns a pointer to the first pixel data.
QFont::Style style() const
the style of the font
Fixed height
The height of the glyph.
int width() const
Returns the width of the image.
#define Q_DECLARE_PUBLIC(Class)
virtual qreal maxCharWidth() const
The QFont class specifies a font used for drawing text.
QAbstractFontEngine::GlyphMetrics defines the metrics of a single glyph.
QFontEngineInfoPrivate * d
void alphaPenBlt(const void *src, int bpl, int depth, int rx, int ry, int w, int h)
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
~QFontEnginePlugin()
Destroys this font engine plugin.
QAbstractFontEngine * engine
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
Fixed width
The width of the glyph.
int height() const
Returns the height of the image.
virtual bool canRender(const QChar *string, int len)
QFixed effectiveAdvance(int item) const
qreal pixelSize() const
A pixel size of 0 represents a freely scalable font.
QAbstractFontEngine::Capabilities engineCapabilities
virtual QFixed averageCharWidth() const
The QPaintEngineState class provides information about the active paint engine's current state...
int weight() const
The value should be from the QFont::Weight enumeration.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
static QImage alphaMapFromPath(QFontEngine *fe, glyph_t glyph)
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
virtual qreal minLeftBearing() const
~QAbstractFontEngine()
Destroys this QAbstractFontEngine object.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
virtual void getGlyphAdvances(const uint *glyphs, int numGlyphs, Fixed *advances, TextShapingFlags flags) const =0
Implemented in subclasses to retrieve the advances of the array specified by glyphs and numGlyphs...
virtual qreal minRightBearing() const
virtual bool renderGlyph(uint glyph, int depth, int bytesPerLine, int height, uchar *buffer)
Implemented in subclasses to render the specified glyph into a buffer with the given depth ...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
virtual QFixed underlinePosition() const
virtual void addGlyphOutlinesToPath(uint *glyphs, int numGlyphs, FixedPoint *positions, QPainterPath *path)
Implemented in subclasses to add the outline of the glyphs specified by glyphs and numGlyphs at the s...
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
The QAbstractFontEngine class is the base class for font engine plugins in Qt for Embedded Linux...
Q_DECL_CONSTEXPR int qRound(qreal d)
Fixed x
The horizontal offset from the origin.
virtual QFixed ascent() const
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Fixed y
The vertical offset from the origin (baseline).
static qreal toReal(Register *reg, int type, bool *ok=0)
virtual QFixed xHeight() const