Package org.jfree.fonts.truetype

Examples of org.jfree.fonts.truetype.TrueTypeFontRegistry


  public void testFontRegistration () throws IOException
  {
    final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    final String[] names = ge.getAvailableFontFamilyNames();

    final TrueTypeFontRegistry tfr = new TrueTypeFontRegistry();
    tfr.registerDefaultFontPath();
    for (int i = 0; i < names.length; i++)
    {
      final String name = names[i];
      final FontFamily fofam = tfr.getFontFamily(name);
      if ("AmerType Md BT".equals(name))
      {
        final FontSource fr = (FontSource) fofam.getFontRecord(false, false);
        final FontDataInputSource fs = fr.getFontInputSource();
        final TrueTypeFont ttf = new TrueTypeFont(fs);
View Full Code Here


public class ITextFontRegistry extends CompoundFontRegistry
{
  public ITextFontRegistry()
  {
    addRegistry(new ITextBuiltInFontRegistry());
    addRegistry(new TrueTypeFontRegistry());
    addRegistry(new AfmFontRegistry());
    addRegistry(new PfmFontRegistry());
  }
View Full Code Here

  /** Creates a new factory. */
  public BaseFontFactory()
  {
    fontsByName = new Properties();
    notEmbeddedFonts = new Properties();
    registry = new TrueTypeFontRegistry();
  }
View Full Code Here

//    byte[] data = { -2, -100 };
//    final int tx = ByteAccessUtilities.readShort(data, 0);
//    if (tx == 0) throw new IllegalStateException();
//
//
    final TrueTypeFontRegistry registry = new TrueTypeFontRegistry();
    registry.initialize();
//    AWTFontRegistry registry = new AWTFontRegistry();
//    registry.registerDefaultFontPath();
//    registry.registerFontPath(new File ("/home/user/fonts"));
    final String[] fontFamilies = registry.getRegisteredFamilies();
    for (int i = 0; i < fontFamilies.length; i++)
    {
      String fontFamily = fontFamilies[i];
      System.out.println("FontFamily: " + fontFamily);
      final FontFamily family = registry.getFontFamily(fontFamily);
      printRecord((FontSource) family.getFontRecord(false, false));
      printRecord((FontSource) family.getFontRecord(true, false));
      printRecord((FontSource) family.getFontRecord(false, true));
      printRecord((FontSource) family.getFontRecord(true, true));


    }

    final String[] allFontFamilies = registry.getAllRegisteredFamilies();
    for (int i = 0; i < allFontFamilies.length; i++)
    {
      String family = allFontFamilies[i];
      System.out.println("I18n: FontFamily: " + family);
    }

    System.out.println (registry.getFontFamily("Skolle"));
    System.out.println (registry.getFontFamily("Tahoma2"));
  }
View Full Code Here

  public static void main (String[] args)
  {
    LibFontBoot.getInstance().start();

    final TrueTypeFontRegistry registry = new TrueTypeFontRegistry();
    registry.initialize();
    final String[] fontFamilies = registry.getRegisteredFamilies();
    for (int i = 0; i < fontFamilies.length; i++)
    {
      String fontFamily = fontFamilies[i];
      final FontFamily family = registry.getFontFamily(fontFamily);
      String[] names = family.getAllNames();
//      for (int j = 0; j < names.length; j++)
//      {
//        String name = names[j];
//        System.out.println("  Alias: " + j + " Name:" + name);
View Full Code Here

  public void testFontRegistration () throws IOException
  {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String[] names = ge.getAvailableFontFamilyNames();

    TrueTypeFontRegistry tfr = new TrueTypeFontRegistry();
    tfr.registerDefaultFontPath();
    for (int i = 0; i < names.length; i++)
    {
      final String name = names[i];
      final FontFamily fofam = tfr.getFontFamily(name);
      if (name.equals("AmerType Md BT"))
      {
        FontSource fr = (FontSource) fofam.getFontRecord(false, false);
        FontDataInputSource fs = fr.getFontInputSource();
        TrueTypeFont ttf = new TrueTypeFont(fs);
View Full Code Here

TOP

Related Classes of org.jfree.fonts.truetype.TrueTypeFontRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.