summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/qt/FontQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/qt/FontQt.cpp')
-rw-r--r--WebCore/platform/graphics/qt/FontQt.cpp55
1 files changed, 45 insertions, 10 deletions
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp
index 89dfd00..131ae93 100644
--- a/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/WebCore/platform/graphics/qt/FontQt.cpp
@@ -29,6 +29,7 @@
#include "FontSelector.h"
#include "Gradient.h"
#include "GraphicsContext.h"
+#include "NotImplemented.h"
#include "Pattern.h"
#include <QBrush>
@@ -79,7 +80,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
QPainter *p = ctx->platformContext();
QPen textFillPen;
- if (ctx->textDrawingMode() & cTextFill) {
+ if (ctx->textDrawingMode() & TextModeFill) {
if (ctx->fillGradient()) {
QBrush brush(*ctx->fillGradient()->platformGradient());
brush.setTransform(ctx->fillGradient()->gradientSpaceTransform());
@@ -92,7 +93,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
}
QPen textStrokePen;
- if (ctx->textDrawingMode() & cTextStroke) {
+ if (ctx->textDrawingMode() & TextModeStroke) {
if (ctx->strokeGradient()) {
QBrush brush(*ctx->strokeGradient()->platformGradient());
brush.setTransform(ctx->strokeGradient()->gradientSpaceTransform());
@@ -145,7 +146,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
if (ctxShadow->m_type != ContextShadow::NoShadow) {
ContextShadow* ctxShadow = ctx->contextShadow();
- if (ctxShadow->m_type != ContextShadow::BlurShadow) {
+ if (!ctxShadow->mustUseContextShadow(p)) {
p->save();
p->setPen(ctxShadow->m_color);
p->translate(ctxShadow->offset());
@@ -179,17 +180,17 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
int flags = run.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
// See QWebPagePrivate::QWebPagePrivate() where the default path is set to Complex for Qt 4.6 and earlier.
- if (!isComplexText && !(ctx->textDrawingMode() & cTextStroke))
+ if (!isComplexText && !(ctx->textDrawingMode() & TextModeStroke))
flags |= Qt::TextBypassShaping;
#endif
QPainterPath textStrokePath;
- if (ctx->textDrawingMode() & cTextStroke)
+ if (ctx->textDrawingMode() & TextModeStroke)
textStrokePath.addText(pt, font, string);
ContextShadow* ctxShadow = ctx->contextShadow();
if (ctxShadow->m_type != ContextShadow::NoShadow) {
- if (ctx->textDrawingMode() & cTextFill) {
+ if (ctx->textDrawingMode() & TextModeFill) {
if (ctxShadow->m_type != ContextShadow::BlurShadow) {
p->save();
p->setPen(ctxShadow->m_color);
@@ -212,7 +213,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
ctxShadow->endShadowLayer(p);
}
}
- } else if (ctx->textDrawingMode() & cTextStroke) {
+ } else if (ctx->textDrawingMode() & TextModeStroke) {
if (ctxShadow->m_type != ContextShadow::BlurShadow) {
p->translate(ctxShadow->offset());
p->strokePath(textStrokePath, QPen(ctxShadow->m_color));
@@ -235,10 +236,10 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
}
}
- if (ctx->textDrawingMode() & cTextStroke)
+ if (ctx->textDrawingMode() & TextModeStroke)
p->strokePath(textStrokePath, textStrokePen);
- if (ctx->textDrawingMode() & cTextFill) {
+ if (ctx->textDrawingMode() & TextModeFill) {
QPen previousPen = p->pen();
p->setPen(textFillPen);
p->drawText(pt, string, flags, run.padding());
@@ -260,8 +261,39 @@ void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const Float
drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */true);
}
+int Font::emphasisMarkAscent(const AtomicString&) const
+{
+ notImplemented();
+ return 0;
+}
+
+int Font::emphasisMarkDescent(const AtomicString&) const
+{
+ notImplemented();
+ return 0;
+}
+
+int Font::emphasisMarkHeight(const AtomicString&) const
+{
+ notImplemented();
+ return 0;
+}
+
+void Font::drawEmphasisMarksForSimpleText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
+{
+ notImplemented();
+}
+
+void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
+{
+ notImplemented();
+}
+
float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
{
+ if (!primaryFont()->platformData().size())
+ return 0;
+
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
if (!run.length())
return 0;
@@ -278,12 +310,15 @@ float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer
return w + run.padding();
#else
Q_ASSERT(false);
- return 0.0f;
+ return 0;
#endif
}
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
{
+ if (!primaryFont()->platformData().size())
+ return 0;
+
if (!run.length())
return 0;