/src/serenity/Userland/Libraries/LibWeb/HTML/Canvas/CanvasText.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/ByteString.h> |
10 | | #include <AK/Optional.h> |
11 | | #include <LibWeb/HTML/TextMetrics.h> |
12 | | |
13 | | namespace Web::HTML { |
14 | | |
15 | | // https://html.spec.whatwg.org/multipage/canvas.html#canvastext |
16 | | class CanvasText { |
17 | | public: |
18 | 0 | virtual ~CanvasText() = default; |
19 | | |
20 | | virtual void fill_text(StringView, float x, float y, Optional<double> max_width) = 0; |
21 | | virtual void stroke_text(StringView, float x, float y, Optional<double> max_width) = 0; |
22 | | virtual JS::NonnullGCPtr<TextMetrics> measure_text(StringView text) = 0; |
23 | | |
24 | | protected: |
25 | 0 | CanvasText() = default; |
26 | | }; |
27 | | |
28 | | } |