private int normalizeFontWeight(IdentValue fontWeight) { return fontWeight != null ? FontResolverHelper.convertWeightToInt(fontWeight) : 400; }
private int normalizeFontWeight(IdentValue fontWeight) { return fontWeight != null ? FontResolverHelper.convertWeightToInt(fontWeight) : 400; }
private Font resolveFontFaceBaseFont(String normalizedFontFamily, float size, IdentValue weight, IdentValue style) { FontFamily<FontDescription> fontFamily = _fontFamilies.get(normalizedFontFamily); if (fontFamily != null) { FontDescription result = fontFamily.match(FontResolverHelper.convertWeightToInt(weight), style); if (result != null) { if (result.realizeFont()) { return result.getBaseFont(); } } } return null; }
private FontDescription resolveFont(SharedContext ctx, String fontFamily, float size, IdentValue weight, IdentValue style, IdentValue variant) { String normalizedFontFamily = normalizeFontFamily(fontFamily); String cacheKey = getHashName(normalizedFontFamily, weight, style); FontDescription result = _fontCache.get(cacheKey); if (result != null) { return result; } FontFamily<FontDescription> family = _fontFamilies.get(normalizedFontFamily); if (family != null) { result = family.match(FontResolverHelper.convertWeightToInt(weight), style); if (result != null) { _fontCache.put(cacheKey, result); return result; } } return null; }
private FontDescription resolveFont(SharedContext ctx, String fontFamily, float size, IdentValue weight, IdentValue style, IdentValue variant) { String normalizedFontFamily = normalizeFontFamily(fontFamily); String cacheKey = getHashName(normalizedFontFamily, weight, style); FontDescription result = _fontCache.get(cacheKey); if (result != null) { return result; } FontFamily<FontDescription> family = _fontFamilies.get(normalizedFontFamily); if (family != null) { result = family.match(FontResolverHelper.convertWeightToInt(weight), style); if (result != null) { _fontCache.put(cacheKey, result); return result; } } return null; }
private void addFontFaceFont( String fontFamilyNameOverride, IdentValue fontWeightOverride, IdentValue fontStyleOverride, String uri) { FSSupplier<InputStream> fontSupplier = new FontFaceFontSupplier(_sharedContext, uri); FontFamily<FontDescription> fontFamily = getFontFamily(fontFamilyNameOverride); FontDescription descr = new FontDescription( fontSupplier, fontWeightOverride != null ? FontResolverHelper.convertWeightToInt(fontWeightOverride) : 400, fontStyleOverride != null ? fontStyleOverride : IdentValue.NORMAL); fontFamily.addFontDescription(descr); }
FontSpecification fontSpec = getFontSpecification(); if (fontSpec != null) { int need = FontResolverHelper.convertWeightToInt(fontSpec.fontWeight); int have = desc.getWeight(); if (need > have) {
FontSpecification fontSpec = getFontSpecification(); if (fontSpec != null) { int need = FontResolverHelper.convertWeightToInt(fontSpec.fontWeight); int have = desc.getWeight(); if (need > have) {
FontSpecification fontSpec = getFontSpecification(); if (fontSpec != null) { int need = FontResolverHelper.convertWeightToInt(fontSpec.fontWeight); int have = desc.getWeight(); if (need > have) {
FontSpecification fontSpec = getFontSpecification(); if (fontSpec != null) { int need = FontResolverHelper.convertWeightToInt(fontSpec.fontWeight); int have = desc.getWeight(); if (need > have) {