[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/unity
From: Simon Hausmann <hausmann () kde ! org>
Date: 2006-07-11 19:17:14
Message-ID: 1152645434.991900.8856.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 561267 by hausmann:
r234@rhea (orig r233): shausman | 2006-07-09 19:10:56 +0200
- get some of the metrics working. not perfect yet but at least a simple <p>Hello World renders now due
to the working linespacing
_M . (directory)
M +8 -0 WebKit/WebCore/platform/qt/FontDataQt.cpp
M +2 -0 WebKit/WebCore/platform/qt/FontQt.cpp
--- branches/work/unity/WebKit/WebCore/platform/qt/FontDataQt.cpp #561266:561267
@@ -39,11 +39,19 @@
#include <unicode/uchar.h>
#include <unicode/unorm.h>
#include <wtf/MathExtras.h>
+#include <QFontMetrics>
namespace WebCore {
void FontData::platformInit()
{
+ QFontMetrics metrics(m_font.font());
+ m_ascent = metrics.ascent();
+ m_descent = metrics.descent();
+ m_lineSpacing = metrics.lineSpacing();
+ m_lineGap = metrics.leading();
+ m_xHeight = metrics.xHeight();
+ m_lineSpacing = m_ascent + m_descent + m_lineGap;
}
void FontData::platformDestroy()
--- branches/work/unity/WebKit/WebCore/platform/qt/FontQt.cpp #561266:561267
@@ -32,6 +32,7 @@
#include "GraphicsContext.h"
#include <QPainter>
+#include <QDebug>
namespace WebCore {
@@ -44,6 +45,7 @@
p.setFont(font->platformData().font());
QChar *buffer = reinterpret_cast<QChar*>(glyphBuffer.glyphs(from));
QString str = QString::fromRawData(buffer, numGlyphs);
+ qDebug() << "Font::drawGlyphs:" << str;
p.drawText(QPointF(point.x(),point.y()), str);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic