Package org.pentaho.reporting.libraries.fonts.itext

Examples of org.pentaho.reporting.libraries.fonts.itext.ITextFontRegistry


  public static synchronized ITextFontRegistry getFontRegistry()
  {
    if (fontRegistry == null)
    {
      fontRegistry = new ITextFontRegistry();
      fontRegistry.initialize();
    }
    return fontRegistry;
  }
View Full Code Here


  {
    LibFontBoot.getInstance().start();
    LibXmlBoot.getInstance().start();

    final TrueTypeFontRegistry registry = new TrueTypeFontRegistry();
    final ITextFontRegistry itextRegistry = new ITextFontRegistry();

    registry.initialize();
    itextRegistry.initialize();
    final DefaultTagDescription defaultTagDescription = new DefaultTagDescription();
    defaultTagDescription.setNamespaceHasCData(null, false);
    final XmlWriter writer = new XmlWriter(new OutputStreamWriter(new FileOutputStream("/Users/user/fonts.xml"), "UTF-8"), defaultTagDescription);
    writer.writeXmlDeclaration("UTF-8");
    writer.writeTag(null, "font-spec", "fallback-font", "Arial", false);

    final Map<String, FontRecord> records = new HashMap<String, FontRecord>();
    final String[] families = registry.getAllRegisteredFamilies();
//    final String[] families = new String[]{"Arial"};
    Arrays.sort(families);
    for (int i = 0; i < families.length; i++)
    {
      final String family = families[i];
      writer.writeTag(null, "font-family", "name", family, false);
      final FontFamily fontFamily = registry.getFontFamily(family);
      writeRecord(writer, false, false, fontFamily.getFontRecord(false, false), records);
      writeRecord(writer, true, false, fontFamily.getFontRecord(true, false), records);
      writeRecord(writer, false, true, fontFamily.getFontRecord(false, true), records);
      writeRecord(writer, true, true, fontFamily.getFontRecord(true, true), records);
      writer.writeCloseTag();
    }

    final FontContext context = new DefaultFontContext(1000, false, true, false, "Identity-H");
    final FontMetricsFactory metricsFactory = itextRegistry.createMetricsFactory();
    final String[] sourceFiles = records.keySet().toArray(new String[records.size()]);
    Arrays.sort(sourceFiles);
    for (int i = 0; i < sourceFiles.length; i++)
    {
      final String sourceFile = sourceFiles[i];
View Full Code Here

  public static synchronized ITextFontRegistry getFontRegistry()
  {
    if (fontRegistry == null)
    {
      fontRegistry = new ITextFontRegistry();
      fontRegistry.initialize();
    }
    return fontRegistry;
  }
View Full Code Here

  public static synchronized ITextFontRegistry getFontRegistry()
  {
    if (fontRegistry == null)
    {
      fontRegistry = new ITextFontRegistry();
      fontRegistry.initialize();
    }
    return fontRegistry;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.fonts.itext.ITextFontRegistry

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.