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:
Jason Simmons 2017-09-01 16:09:47 -07:00 committed by GitHub
parent dd2b2543f6
commit 42c3a7622c
3 changed files with 17 additions and 2 deletions

View File

@ -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" ]
}

View File

@ -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,

View 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