Flutter Engine
 
Loading...
Searching...
No Matches
font_asset_provider.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <algorithm>
6#include <string>
7
9
10namespace txt {
11
12// Return a canonicalized version of a family name that is suitable for
13// matching.
14std::string FontAssetProvider::CanonicalFamilyName(std::string family_name) {
15 std::string result(family_name.length(), 0);
16
17 // Convert ASCII characters to lower case.
18 std::transform(family_name.begin(), family_name.end(), result.begin(),
19 [](char c) { return (c & 0x80) ? c : ::tolower(c); });
20
21 return result;
22}
23
24} // namespace txt
static std::string CanonicalFamilyName(std::string family_name)