SkTypeface_android.h revision e4faa14de8a1264811f07e4d24477ef33235cce2
1/* 2 * Copyright 2012 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 9#ifndef SkTypeface_android_DEFINED 10#define SkTypeface_android_DEFINED 11 12#include "SkTypeface.h" 13 14/** 15 * Get the family name of the font in the fallback font list containing 16 * the specified chararacter. if no font is found, returns false. 17 */ 18SK_API bool SkGetFallbackFamilyNameForChar(SkUnichar uni, SkString* name); 19 20/** 21 * For test only. 22 * Load font config from given xml files, instead of those from Android system. 23 */ 24SK_API void SkUseTestFontConfigFile(const char* mainconf, const char* fallbackconf, 25 const char* fontsdir); 26 27/** 28 * Given a "current" fontID, return a ref to the next logical typeface 29 * when searching fonts for a given unicode value. Typically the caller 30 * will query a given font, and if a unicode value is not supported, they 31 * will call this, and if 0 is not returned, will search that font, and so 32 * on. This process must be finite, and when the fonthost sees a 33 * font with no logical successor, it must return NULL. 34 * 35 * The original fontID is also provided. This is the initial font that was 36 * stored in the typeface of the caller. It is provided as an aid to choose 37 * the best next logical font. e.g. If the original font was bold or serif, 38 * but the 2nd in the logical chain was plain, then a subsequent call to 39 * get the 3rd can still inspect the original, and try to match its 40 * stylistic attributes. 41 */ 42SkTypeface* SkAndroidNextLogicalTypeface(SkFontID currFontID, SkFontID origFontID); 43 44#endif 45