use font for measuring/paths
add get_text_path to sk_tool_utils
Bug: skia:
Change-Id: I45426bc018cd8a5a0309fd6a73adb30755e8155a
Reviewed-on: https://skia-review.googlesource.com/c/179847
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h
index b3aae80..645ac5d 100644
--- a/tools/sk_tool_utils.h
+++ b/tools/sk_tool_utils.h
@@ -12,6 +12,7 @@
#include "SkData.h"
#include "SkEncodedImageFormat.h"
#include "SkFontStyle.h"
+#include "SkFontTypes.h"
#include "SkImageEncoder.h"
#include "SkImageInfo.h"
#include "SkRandom.h"
@@ -26,6 +27,7 @@
class SkBitmap;
class SkCanvas;
+class SkFont;
class SkFontStyle;
class SkImage;
class SkPaint;
@@ -78,6 +80,9 @@
return create_portable_typeface(nullptr, SkFontStyle());
}
+ void get_text_path(const SkFont&, const void* text, size_t length, SkTextEncoding, SkPath*,
+ const SkPoint* positions = nullptr);
+
/**
* Call writePixels() by using the pixels from bitmap, but with an info that claims
* the pixels are colorType + alphaType