OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkShaper_DEFINED |
| 9 #define SkShaper_DEFINED |
| 10 |
| 11 #include <memory> |
| 12 |
| 13 #include "SkPoint.h" |
| 14 #include "SkTypeface.h" |
| 15 |
| 16 class SkPaint; |
| 17 class SkTextBlobBuilder; |
| 18 |
| 19 /** |
| 20 Shapes text using harfbuzz and places the shaped text into a |
| 21 TextBlob. |
| 22 */ |
| 23 class SkShaper { |
| 24 public: |
| 25 SkShaper(sk_sp<SkTypeface> face); |
| 26 ~SkShaper(); |
| 27 |
| 28 bool good() const; |
| 29 SkScalar shape(SkTextBlobBuilder* dest, |
| 30 const SkPaint& srcPaint, |
| 31 const char* utf8text, |
| 32 size_t textBytes, |
| 33 SkPoint point) const; |
| 34 |
| 35 private: |
| 36 SkShaper(const SkShaper&) = delete; |
| 37 SkShaper& operator=(const SkShaper&) = delete; |
| 38 |
| 39 struct Impl; |
| 40 std::unique_ptr<Impl> fImpl; |
| 41 }; |
| 42 |
| 43 #endif // SkShaper_DEFINED |
OLD | NEW |