Home
last modified time | relevance | path

Searched refs:FontStyle (Results 1 – 25 of 39) sorted by relevance

12

/frameworks/minikin/tests/unittest/
DFontFamilyTest.cpp684 const char* slantToString(FontStyle::Slant slant) { in slantToString()
685 if (slant == FontStyle::Slant::ITALIC) { in slantToString()
692 std::string fontStyleToString(const FontStyle& style) { in fontStyleToString()
702 constexpr FontStyle::Weight THIN = FontStyle::Weight::THIN; in TEST_F()
703 constexpr FontStyle::Weight LIGHT = FontStyle::Weight::LIGHT; in TEST_F()
704 constexpr FontStyle::Weight NORMAL = FontStyle::Weight::NORMAL; in TEST_F()
705 constexpr FontStyle::Weight MEDIUM = FontStyle::Weight::MEDIUM; in TEST_F()
706 constexpr FontStyle::Weight BOLD = FontStyle::Weight::BOLD; in TEST_F()
707 constexpr FontStyle::Weight BLACK = FontStyle::Weight::BLACK; in TEST_F()
709 constexpr FontStyle::Slant UPRIGHT = FontStyle::Slant::UPRIGHT; in TEST_F()
[all …]
DFontCollectionItemizeTest.cpp67 FontStyle style, const std::string& localeList) { in itemize()
99 return itemize(collection, str, FontStyle(), localeList); in itemize()
104 FontStyle style) { in itemize()
110 return itemize(collection, str, FontStyle(), ""); in itemize()
127 const FontStyle kRegularStyle = FontStyle(); in TEST()
128 const FontStyle kItalicStyle = FontStyle(FontStyle::Slant::ITALIC); in TEST()
129 const FontStyle kBoldStyle = FontStyle(FontStyle::Weight::BOLD); in TEST()
130 const FontStyle kBoldItalicStyle = FontStyle(FontStyle::Weight::BOLD, FontStyle::Slant::ITALIC); in TEST()
699 FontStyle kBoldStyle(FontStyle::Weight::BOLD); in TEST()
700 FontStyle kItalicStyle(FontStyle::Slant::ITALIC); in TEST()
[all …]
/frameworks/minikin/include/minikin/
DFontStyle.h25 class FontStyle {
45 constexpr FontStyle() : FontStyle(Weight::NORMAL, Slant::UPRIGHT) {} in FontStyle() function
46 constexpr explicit FontStyle(Weight weight) : FontStyle(weight, Slant::UPRIGHT) {} in FontStyle() function
47 constexpr explicit FontStyle(Slant slant) : FontStyle(Weight::NORMAL, slant) {} in FontStyle() function
48 constexpr FontStyle(Weight weight, Slant slant) in FontStyle() function
49 : FontStyle(static_cast<uint16_t>(weight), slant) {} in FontStyle()
50 constexpr FontStyle(uint16_t weight, Slant slant) : mWeight(weight), mSlant(slant) {} in FontStyle() function
51 explicit FontStyle(BufferReader* reader) { in FontStyle() function
64 constexpr bool operator==(const FontStyle& other) const {
DFont.h76 Builder& setStyle(FontStyle style) { in setStyle()
91 Builder& setSlant(FontStyle::Slant slant) { in setSlant()
106 uint16_t mWeight = static_cast<uint16_t>(FontStyle::Weight::NORMAL);
107 FontStyle::Slant mSlant = FontStyle::Slant::UPRIGHT;
123 FontStyle style = FontStyle(reader); in readFrom()
140 inline FontStyle style() const { return mStyle; } in style()
148 Font(std::shared_ptr<MinikinFont>&& typeface, FontStyle style, HbFontUniquePtr&& baseFont, in Font()
156 Font(FontStyle style, BufferReader typefaceMetadataReader, TypefaceLoader* typefaceLoader, in Font()
166 static FontStyle analyzeStyle(const HbFontUniquePtr& font);
170 FontStyle mStyle;
DFontCollection.h169 FakedFont getBestFont(U16StringPiece textBuf, const Run& run, FontStyle style);
172 std::vector<Run> itemize(U16StringPiece text, FontStyle style, uint32_t localeListId,
176 std::vector<Run> itemize(U16StringPiece text, FontStyle style, uint32_t localeListId, in itemize()
187 FakedFont baseFontFaked(FontStyle style);
DFontFamily.h63 FakedFont getClosestMatch(FontStyle style) const;
72 FontStyle getStyle(size_t index) const { return mFonts[index]->style(); } in getStyle()
DMinikinPaint.h71 FontStyle fontStyle;
/frameworks/base/libs/hwui/tests/unit/
DTypefaceTests.cpp89 EXPECT_EQ(minikin::FontStyle::Slant::UPRIGHT, bold->fStyle.slant()); in TEST()
94 EXPECT_EQ(minikin::FontStyle::Slant::UPRIGHT, light->fStyle.slant()); in TEST()
102 EXPECT_EQ(minikin::FontStyle::Slant::UPRIGHT, normal->fStyle.slant()); in TEST()
108 EXPECT_EQ(minikin::FontStyle::Slant::UPRIGHT, bold->fStyle.slant()); in TEST()
114 EXPECT_EQ(minikin::FontStyle::Slant::ITALIC, italic->fStyle.slant()); in TEST()
120 EXPECT_EQ(minikin::FontStyle::Slant::ITALIC, boldItalic->fStyle.slant()); in TEST()
131 EXPECT_EQ(minikin::FontStyle::Slant::UPRIGHT, normal->fStyle.slant()); in TEST()
138 EXPECT_EQ(minikin::FontStyle::Slant::UPRIGHT, bold->fStyle.slant()); in TEST()
145 EXPECT_EQ(minikin::FontStyle::Slant::ITALIC, italic->fStyle.slant()); in TEST()
153 EXPECT_EQ(minikin::FontStyle::Slant::ITALIC, boldItalic->fStyle.slant()); in TEST()
[all …]
/frameworks/base/core/tests/coretests/src/android/graphics/
DFontListParserTest.java19 import static android.graphics.fonts.FontStyle.FONT_SLANT_ITALIC;
20 import static android.graphics.fonts.FontStyle.FONT_SLANT_UPRIGHT;
21 import static android.graphics.fonts.FontStyle.FONT_WEIGHT_NORMAL;
30 import android.graphics.fonts.FontStyle;
63 new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), in named()
81 new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), in fallback()
84 new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), in fallback()
101 new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), in compact()
118 new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), in elegant()
137 new FontStyle(FONT_WEIGHT_NORMAL, FONT_SLANT_UPRIGHT), in styles()
[all …]
/frameworks/base/graphics/java/android/graphics/fonts/
DFontStyle.java47 public final class FontStyle { class
129 public FontStyle() { in FontStyle() method in FontStyle
207 public FontStyle(int weight, @FontSlant int slant) { in FontStyle() method in FontStyle
242 public int getMatchScore(@NonNull FontStyle o) { in getMatchScore()
251 if (o == null || !(o instanceof FontStyle)) { in equals()
254 FontStyle fontStyle = (FontStyle) o; in equals()
DFont.java382 @IntRange(from = FontStyle.FONT_WEIGHT_MIN, to = FontStyle.FONT_WEIGHT_MAX) in setWeight()
385 FontStyle.FONT_WEIGHT_MIN <= weight && weight <= FontStyle.FONT_WEIGHT_MAX); in setWeight()
401 public @NonNull Builder setSlant(@FontStyle.FontSlant int slant) { in setSlant()
402 mItalic = slant == FontStyle.FONT_SLANT_UPRIGHT ? STYLE_NORMAL : STYLE_ITALIC; in setSlant()
464 mWeight = Math.max(FontStyle.FONT_WEIGHT_MIN, in build()
465 Math.min(FontStyle.FONT_WEIGHT_MAX, mWeight)); in build()
468 ? FontStyle.FONT_SLANT_ITALIC : FontStyle.FONT_SLANT_UPRIGHT; in build()
518 private FontStyle mFontStyle = null;
592 public @NonNull FontStyle getStyle() { in getStyle()
596 mFontStyle = new FontStyle( in getStyle()
[all …]
/frameworks/minikin/libs/minikin/
DFont.cpp38 return std::shared_ptr<Font>(new Font(std::move(mTypeface), FontStyle(mWeight, mSlant), in build()
43 FontStyle styleFromFont = analyzeStyle(font); in build()
50 return std::shared_ptr<Font>(new Font(std::move(mTypeface), FontStyle(mWeight, mSlant), in build()
100 FontStyle Font::analyzeStyle(const HbFontUniquePtr& font) { in analyzeStyle()
103 return FontStyle(); in analyzeStyle()
109 return FontStyle(); in analyzeStyle()
112 return FontStyle(static_cast<uint16_t>(weight), static_cast<FontStyle::Slant>(italic)); in analyzeStyle()
DFontFamily.cpp134 static int computeMatch(FontStyle style1, FontStyle style2) { in computeMatch()
143 static FontFakery computeFakery(FontStyle wanted, FontStyle actual) { in computeFakery()
148 bool isFakeItalic = wanted.slant() == FontStyle::Slant::ITALIC && in computeFakery()
149 actual.slant() == FontStyle::Slant::UPRIGHT; in computeFakery()
153 FakedFont FontFamily::getClosestMatch(FontStyle style) const { in getClosestMatch()
170 const std::shared_ptr<Font>& font = getClosestMatch(FontStyle()).font; in computeCoverage()
DFontCollection.cpp78 const FontStyle defaultStyle; in init()
483 std::vector<FontCollection::Run> FontCollection::itemize(U16StringPiece text, FontStyle, in itemize() argument
628 FakedFont FontCollection::getBestFont(U16StringPiece text, const Run& run, FontStyle style) { in getBestFont()
649 FakedFont FontCollection::baseFontFaked(FontStyle style) { in baseFontFaked()
/frameworks/base/core/java/android/graphics/fonts/
DFontFamilyUpdateRequest.java166 private final @NonNull FontStyle mStyle;
178 public Builder(@NonNull String postScriptName, @NonNull FontStyle style) { in Builder()
219 private final FontStyle mStyle;
241 private Font(@NonNull String postScriptName, @NonNull FontStyle style, in Font()
261 public FontStyle getStyle() { in getStyle()
DFontUpdateRequest.java79 private final @NonNull FontStyle mFontStyle;
83 public Font(@NonNull String postScriptName, @NonNull FontStyle fontStyle, in Font()
113 return new Font(fontName, new FontStyle(weight, slant), index, varSettings);
153 int weight = getAttributeValueInt(parser, ATTR_WEIGHT, FontStyle.FONT_WEIGHT_NORMAL); in readFromXml()
154 int slant = getAttributeValueInt(parser, ATTR_SLANT, FontStyle.FONT_SLANT_UPRIGHT); in readFromXml()
159 return new Font(psName, new FontStyle(weight, slant), index, varSettings); in readFromXml()
166 public @NonNull FontStyle getFontStyle() { in getFontStyle()
/frameworks/base/libs/hwui/hwui/
DTypeface.cpp48 static minikin::FontStyle computeMinikinStyle(int weight, bool italic) { in computeMinikinStyle()
49 return minikin::FontStyle(uirenderer::MathUtils::clamp(weight, 1, 1000), in computeMinikinStyle()
50 static_cast<minikin::FontStyle::Slant>(italic)); in computeMinikinStyle()
54 static minikin::FontStyle computeRelativeStyle(int baseWeight, Typeface::Style relativeStyle) { in computeRelativeStyle()
136 const minikin::FontStyle defaultStyle; in createFromFamilies()
201 hwTypeface->fStyle = minikin::FontStyle(); in setRobotoTypefaceForTest()
DTypeface.h38 minikin::FontStyle fStyle;
/frameworks/base/graphics/java/android/graphics/
DFontListParser.java23 import android.graphics.fonts.FontStyle;
229 int weight = weightStr == null ? FontStyle.FONT_WEIGHT_NORMAL : Integer.parseInt(weightStr); in readFont()
282 new FontStyle( in readFont()
284 isItalic ? FontStyle.FONT_SLANT_ITALIC : FontStyle.FONT_SLANT_UPRIGHT in readFont()
320 weight = FontStyle.FONT_WEIGHT_NORMAL; in readAlias()
DTypeface.java34 import android.graphics.fonts.FontStyle;
213 private @IntRange(from = 0, to = FontStyle.FONT_WEIGHT_MAX) final int mWeight;
340 ? FontStyle.FONT_SLANT_ITALIC : FontStyle.FONT_SLANT_UPRIGHT); in createFromResources()
353 final FontStyle normal = new FontStyle(FontStyle.FONT_WEIGHT_NORMAL, in createFromResources()
354 FontStyle.FONT_SLANT_UPRIGHT); in createFromResources()
543 mItalic = italic ? FontStyle.FONT_SLANT_ITALIC : FontStyle.FONT_SLANT_UPRIGHT; in setItalic()
695 .setStyle(new FontStyle(weight, slant)); in build()
780 private @Nullable FontStyle mStyle;
832 public @NonNull CustomFallbackBuilder setStyle(@NonNull FontStyle style) { in setStyle()
869 (mStyle == null || mStyle.getSlant() == FontStyle.FONT_SLANT_UPRIGHT) ? 0 : 1;
/frameworks/base/core/java/android/text/
DFontConfig.java29 import android.graphics.fonts.FontStyle;
198 private final @NonNull FontStyle mStyle;
209 @NonNull FontStyle style, @IntRange(from = 0) int index, in Font()
251 return new Font(path, originalPath, postScriptName, new FontStyle(weight, slant),
284 public @NonNull FontStyle getStyle() { in getStyle()
357 return getStyle().getSlant() == FontStyle.FONT_SLANT_ITALIC; in isItalic()
/frameworks/minikin/tests/util/
DFontTestUtils.cpp77 FontStyle::Slant italic = static_cast<FontStyle::Slant>( in getFontFamilies()
93 FontStyle style(weight, italic); in getFontFamilies()
/frameworks/base/core/java/android/provider/
DFontsContract.java34 import android.graphics.fonts.FontStyle;
678 ? FontStyle.FONT_SLANT_ITALIC : FontStyle.FONT_SLANT_UPRIGHT) in buildTypeface()
701 final FontStyle normal = new FontStyle(FontStyle.FONT_WEIGHT_NORMAL, in buildTypeface()
702 FontStyle.FONT_SLANT_UPRIGHT); in buildTypeface()
/frameworks/base/native/android/
Dsystem_fonts.cpp105 minikin::FontStyle mFontStyle;
268 font->style().slant() == minikin::FontStyle::Slant::ITALIC, in ASystemFontIterator_open()
303 matcher->mFontStyle = minikin::FontStyle( in AFontMatcher_setStyle()
304 weight, static_cast<minikin::FontStyle::Slant>(italic)); in AFontMatcher_setStyle()
340 result->mItalic = font->style().slant() == minikin::FontStyle::Slant::ITALIC; in AFontMatcher_match()
/frameworks/base/services/tests/servicestests/src/com/android/server/graphics/fonts/
DUpdatableFontDirTest.java27 import android.graphics.fonts.FontStyle;
298 new FontStyle(400, FontStyle.FONT_SLANT_UPRIGHT), 0, null, null); in construct_olderThanPreinstalledFont()
301 new FontStyle(400, FontStyle.FONT_SLANT_UPRIGHT), 0, null, null); in construct_olderThanPreinstalledFont()
460 file, null, "bar", new FontStyle(400, FontStyle.FONT_SLANT_UPRIGHT), in installFontFile_systemFontHasPSNameDifferentFromFileName()
611 file, null, "test", new FontStyle(400, FontStyle.FONT_SLANT_UPRIGHT), 0, null, in installFontFile_preinstalled_downgrade()

12