font=new Font(baseFont); }else{ font=FontFactory.getFont(fontName);
/** * Register a ttf- or a ttc-file. * * @param path the path to a ttf- or ttc-file */ public static void register(final String path) { register(path, null); }
private void registerFonts() { FontFactory.registerDirectories(); if (Utilities.isMac()) { //Add user fonts folder String userFonts = "/" + System.getProperty("user.home") + "/Library/Fonts"; FontFactory.registerDirectory(userFonts); //Adobe font folder String adobeFonts = "/Library/Application Support/Adobe/Fonts"; FontFactory.registerDirectory(adobeFonts); } }
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; } }
FontFactory.registerDirectories(); if ( ForesterUtil.isWindows() ) { mapper.insertDirectory( "C:\\WINDOWS\\Fonts\\" );
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param size the size of this font * @param color the <CODE>BaseColor</CODE> of this font. * @return the Font constructed based on the parameters * @since 2.1.0 */ public static Font getFont(final String fontname, final float size, final BaseColor color) { return getFont(fontname, defaultEncoding, defaultEmbedding, size, Font.UNDEFINED, color); }
/** * Register a ttf- or a ttc-file. * * @param path the path to a ttf- or ttc-file */ public static void register(final String path) { register(path, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname) { return getFont(fontname, defaultEncoding, defaultEmbedding, Font.UNDEFINED, Font.UNDEFINED, null); }
cb.transform(AffineTransform.getTranslateInstance(translateX, translateY)); FontFactory.register("/org/gephi/preview/fonts/LiberationSans.ttf", "ArialMT");
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param size the size of this font * @param style the style of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final float size, final int style) { return getFont(fontname, encoding, defaultEmbedding, size, style, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param size the size of this font * @param style the style of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final float size, final int style) { return getFont(fontname, defaultEncoding, defaultEmbedding, size, style, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname) { return getFont(fontname, defaultEncoding, defaultEmbedding, Font.UNDEFINED, Font.UNDEFINED, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param embedded true if the font is to be embedded in the PDF * @param size the size of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final boolean embedded, final float size) { return getFont(fontname, encoding, embedded, size, Font.UNDEFINED, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param size the size of this font * @param style the style of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final float size, final int style) { return getFont(fontname, encoding, defaultEmbedding, size, style, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param size the size of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final float size) { return getFont(fontname, encoding, defaultEmbedding, size, Font.UNDEFINED, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param embedded true if the font is to be embedded in the PDF * @param size the size of this font * @param style the style of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final boolean embedded, final float size, final int style) { return getFont(fontname, encoding, embedded, size, style, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param size the size of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final float size) { return getFont(fontname, encoding, defaultEmbedding, size, Font.UNDEFINED, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding) { return getFont(fontname, encoding, defaultEmbedding, Font.UNDEFINED, Font.UNDEFINED, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param size the size of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final float size) { return getFont(fontname, defaultEncoding, defaultEmbedding, size, Font.UNDEFINED, null); }
/** * Constructs a <CODE>Font</CODE>-object. * * @param fontname the name of the font * @param encoding the encoding of the font * @param embedded true if the font is to be embedded in the PDF * @param size the size of this font * @return the Font constructed based on the parameters */ public static Font getFont(final String fontname, final String encoding, final boolean embedded, final float size) { return getFont(fontname, encoding, embedded, size, Font.UNDEFINED, null); }