--- ./Source/WebCore/platform/graphics/qt/FontCascadeQt.cpp	Wed Mar 11 20:28:30 2020
+++ ./Source/WebCore/platform/graphics/qt/FontCascadeQt.cpp	Sat Oct  5 14:17:53 2019
@@ -175,6 +175,59 @@
     }
 }
 
+static void drawQtGlyphRun(GraphicsContext& context, const TextRun& run, const QFont& qtFont, const QGlyphRun& qtGlyphRun, const QPointF& point, qreal baseLineOffset)
+{
+    QPainter* painter = context.platformContext();
+
+    QPainterPath textStrokePath;
+    if (context.textDrawingMode() & TextModeStroke)
+        textStrokePath = pathForGlyphs(qtGlyphRun, point);
+
+    if (context.hasShadow()) {
+        const GraphicsContextState& state = context.state();
+        if (context.mustUseShadowBlur()) {
+            ShadowBlur shadow(state);
+            const qreal width = qtGlyphRun.boundingRect().width();
+            const QRawFont& font = qtGlyphRun.rawFont();
+            const qreal height = font.ascent() + font.descent();
+            const QRectF boundingRect(point.x(), point.y() - font.ascent() + baseLineOffset, width, height);
+            GraphicsContext* shadowContext = shadow.beginShadowLayer(context, boundingRect);
+            if (shadowContext) {
+                QPainter* shadowPainter = shadowContext->platformContext();
+                shadowPainter->setPen(state.shadowColor);
+                if (shadowContext->textDrawingMode() & TextModeFill)
+                    shadowPainter->drawGlyphRun(point, qtGlyphRun);
+                else if (shadowContext->textDrawingMode() & TextModeStroke)
+                    shadowPainter->strokePath(textStrokePath, shadowPainter->pen());
+                shadow.endShadowLayer(context);
+            }
+        }
+        else {
+            QPen previousPen = painter->pen();
+            painter->setPen(state.shadowColor);
+            const QPointF shadowOffset(state.shadowOffset.width(), state.shadowOffset.height());
+            painter->translate(shadowOffset);
+            if (context.textDrawingMode() & TextModeFill)
+                painter->drawGlyphRun(point, qtGlyphRun);
+            else if (context.textDrawingMode() & TextModeStroke)
+                painter->strokePath(textStrokePath, painter->pen());
+            painter->translate(-shadowOffset);
+            painter->setPen(previousPen);
+        }
+    }
+
+    if (context.textDrawingMode() & TextModeStroke)
+        painter->strokePath(textStrokePath, strokePenForContext(context));
+
+    if (context.textDrawingMode() & TextModeFill) {
+        QPen previousPen = painter->pen();
+        painter->setPen(fillPenForContext(context));
+        painter->setFont(qtFont);
+        painter->drawGlyphRun(point, qtGlyphRun, run.string());
+        painter->setPen(previousPen);
+    }
+}
+
 void FontCascade::drawComplexText(GraphicsContext& ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
 {
     QString string = toNormalizedQString(run);
@@ -329,6 +382,46 @@
     drawQtGlyphRun(context, qtGlyphs, point, /* baselineOffset = */0);
 }
 
+void FontCascade::drawGlyphs(GraphicsContext& context, const TextRun& run, const QFont& qtFont, const Font& font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point, FontSmoothingMode)
+{
+    if (!font.platformData().size())
+        return;
+
+    if (context.paintingDisabled())
+        return;
+
+    bool shouldFill = context.textDrawingMode() & TextModeFill;
+    bool shouldStroke = context.textDrawingMode() & TextModeStroke;
+
+    if (!shouldFill && !shouldStroke)
+        return;
+
+    QVector<quint32> glyphIndexes;
+    QVector<QPointF> positions;
+
+    glyphIndexes.reserve(numGlyphs);
+    positions.reserve(numGlyphs);
+    const QRawFont& rawFont = font.getQtRawFont();
+
+    float width = 0;
+
+    for (int i = 0; i < numGlyphs; ++i) {
+        Glyph glyph = glyphBuffer.glyphAt(from + i);
+        float advance = glyphBuffer.advanceAt(from + i).width();
+        if (!glyph)
+            continue;
+        glyphIndexes.append(glyph);
+        positions.append(QPointF(width, 0));
+        width += advance;
+    }
+
+    QGlyphRun qtGlyphs;
+    qtGlyphs.setGlyphIndexes(glyphIndexes);
+    qtGlyphs.setPositions(positions);
+    qtGlyphs.setRawFont(rawFont);
+
+    drawQtGlyphRun(context, run, qtFont, qtGlyphs, point, /* baselineOffset = */0);
+}
 
 bool FontCascade::canExpandAroundIdeographsInComplexText()
 {
--- ./Source/WebCore/platform/graphics/FontCascade.h	Wed Mar 11 20:28:28 2020
+++ ./Source/WebCore/platform/graphics/FontCascade.h	Sat Oct  5 14:16:28 2019
@@ -142,6 +142,7 @@
     enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
     WEBCORE_EXPORT float drawText(GraphicsContext&, const TextRun&, const FloatPoint&, int from = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
     static void drawGlyphs(GraphicsContext&, const Font&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&, FontSmoothingMode);
+    static void drawGlyphs(GraphicsContext&, const TextRun&, const QFont& qtFont, const Font&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&, FontSmoothingMode);
     void drawEmphasisMarks(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1) const;
 
     DashArray dashesForIntersectionsWithRect(const TextRun&, const FloatPoint& textOrigin, const FloatRect& lineExtents) const;
--- ./Source/WebCore/platform/graphics/FontCascade.cpp	Wed Mar 11 20:28:28 2020
+++ ./Source/WebCore/platform/graphics/FontCascade.cpp	Sat Oct  5 14:16:52 2019
@@ -1342,7 +1342,7 @@
                 renderingContext->drawSVGGlyphs(context, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
             else
 #endif
-                context.drawGlyphs(*this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+                context.drawGlyphs(*this, run, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
 
             lastFrom = nextGlyph;
             fontData = nextFontData;
@@ -1361,7 +1361,7 @@
     else
 #endif
     {
-        context.drawGlyphs(*this, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+        context.drawGlyphs(*this, run, *fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
         point.setX(nextX);
     }
 }
--- ./Source/WebCore/platform/graphics/GraphicsContext.h	Wed Mar 11 20:28:28 2020
+++ ./Source/WebCore/platform/graphics/GraphicsContext.h	Sat Oct  5 14:15:58 2019
@@ -396,7 +396,8 @@
     TextDrawingModeFlags textDrawingMode() const { return m_state.textDrawingMode; }
 
     float drawText(const FontCascade&, const TextRun&, const FloatPoint&, int from = 0, int to = -1);
+    void drawGlyphs(const FontCascade&, const TextRun& run, const Font&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&);
     void drawGlyphs(const FontCascade&, const Font&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&);
     void drawEmphasisMarks(const FontCascade&, const TextRun& , const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1);
     void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady);
 
     void applyState(const GraphicsContextState&);
--- ./Source/WebCore/platform/graphics/GraphicsContext.cpp	Wed Mar 11 20:28:28 2020
+++ ./Source/WebCore/platform/graphics/GraphicsContext.cpp	Sat Oct  5 14:16:19 2019
@@ -675,6 +675,19 @@
     fontCascade.drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing());
 }
 
+void GraphicsContext::drawGlyphs(const FontCascade& fontCascade, const TextRun& run, const Font& font, const GlyphBuffer& buffer, int from, int numGlyphs, const FloatPoint& point)
+{
+    if (paintingDisabled())
+        return;
+
+    if (isRecording()) {
+        m_displayListRecorder->drawGlyphs(font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing());
+        return;
+    }
+
+    fontCascade.drawGlyphs(*this, run, fontCascade.syntheticFont(), font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing());
+}
+
 void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to)
 {
     if (paintingDisabled())
