aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontMgr_FontConfigInterface.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2017-02-17 18:03:49 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-23 18:41:57 +0000
commit0f3d0c37dbcaf4ec271d5fe847becc9b1aa6f537 (patch)
treecae67def2ed8a8ba416132b609cb98fe7563c691 /src/ports/SkFontMgr_FontConfigInterface.cpp
parent6d67396bf06fb603825bf6a792a2e1c8eb405fe0 (diff)
Add SkTypeface::getVariationDesignPosition.
Allow users to query a typeface's position in variation design space. Change-Id: I173ee9eefdddee6b2613435ebcc6b08c25b382ed Reviewed-on: https://skia-review.googlesource.com/8684 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/ports/SkFontMgr_FontConfigInterface.cpp')
-rw-r--r--src/ports/SkFontMgr_FontConfigInterface.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ports/SkFontMgr_FontConfigInterface.cpp b/src/ports/SkFontMgr_FontConfigInterface.cpp
index 81c4868e5d..6264710008 100644
--- a/src/ports/SkFontMgr_FontConfigInterface.cpp
+++ b/src/ports/SkFontMgr_FontConfigInterface.cpp
@@ -222,7 +222,7 @@ protected:
return SkTypeface_FCI::Create(std::move(fontData), std::move(name), style, isFixedPitch);
}
- SkTypeface* onCreateFromStream(SkStreamAsset* s, const FontParameters& params) const override {
+ SkTypeface* onCreateFromStream(SkStreamAsset* s, const SkFontArguments& args) const override {
using Scanner = SkTypeface_FreeType::Scanner;
std::unique_ptr<SkStreamAsset> stream(s);
const size_t length = stream->getLength();
@@ -237,19 +237,18 @@ protected:
SkFontStyle style;
SkString name;
Scanner::AxisDefinitions axisDefinitions;
- if (!fScanner.scanFont(stream.get(), params.getCollectionIndex(),
+ if (!fScanner.scanFont(stream.get(), args.getCollectionIndex(),
&name, &style, &isFixedPitch, &axisDefinitions))
{
return nullptr;
}
- int paramAxisCount;
- const FontParameters::Axis* paramAxes = params.getAxes(&paramAxisCount);
SkAutoSTMalloc<4, SkFixed> axisValues(axisDefinitions.count());
- Scanner::computeAxisValues(axisDefinitions, paramAxes, paramAxisCount, axisValues, name);
+ Scanner::computeAxisValues(axisDefinitions, args.getVariationDesignPosition(),
+ axisValues, name);
auto fontData = skstd::make_unique<SkFontData>(std::move(stream),
- params.getCollectionIndex(),
+ args.getCollectionIndex(),
axisValues.get(),
axisDefinitions.count());
return SkTypeface_FCI::Create(std::move(fontData), std::move(name), style, isFixedPitch);