[HarfBuzz] harfbuzz: Branch 'origin'
Simon Hausmann
hausmann at kemper.freedesktop.org
Wed Jan 3 06:53:25 PST 2007
test/qt/generator/main.cpp | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
New commits:
diff-tree 50ad1ea708de6b2604473a17c14f3f9a5bd00bb1 (from 616e2d40acb30aa8dfa4e839128247b61d327c71)
Author: Simon Hausmann <shausman at rhea.troll.no>
Date: Fri Dec 15 17:00:23 2006 +0100
no need for the #define private public hack
diff --git a/test/qt/generator/main.cpp b/test/qt/generator/main.cpp
index 3f1ee1c..1922181 100644
--- a/test/qt/generator/main.cpp
+++ b/test/qt/generator/main.cpp
@@ -20,12 +20,10 @@
#include <qendian.h>
#include "ui_generator.h"
-#define private public
#include <qfont.h>
#include <private/qtextengine_p.h>
#include <private/qfontengine_p.h>
#include <qtextlayout.h>
-#undef private
static QString generate(const QString &family, int pixelSize, const QString &sampleText)
{
@@ -35,13 +33,12 @@ static QString generate(const QString &f
font.setStyleStrategy(QFont::NoFontMerging);
font.setKerning(false);
- QTextLayout layout(sampleText, font);
- QTextEngine *e = layout.d;
- e->itemize();
- e->shape(0);
+ QTextEngine e(sampleText, font);
+ e.itemize();
+ e.shape(0);
QString result;
- QFontEngine *fe = e->fontEngine(e->layoutData->items[0]);
+ QFontEngine *fe = e.fontEngine(e.layoutData->items[0]);
result = "# Using font '" + fe->fontDef.family + "'\n";
{
@@ -50,13 +47,13 @@ static QString generate(const QString &f
result += "# Font Revision: " + QString::number(revision) + "\n";
}
- result += "# Text: " + sampleText;
+ result += "# Input Text: " + sampleText;
result += "\n# Codepoints: ";
- for (int i = 0; i < sampleText.length(); ++i)
+ for (int i = 0; i < sampleText.length(); ++i)
result += "0x" + QString::number(sampleText.at(i).unicode(), 16) + " ";
result += "\n# Glyphs [glyph] [x advance] [x offset] [y offset]\n";
- for (int i = 0; i < e->layoutData->items[0].num_glyphs; ++i) {
- QGlyphLayout *g = e->layoutData->glyphPtr + i;
+ for (int i = 0; i < e.layoutData->items[0].num_glyphs; ++i) {
+ QGlyphLayout *g = e.layoutData->glyphPtr + i;
result += "0x" + QString::number(g->glyph, 16);
result += ' ';
result += QString::number(g->advance.x.toReal());
More information about the HarfBuzz
mailing list