Implement new TextMetrics, returned by canvas measureText()
[WebKit-https.git] / Source / WebCore / html / canvas / CanvasRenderingContext2D.h
index 68012256441bf4f80499250afa462ee889a8e388..143385d1762327a23370bb7bfffc1239fd5b0720 100644 (file)
@@ -250,9 +250,9 @@ public:
 
         bool realized() const { return m_font.fontSelector(); }
         void initialize(FontSelector&, const RenderStyle&);
-        FontMetrics fontMetrics() const;
+        const FontMetrics& fontMetrics() const;
         const FontCascadeDescription& fontDescription() const;
-        float width(const TextRun&) const;
+        float width(const TextRun&, GlyphOverflow* = 0) const;
         void drawBidiText(GraphicsContext&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction) const;
 
     private:
@@ -390,6 +390,8 @@ private:
     bool hasInvertibleTransform() const override { return state().hasInvertibleTransform; }
     TextDirection toTextDirection(Direction, const RenderStyle** computedStyle = nullptr) const;
 
+    FloatPoint textOffset(float width, TextDirection);
+
 #if ENABLE(ACCELERATED_2D_CANVAS)
     PlatformLayer* platformLayer() const override;
 #endif