private PdfOptions() { this.fontEncoding = BaseFont.IDENTITY_H; this.fontProvider = ITextFontRegistry.getRegistry(); }
private void initFontRegistryIfNeeded() { if ( !fontRegistryInitialized ) { // clear built-in fonts which may clash with document fonts ExtendedBaseFont.clearBuiltinFonts(); // register fonts from files (ex : for windows, load files from C:\WINDOWS\Fonts) FontFactory.registerDirectories(); fontRegistryInitialized = true; } }
@Override public void register( String path, String alias ) { super.register( path, alias ); if ( path.endsWith( "symbol.ttf" ) ) { registerFamily( "Symbol-Exp".toLowerCase(), "Symbol-Exp".toLowerCase(), path ); } else if ( path.endsWith( "wingding.ttf" ) ) { registerFamily( "Wingdings-Exp".toLowerCase(), "Wingdings-Exp".toLowerCase(), path ); } } }
public Font getFont( String familyName, String encoding, float size, int style, Color color ) { initFontRegistryIfNeeded(); if ( familyName != null ) { familyName = resolveFamilyName( familyName, style ); } try { return FontFactory.getFont( familyName, encoding, size, style, color ); } catch ( ExceptionConverter e ) { // TODO manage options of font not found + add some logs return new Font( Font.UNDEFINED, size, style, color ); } }
public Font getFontAsian() { Float adjustedFontSize; if ( hasFontPropertiesAsian() ) { adjustedFontSize = fontSizeAsian; // Shrink font size if sub or super scripted if ( textPosition != null ) { adjustedFontSize *= 0.63f; } return fontProvider.getFont( fontNameAsian, fontEncoding, adjustedFontSize, getStyleFlagAsian(), fontColor ); } else { return null; } }
public Font getFont( String familyName, String encoding, float size, int style, Color color ) { initFontRegistryIfNeeded(); if ( familyName != null ) { familyName = resolveFamilyName( familyName, style ); } try { return FontFactory.getFont( familyName, encoding, size, style, color ); } catch ( ExceptionConverter e ) { // TODO manage options of font not found + add some logs return new Font( Font.UNDEFINED, size, style, color ); } }
public Font getFont() { Float adjustedFontSize; if ( hasFontProperties() ) { adjustedFontSize = fontSize; // Shrink font size if sub or super scripted if ( textPosition != null ) { adjustedFontSize *= 0.63f; } return fontProvider.getFont( fontName, fontEncoding, adjustedFontSize, getStyleFlag(), fontColor ); } else { return null; } }
private PdfOptions() { this.fontEncoding = BaseFont.IDENTITY_H; this.fontProvider = ITextFontRegistry.getRegistry(); }
private void initFontRegistryIfNeeded() { if ( !fontRegistryInitialized ) { // clear built-in fonts which may clash with document fonts ExtendedBaseFont.clearBuiltinFonts(); // register fonts from files (ex : for windows, load files from C:\WINDOWS\Fonts) FontFactory.registerDirectories(); fontRegistryInitialized = true; } }
@Override public void register( String path, String alias ) { super.register( path, alias ); if ( path.endsWith( "symbol.ttf" ) ) { registerFamily( "Symbol-Exp".toLowerCase(), "Symbol-Exp".toLowerCase(), path ); } else if ( path.endsWith( "wingding.ttf" ) ) { registerFamily( "Wingdings-Exp".toLowerCase(), "Wingdings-Exp".toLowerCase(), path ); } } }
public Font getFont( String familyName, String encoding, float size, int style, BaseColor color ) { initFontRegistryIfNeeded(); if ( familyName != null ) { familyName = resolveFamilyName( familyName, style ); } try { return FontFactory.getFont( familyName, encoding, size, style, color ); } catch ( ExceptionConverter e ) { // TODO manage options of font not found + add some logs return new Font( FontFamily.UNDEFINED, size, style, color ); } }
public Font getFont() { Float adjustedFontSize; if ( hasFontProperties() ) { adjustedFontSize = fontSize; // Shrink font size if sub or super scripted if ( textPosition != null ) { adjustedFontSize *= 0.63f; } return fontProvider.getFont( fontName, fontEncoding, adjustedFontSize, getStyleFlag(), fontColor ); } else { return null; } }
private PdfOptions() { this.fontEncoding = BaseFont.IDENTITY_H; this.fontProvider = ITextFontRegistry.getRegistry(); }
private void initFontRegistryIfNeeded() { if ( !fontRegistryInitialized ) { // clear built-in fonts which may clash with document fonts ExtendedBaseFont.clearBuiltinFonts(); // register fonts from files (ex : for windows, load files from C:\WINDOWS\Fonts) FontFactory.registerDirectories(); fontRegistryInitialized = true; } }
@Override public void register( String path, String alias ) { super.register( path, alias ); if ( path.endsWith( "symbol.ttf" ) ) { registerFamily( "Symbol-Exp".toLowerCase(), "Symbol-Exp".toLowerCase(), path ); } else if ( path.endsWith( "wingding.ttf" ) ) { registerFamily( "Wingdings-Exp".toLowerCase(), "Wingdings-Exp".toLowerCase(), path ); } } }
public Font getFontAsian() { Float adjustedFontSize; if ( hasFontPropertiesAsian() ) { adjustedFontSize = fontSizeAsian; // Shrink font size if sub or super scripted if ( textPosition != null ) { adjustedFontSize *= 0.63f; } return fontProvider.getFont( fontNameAsian, fontEncoding, adjustedFontSize, getStyleFlagAsian(), fontColor ); } else { return null; } }
private PdfOptions() { this.fontEncoding = BaseFont.IDENTITY_H; this.fontProvider = ITextFontRegistry.getRegistry(); }
public Font getFontComplex() { Float adjustedFontSize; if ( hasFontPropertiesComplex() ) { adjustedFontSize = fontSizeComplex; // Shrink font size if sub or super scripted if ( textPosition != null ) { adjustedFontSize *= 0.63f; } return fontProvider.getFont( fontNameComplex, fontEncoding, adjustedFontSize, getStyleFlagComplex(), fontColor ); } else { return null; } }
public Font getFontComplex() { Float adjustedFontSize; if ( hasFontPropertiesComplex() ) { adjustedFontSize = fontSizeComplex; // Shrink font size if sub or super scripted if ( textPosition != null ) { adjustedFontSize *= 0.63f; } return fontProvider.getFont( fontNameComplex, fontEncoding, adjustedFontSize, getStyleFlagComplex(), fontColor ); } else { return null; } }