Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QGlyphLayout Struct Reference

#include <qtextengine_p.h>

Inheritance diagram for QGlyphLayout:
QGlyphLayoutArray< N > QVarLengthGlyphLayoutArray

Public Functions

void clear (int first=0, int last=-1)
 
char * data ()
 
QFixed effectiveAdvance (int item) const
 
void grow (char *address, int totalGlyphs)
 
QGlyphLayoutInstance instance (int position) const
 
QGlyphLayout mid (int position, int n=-1) const
 
 QGlyphLayout ()
 
 QGlyphLayout (char *address, int totalGlyphs)
 
void setInstance (int position, const QGlyphLayoutInstance &g)
 

Static Public Functions

static int spaceNeededForGlyphLayout (int totalGlyphs)
 

Public Variables

QFixedadvances_x
 
QFixedadvances_y
 
HB_GlyphAttributes * attributes
 
HB_Glyph * glyphs
 
QGlyphJustificationjustifications
 
int numGlyphs
 
QFixedPointoffsets
 

Detailed Description

Definition at line 168 of file qtextengine_p.h.

Constructors and Destructors

◆ QGlyphLayout() [1/2]

QGlyphLayout::QGlyphLayout ( )
inline

Definition at line 180 of file qtextengine_p.h.

180 : numGlyphs(0) {}

◆ QGlyphLayout() [2/2]

QGlyphLayout::QGlyphLayout ( char *  address,
int  totalGlyphs 
)
inlineexplicit

Definition at line 182 of file qtextengine_p.h.

183  {
184  offsets = reinterpret_cast<QFixedPoint *>(address);
185  int offset = totalGlyphs * sizeof(HB_FixedPoint);
186  glyphs = reinterpret_cast<HB_Glyph *>(address + offset);
187  offset += totalGlyphs * sizeof(HB_Glyph);
188  advances_x = reinterpret_cast<QFixed *>(address + offset);
189  offset += totalGlyphs * sizeof(QFixed);
190  advances_y = reinterpret_cast<QFixed *>(address + offset);
191  offset += totalGlyphs * sizeof(QFixed);
192  justifications = reinterpret_cast<QGlyphJustification *>(address + offset);
193  offset += totalGlyphs * sizeof(QGlyphJustification);
194  attributes = reinterpret_cast<HB_GlyphAttributes *>(address + offset);
195  numGlyphs = totalGlyphs;
196  }
QGlyphJustification * justifications
QFixed * advances_y
QFixed * advances_x
HB_Glyph * glyphs
HB_GlyphAttributes * attributes
QFixedPoint * offsets

Functions

◆ clear()

void QGlyphLayout::clear ( int  first = 0,
int  last = -1 
)
inline

Definition at line 244 of file qtextengine_p.h.

Referenced by grow(), and QTextEngine::LayoutData::LayoutData().

244  {
245  if (last == -1)
246  last = numGlyphs;
247  if (first == 0 && last == numGlyphs
248  && reinterpret_cast<char *>(offsets + numGlyphs) == reinterpret_cast<char *>(glyphs)) {
250  } else {
251  const int num = last - first;
252  memset(offsets + first, 0, num * sizeof(QFixedPoint));
253  memset(glyphs + first, 0, num * sizeof(HB_Glyph));
254  memset(advances_x + first, 0, num * sizeof(QFixed));
255  memset(advances_y + first, 0, num * sizeof(QFixed));
256  memset(justifications + first, 0, num * sizeof(QGlyphJustification));
257  memset(attributes + first, 0, num * sizeof(HB_GlyphAttributes));
258  }
259  }
QGlyphJustification * justifications
QFixed * advances_y
QFixed * advances_x
HB_Glyph * glyphs
static int spaceNeededForGlyphLayout(int totalGlyphs)
HB_GlyphAttributes * attributes
QFixedPoint * offsets

◆ data()

char* QGlyphLayout::data ( )
inline

Definition at line 261 of file qtextengine_p.h.

Referenced by QTextEngine::LayoutData::reallocate(), and QTextItemIntCopy::~QTextItemIntCopy().

261  {
262  return reinterpret_cast<char *>(offsets);
263  }
QFixedPoint * offsets

◆ effectiveAdvance()

QFixed QGlyphLayout::effectiveAdvance ( int  item) const
inline

◆ grow()

void QGlyphLayout::grow ( char *  address,
int  totalGlyphs 
)

Definition at line 2306 of file qtextengine.cpp.

Referenced by QTextEngine::LayoutData::reallocate().

2307 {
2308  QGlyphLayout oldLayout(address, numGlyphs);
2309  QGlyphLayout newLayout(address, totalGlyphs);
2310 
2311  if (numGlyphs) {
2312  // move the existing data
2313  memmove(newLayout.attributes, oldLayout.attributes, numGlyphs * sizeof(HB_GlyphAttributes));
2314  memmove(newLayout.justifications, oldLayout.justifications, numGlyphs * sizeof(QGlyphJustification));
2315  memmove(newLayout.advances_y, oldLayout.advances_y, numGlyphs * sizeof(QFixed));
2316  memmove(newLayout.advances_x, oldLayout.advances_x, numGlyphs * sizeof(QFixed));
2317  memmove(newLayout.glyphs, oldLayout.glyphs, numGlyphs * sizeof(HB_Glyph));
2318  }
2319 
2320  // clear the new data
2321  newLayout.clear(numGlyphs);
2322 
2323  *this = newLayout;
2324 }

◆ instance()

QGlyphLayoutInstance QGlyphLayout::instance ( int  position) const
inline

Definition at line 222 of file qtextengine_p.h.

Referenced by QFontEngineMulti::stringToCMap().

222  {
224  g.offset.x = offsets[position].x;
225  g.offset.y = offsets[position].y;
226  g.glyph = glyphs[position];
231  return g;
232  }
QGlyphJustification * justifications
QFixed * advances_y
QFixed * advances_x
HB_Glyph * glyphs
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
QFixed y
Definition: qfixed_p.h:191
QFixed x
Definition: qfixed_p.h:190
QGlyphJustification justification
HB_GlyphAttributes * attributes
HB_GlyphAttributes attributes
QFixedPoint * offsets

◆ mid()

QGlyphLayout QGlyphLayout::mid ( int  position,
int  n = -1 
) const
inline

Definition at line 198 of file qtextengine_p.h.

Referenced by QFontEngineMulti::addOutlineToPath(), QTextEngine::availableGlyphs(), QFontEngineMulti::boundingBox(), QTextEngine::boundingBox(), QFontEngineMulti::doKerning(), QTextLine::draw(), drawMenuText(), QTextLine::glyphs(), QTextEngine::justify(), QTextItemInt::midItem(), QFontEngineMulti::recalcAdvances(), QTextEngine::shapedGlyphs(), QTextEngine::shapeTextWithHarfbuzz(), QFontEngineMacMulti::stringToCMap(), QFontEngineMulti::stringToCMap(), and QTextEngine::tightBoundingBox().

198  {
199  QGlyphLayout copy = *this;
200  copy.glyphs += position;
201  copy.advances_x += position;
202  copy.advances_y += position;
203  copy.offsets += position;
204  copy.justifications += position;
205  copy.attributes += position;
206  if (n == -1)
207  copy.numGlyphs -= position;
208  else
209  copy.numGlyphs = n;
210  return copy;
211  }
QGlyphJustification * justifications
QFixed * advances_y
QFixed * advances_x
HB_Glyph * glyphs
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
HB_GlyphAttributes * attributes
QFixedPoint * offsets

◆ setInstance()

void QGlyphLayout::setInstance ( int  position,
const QGlyphLayoutInstance g 
)
inline

Definition at line 234 of file qtextengine_p.h.

Referenced by QFontEngineMulti::stringToCMap().

234  {
235  offsets[position].x = g.offset.x;
236  offsets[position].y = g.offset.y;
237  glyphs[position] = g.glyph;
242  }
QGlyphJustification * justifications
QFixed * advances_y
QFixed * advances_x
HB_Glyph * glyphs
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
QFixed y
Definition: qfixed_p.h:191
QFixed x
Definition: qfixed_p.h:190
QGlyphJustification justification
HB_GlyphAttributes * attributes
HB_GlyphAttributes attributes
QFixedPoint * offsets

◆ spaceNeededForGlyphLayout()

static int QGlyphLayout::spaceNeededForGlyphLayout ( int  totalGlyphs)
inlinestatic

Definition at line 213 of file qtextengine_p.h.

Referenced by QTextEngine::LayoutData::LayoutData(), QTextItemIntCopy::QTextItemIntCopy(), and QTextEngine::LayoutData::reallocate().

213  {
214  return totalGlyphs * (sizeof(HB_Glyph) + sizeof(HB_GlyphAttributes)
215  + sizeof(QFixed) + sizeof(QFixed) + sizeof(QFixedPoint)
216  + sizeof(QGlyphJustification));
217  }

Properties

◆ advances_x

QFixed* QGlyphLayout::advances_x

◆ advances_y

QFixed* QGlyphLayout::advances_y

◆ attributes

HB_GlyphAttributes* QGlyphLayout::attributes

◆ glyphs

HB_Glyph* QGlyphLayout::glyphs

Definition at line 172 of file qtextengine_p.h.

Referenced by QFontEngine::addBitmapFontToPath(), QFontEngine::addGlyphsToPath(), QFontEngineMulti::addOutlineToPath(), QRawFont::advancesForGlyphIndexes(), QFontEngineXLFD::alphaMapForGlyph(), atsuPostLayoutCallback(), QFontEngine::averageCharWidth(), QFontEngineXLFD::boundingBox(), QFontEngineQPA::boundingBox(), QFontEngineQPF::boundingBox(), QFontEngineFT::boundingBox(), QFontEngineMulti::boundingBox(), QFontMetrics::boundingRect(), QFontMetricsF::boundingRect(), QFontEngineXLFD::canRender(), QFontEngineMulti::canRender(), QFontEngine::doKerning(), QFontEngineMulti::doKerning(), QPainterPrivate::drawGlyphs(), QPainter::drawTextItem(), QTextEngine::elidedText(), QFontEngineQPF::ensureGlyphsLoaded(), QFontEngineWin::getGlyphIndexes(), QFontEngine::getGlyphPositions(), QFontSubset::getReverseMap(), QRawFont::glyphIndexesForChars(), QRawFont::glyphIndexesForString(), QTextLine::glyphs(), grow(), hb_getAdvances(), QFontEngine::lastRightBearing(), QFontMetrics::leftBearing(), QFontMetricsF::leftBearing(), mid(), QFontEngineFT::minRightBearing(), moveGlyphData(), QTextItemIntCopy::QTextItemIntCopy(), QFontEngineMac::recalcAdvances(), QProxyFontEngine::recalcAdvances(), QFontEngineWin::recalcAdvances(), QFontEngineDirectWrite::recalcAdvances(), QFontEngineXLFD::recalcAdvances(), QFontEngineQPA::recalcAdvances(), QFontEngineQPF::recalcAdvances(), QFontEngineFT::recalcAdvances(), QFontEngineQPF1::recalcAdvances(), QFontEngineMulti::recalcAdvances(), QFontMetrics::rightBearing(), QFontMetricsF::rightBearing(), set(), QTextEngine::shapeTextWithHarfbuzz(), QFontEngineMac::stringToCMap(), QProxyFontEngine::stringToCMap(), QFontEngineDirectWrite::stringToCMap(), QFontEngineXLFD::stringToCMap(), QFontEngineQPA::stringToCMap(), QFontEngineQPF::stringToCMap(), QFontEngineFT::stringToCMap(), QFontEngineQPF1::stringToCMap(), QFontEngineBox::stringToCMap(), QFontEngineMulti::stringToCMap(), QFontEngine::tightBoundingBox(), and QFontEngine::xHeight().

◆ justifications

QGlyphJustification* QGlyphLayout::justifications

◆ numGlyphs

int QGlyphLayout::numGlyphs

Definition at line 178 of file qtextengine_p.h.

Referenced by QFontEngine::addBitmapFontToPath(), QFontEngine::addOutlineToPath(), QFontEngineFT::addOutlineToPath(), QFontEngineBox::addOutlineToPath(), QFontEngineMulti::addOutlineToPath(), QRawFont::advancesForGlyphIndexes(), QFontEngineMac::boundingBox(), QProxyFontEngine::boundingBox(), QFontEngineWin::boundingBox(), QFontEngineDirectWrite::boundingBox(), QFontEngineXLFD::boundingBox(), QFontEngineQPA::boundingBox(), QFontEngineQPF::boundingBox(), QFontEngineFT::boundingBox(), QFontEngineQPF1::boundingBox(), QFontEngineBox::boundingBox(), QFontEngineMulti::boundingBox(), QFontEngine::doKerning(), QFontEngineMulti::doKerning(), QPaintEnginePrivate::drawBoxTextItem(), QX11PaintEngine::drawFreetype(), QPainterPrivate::drawGlyphs(), drawMenuText(), QPainter::drawText(), QCoreGraphicsPaintEngine::drawTextItem(), QPaintEngine::drawTextItem(), QX11PaintEngine::drawXLFD(), QFontEngineQPF::ensureGlyphsLoaded(), QFontEngineWin::getGlyphIndexes(), QFontEngine::getGlyphPositions(), QTextLine::glyphs(), QFontEngine::lastRightBearing(), mid(), QTextItemIntCopy::QTextItemIntCopy(), QTextEngine::LayoutData::reallocate(), QFontEngineMac::recalcAdvances(), QProxyFontEngine::recalcAdvances(), QFontEngineWin::recalcAdvances(), QFontEngineDirectWrite::recalcAdvances(), QFontEngineXLFD::recalcAdvances(), QFontEngineQPA::recalcAdvances(), QFontEngineQPF::recalcAdvances(), QFontEngineFT::recalcAdvances(), QFontEngineQPF1::recalcAdvances(), QFontEngineBox::recalcAdvances(), QFontEngineMulti::recalcAdvances(), QTextEngine::shapeTextMac(), QFontEngineMac::stringToCMap(), QProxyFontEngine::stringToCMap(), QFontEngineXLFD::stringToCMap(), QFontEngineMacMulti::stringToCMap(), QFontEngineQPA::stringToCMap(), QFontEngineQPF::stringToCMap(), QFontEngineFT::stringToCMap(), QFontEngineQPF1::stringToCMap(), QFontEngineBox::stringToCMap(), QFontEngineMulti::stringToCMap(), stringToGlyphs(), and QFontEngine::tightBoundingBox().

◆ offsets

QFixedPoint* QGlyphLayout::offsets

The documentation for this struct was generated from the following files: