Flutter Engine
 
Loading...
Searching...
No Matches
font_features.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 "font_features.h"
6
7#include <sstream>
8
9namespace txt {
10
11void FontFeatures::SetFeature(const std::string& tag, int value) {
12 feature_map_[tag] = value;
13}
14
16 if (feature_map_.empty()) {
17 return "";
18 }
19
20 std::ostringstream stream;
21
22 for (const auto& kv : feature_map_) {
23 if (stream.tellp()) {
24 stream << ',';
25 }
26 stream << kv.first << '=' << kv.second;
27 }
28
29 return stream.str();
30}
31
32const std::map<std::string, int>& FontFeatures::GetFontFeatures() const {
33 return feature_map_;
34}
35
36void FontVariations::SetAxisValue(const std::string& tag, float value) {
37 axis_map_[tag] = value;
38}
39
40const std::map<std::string, float>& FontVariations::GetAxisValues() const {
41 return axis_map_;
42}
43
44} // namespace txt
const std::map< std::string, int > & GetFontFeatures() const
void SetFeature(const std::string &tag, int value)
std::string GetFeatureSettings() const
const std::map< std::string, float > & GetAxisValues() const
void SetAxisValue(const std::string &tag, float value)
int32_t value