Use a generic sans-serif font family on Android that will be recognized by Skia's font manager (flutter/engine#4055)
This commit is contained in:
2
engine/src/flutter/third_party/txt/BUILD.gn
vendored
2
engine/src/flutter/third_party/txt/BUILD.gn
vendored
@@ -105,6 +105,8 @@ source_set("txt") {
|
||||
set_sources_assignment_filter([])
|
||||
sources += [ "src/txt/platform_mac.mm" ]
|
||||
set_sources_assignment_filter(sources_assignment_filter)
|
||||
} else if (is_android) {
|
||||
sources += [ "src/txt/platform_android.cc" ]
|
||||
} else {
|
||||
sources += [ "src/txt/platform.cc" ]
|
||||
}
|
||||
|
||||
@@ -148,8 +148,8 @@ bool Paragraph::AddRunsToLineBreaker(
|
||||
auto collection = font_collection_->GetMinikinFontCollectionForFamily(
|
||||
run.style.font_family);
|
||||
if (collection == nullptr) {
|
||||
FTL_DLOG(INFO) << "Could not find font collection for family \""
|
||||
<< run.style.font_family << "\".";
|
||||
FTL_LOG(INFO) << "Could not find font collection for family \""
|
||||
<< run.style.font_family << "\".";
|
||||
return false;
|
||||
}
|
||||
breaker_.addStyleRun(&paint, collection, font, run.start, run.end, false,
|
||||
|
||||
13
engine/src/flutter/third_party/txt/src/txt/platform_android.cc
vendored
Normal file
13
engine/src/flutter/third_party/txt/src/txt/platform_android.cc
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "txt/platform.h"
|
||||
|
||||
namespace txt {
|
||||
|
||||
std::string GetDefaultFontFamily() {
|
||||
return "sans-serif";
|
||||
}
|
||||
|
||||
} // namespace txt
|
||||
Reference in New Issue
Block a user