diff options
author | bungeman <bungeman@google.com> | 2017-02-17 18:03:49 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-23 18:41:57 +0000 |
commit | 0f3d0c37dbcaf4ec271d5fe847becc9b1aa6f537 (patch) | |
tree | cae67def2ed8a8ba416132b609cb98fe7563c691 /src/ports/SkFontMgr_FontConfigInterface.cpp | |
parent | 6d67396bf06fb603825bf6a792a2e1c8eb405fe0 (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.cpp | 11 |
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(¶mAxisCount); 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); |