Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/ports/SkFontConfigParser_android.h

Issue 1092093002: Respect declared font style on Android. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Always assign style. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « site/dev/contrib/style.md ('k') | src/ports/SkFontConfigParser_android.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_ 8 #ifndef SKFONTCONFIGPARSER_ANDROID_H_
9 #define SKFONTCONFIGPARSER_ANDROID_H_ 9 #define SKFONTCONFIGPARSER_ANDROID_H_
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 enum FontVariants { 55 enum FontVariants {
56 kDefault_FontVariant = 0x01, 56 kDefault_FontVariant = 0x01,
57 kCompact_FontVariant = 0x02, 57 kCompact_FontVariant = 0x02,
58 kElegant_FontVariant = 0x04, 58 kElegant_FontVariant = 0x04,
59 kLast_FontVariant = kElegant_FontVariant, 59 kLast_FontVariant = kElegant_FontVariant,
60 }; 60 };
61 typedef uint32_t FontVariant; 61 typedef uint32_t FontVariant;
62 62
63 // Must remain trivially movable (can be memmoved). 63 // Must remain trivially movable (can be memmoved).
64 struct FontFileInfo { 64 struct FontFileInfo {
65 FontFileInfo() : fIndex(0), fWeight(0) { } 65 FontFileInfo() : fIndex(0), fWeight(0), fStyle(Style::kAuto) { }
66 66
67 SkString fFileName; 67 SkString fFileName;
68 int fIndex; 68 int fIndex;
69 int fWeight; 69 int fWeight;
70 enum class Style { kAuto, kNormal, kItalic } fStyle;
70 }; 71 };
71 72
72 /** 73 /**
73 * A font family provides one or more names for a collection of fonts, each of 74 * A font family provides one or more names for a collection of fonts, each of
74 * which has a different style (normal, italic) or weight (thin, light, bold, 75 * which has a different style (normal, italic) or weight (thin, light, bold,
75 * etc). 76 * etc).
76 * Some fonts may occur in compact variants for use in the user interface. 77 * Some fonts may occur in compact variants for use in the user interface.
77 * Android distinguishes "fallback" fonts to support non-ASCII character sets. 78 * Android distinguishes "fallback" fonts to support non-ASCII character sets.
78 */ 79 */
79 struct FontFamily { 80 struct FontFamily {
(...skipping 21 matching lines...) Expand all
101 /** Parses font configuration files and appends result to fontFamilies. */ 102 /** Parses font configuration files and appends result to fontFamilies. */
102 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies, 103 void GetCustomFontFamilies(SkTDArray<FontFamily*>& fontFamilies,
103 const SkString& basePath, 104 const SkString& basePath,
104 const char* fontsXml, 105 const char* fontsXml,
105 const char* fallbackFontsXml, 106 const char* fallbackFontsXml,
106 const char* langFallbackFontsDir = NULL); 107 const char* langFallbackFontsDir = NULL);
107 108
108 } // SkFontConfigParser namespace 109 } // SkFontConfigParser namespace
109 110
110 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */ 111 #endif /* SKFONTCONFIGPARSER_ANDROID_H_ */
OLDNEW
« no previous file with comments | « site/dev/contrib/style.md ('k') | src/ports/SkFontConfigParser_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698