public FontFamily getFontFamily(String fontFamilyName) { FontFamily fontFamily = (FontFamily)_fontFamilies.get(fontFamilyName); if (fontFamily == null) { fontFamily = new FontFamily(); fontFamily.setName(fontFamilyName); _fontFamilies.put(fontFamilyName, fontFamily); } return fontFamily; }
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
return match(desiredWeight, IdentValue.OBLIQUE); } else if (style == IdentValue.OBLIQUE) { return match(desiredWeight, IdentValue.NORMAL); } else { return null; FontDescription result; result = findByWeight(matches, desiredWeight, SM_EXACT); } else { if (desiredWeight <= 500) { return findByWeight(matches, desiredWeight, SM_LIGHTER_OR_DARKER); } else { return findByWeight(matches, desiredWeight, SM_DARKER_OR_LIGHTER);
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); } else if (lower.endsWith(".afm") || lower.endsWith(".pfm") || lower.endsWith(".pfb") || lower.endsWith(".pfa")) { if (embedded && pfb == null) { fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
fontFamily.addFontDescription(descr); } else if (lower.endsWith(".ttc")) { String[] names = BaseFont.enumerateTTCNames(path); fontFamily.addFontDescription(descr); } else { throw new IOException("Unsupported font type");
return match(desiredWeight, IdentValue.OBLIQUE); } else if (style == IdentValue.OBLIQUE) { return match(desiredWeight, IdentValue.NORMAL); } else { candidates.addAll(_fontDescriptions); FontDescription result; result = findByWeight(matches, desiredWeight, SM_EXACT); } else { if (desiredWeight <= 500) { return findByWeight(matches, desiredWeight, SM_LIGHTER_OR_DARKER); } else { return findByWeight(matches, desiredWeight, SM_DARKER_OR_LIGHTER);
return match(desiredWeight, IdentValue.OBLIQUE); } else if (style == IdentValue.OBLIQUE) { return match(desiredWeight, IdentValue.NORMAL); } else { candidates.addAll(_fontDescriptions); FontDescription result; result = findByWeight(matches, desiredWeight, SM_EXACT); } else { if (desiredWeight <= 500) { return findByWeight(matches, desiredWeight, SM_LIGHTER_OR_DARKER); } else { return findByWeight(matches, desiredWeight, SM_DARKER_OR_LIGHTER);
return match(desiredWeight, IdentValue.OBLIQUE); } else if (style == IdentValue.OBLIQUE) { return match(desiredWeight, IdentValue.NORMAL); } else { candidates.addAll(_fontDescriptions); FontDescription result; result = findByWeight(matches, desiredWeight, SM_EXACT); } else { if (desiredWeight <= 500) { return findByWeight(matches, desiredWeight, SM_LIGHTER_OR_DARKER); } else { return findByWeight(matches, desiredWeight, SM_DARKER_OR_LIGHTER);
return match(desiredWeight, IdentValue.OBLIQUE); } else if (style == IdentValue.OBLIQUE) { return match(desiredWeight, IdentValue.NORMAL); } else { candidates.addAll(_fontDescriptions); FontDescription result; result = findByWeight(matches, desiredWeight, SM_EXACT); } else { if (desiredWeight <= 500) { return findByWeight(matches, desiredWeight, SM_LIGHTER_OR_DARKER); } else { return findByWeight(matches, desiredWeight, SM_DARKER_OR_LIGHTER);
private FSFont 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 = (FontDescription)_fontCache.get(cacheKey); if (result != null) { return new ITextFSFont(result, size); } FontFamily family = (FontFamily)_fontFamilies.get(normalizedFontFamily); if (family != null) { result = family.match(convertWeightToInt(weight), style); if (result != null) { _fontCache.put(cacheKey, result); return new ITextFSFont(result, size); } } return null; }
private FSFont 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 = (FontDescription)_fontCache.get(cacheKey); if (result != null) { return new ITextFSFont(result, size); } FontFamily family = (FontFamily)_fontFamilies.get(normalizedFontFamily); if (family != null) { result = family.match(convertWeightToInt(weight), style); if (result != null) { _fontCache.put(cacheKey, result); return new ITextFSFont(result, size); } } return null; }
private FSFont 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 = (FontDescription)_fontCache.get(cacheKey); if (result != null) { return new ITextFSFont(result, size); } FontFamily family = (FontFamily)_fontFamilies.get(normalizedFontFamily); if (family != null) { result = family.match(convertWeightToInt(weight), style); if (result != null) { _fontCache.put(cacheKey, result); return new ITextFSFont(result, size); } } return null; }
private FSFont 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 = (FontDescription)_fontCache.get(cacheKey); if (result != null) { return new ITextFSFont(result, size); } FontFamily family = (FontFamily)_fontFamilies.get(normalizedFontFamily); if (family != null) { result = family.match(convertWeightToInt(weight), style); if (result != null) { _fontCache.put(cacheKey, result); return new ITextFSFont(result, size); } } return null; }