Skip to content

Commit

Permalink
[skottie] Fix font fallback in viewer and skottie_tool
Browse files Browse the repository at this point in the history
After https://skia-review.googlesource.com/c/skia/+/782356 we need an
explicit font manager for font fallback to work.

Change-Id: I04d67a0ec0caee18ac230fded199f237722ff6e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/798676
Reviewed-by: Ben Wagner <[email protected]>
Commit-Queue: Florin Malita <[email protected]>
Reviewed-by: Jorge Betancourt <[email protected]>
  • Loading branch information
fmalita authored and SkCQ committed Jan 10, 2024
1 parent 334160c commit ead29ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/skottie/src/SkottieTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ int main(int argc, char** argv) {
// - we need to know its duration upfront
// - we want to only report parsing errors once
auto anim = skottie::Animation::Builder()
.setFontManager(fontMgr)
.setLogger(logger)
.setResourceProvider(rp)
.make(static_cast<const char*>(data->data()), data->size());
Expand Down
2 changes: 1 addition & 1 deletion modules/skottie/src/layers/TextLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ bool AnimationBuilder::resolveNativeTypefaces() {
}
if (!finfo->fTypeface && !fFontMgr) {
this->log(Logger::Level::kError, nullptr,
"Could not load typeface for %s|%s becuase no SkFontMgr provided.",
"Could not load typeface for %s|%s because no SkFontMgr provided.",
finfo->fFamily.c_str(), finfo->fStyle.c_str());
}
});
Expand Down
1 change: 1 addition & 0 deletions tools/viewer/SkottieSlide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ void SkottieSlide::init() {
auto text_tracker = sk_make_sp<TextTracker>(fTransformTracker);

builder.setLogger(logger)
.setFontManager(ToolUtils::TestFontMgr())
.setPrecompInterceptor(std::move(precomp_interceptor))
.setResourceProvider(resource_provider)
.setPropertyObserver(text_tracker);
Expand Down

0 comments on commit ead29ba

Please sign in to comment.