1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MINIKIN_FONT_FEATURE_UTILS_H 18 #define MINIKIN_FONT_FEATURE_UTILS_H 19 20 #include <hb.h> 21 22 #include "minikin/MinikinPaint.h" 23 24 namespace minikin { 25 26 /** 27 * Returns the final set of font features based on the features requested by this paint object and 28 * extra defaults or implied font features. 29 * 30 * Features are included from the paint object if they are: 31 * 1) in a supported range 32 * 33 * Default features are added based if they are: 34 * 1) implied due to Paint settings such as letterSpacing 35 * 2) default features that do not conflict with requested features 36 */ 37 std::vector<hb_feature_t> cleanAndAddDefaultFontFeatures(const MinikinPaint& paint); 38 39 } // namespace minikin 40 #endif // MINIKIN_LAYOUT_UTILS_H 41