congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
TrueTypeUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
TrueTypeUtil
in
org.xhtmlrenderer.pdf

Best Java code snippets using org.xhtmlrenderer.pdf.TrueTypeUtil (Showing top 20 results out of 315)

origin: org.xhtmlrenderer/core-renderer

public static void populateDescription(String path, BaseFont font, FontDescription descr) 
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(getTTCName(path));
    
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}

origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

/**
 * Utility method which uses iText libraries to determine the family name(s) for the font at the given path.
 * The iText APIs seem to indicate there can be more than one name, but this method will return a set of them.
 * Use a name from this list when referencing the font in CSS for PDF output. Note that family names as reported
 * by iText may vary from those reported by the AWT Font class, e.g. "Arial Unicode MS" for iText and
 * "ArialUnicodeMS" for AWT.
 *
 * @param path local path to the font file
 * @param encoding same as what you would use for {@link #addFont(String, String, boolean)}
 * @param embedded same as what you would use for {@link #addFont(String, String, boolean)}
 * @return set of all family names for the font file, as reported by iText libraries
 */
public static Set getDistinctFontFamilyNames(String path, String encoding, boolean embedded) {
  BaseFont font = null;
  try {
    font = BaseFont.createFont(path, encoding, embedded);
    String[] fontFamilyNames = TrueTypeUtil.getFamilyNames(font);
    Set distinct = new HashSet();
    for (int i = 0; i < fontFamilyNames.length; i++) {
      distinct.add(fontFamilyNames[i]);
    }
    return distinct;
  } catch (DocumentException e) {
    throw new RuntimeException(e);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}
origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

  fontFamilyNames = new String[] { fontFamilyNameOverride };
} else {
  fontFamilyNames = TrueTypeUtil.getFamilyNames(font);
    TrueTypeUtil.populateDescription(uri, afmttf, font, descr);
  } catch (Exception e) {
    throw new XRRuntimeException(e.getMessage(), e);
origin: org.xhtmlrenderer/core-renderer

private static RandomAccessFileOrArray populateDescription0(String path,
    BaseFont font, FontDescription descr, RandomAccessFileOrArray rf)
      throws NoSuchFieldException, IllegalAccessException, DocumentException, IOException {
  Map tables = extractTables(font);
  descr.setStyle(guessStyle(font));
origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public static void populateDescription(String path, byte[] contents, BaseFont font, FontDescription descr)
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(contents);
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}
origin: org.xhtmlrenderer/core-renderer

BaseFont font = BaseFont.createFont(uri, encoding, embedded, false, afmttf, pfb);
String fontFamilyName = TrueTypeUtil.getFamilyName(font);
FontFamily fontFamily = getFontFamily(fontFamilyName);
  TrueTypeUtil.populateDescription(uri, afmttf, font, descr);
} catch (Exception e) {
  throw new XRRuntimeException(e.getMessage(), e);
origin: pebbleblog/pebble

fontFamilyName = TrueTypeUtil.getFamilyName(font);
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

  fontFamilyNames = new String[] { fontFamilyNameOverride };
} else {
  fontFamilyNames = TrueTypeUtil.getFamilyNames(font);
    TrueTypeUtil.populateDescription(uri, afmttf, font, descr);
  } catch (Exception e) {
    throw new XRRuntimeException(e.getMessage(), e);
origin: org.xhtmlrenderer/flying-saucer-pdf

private static RandomAccessFileOrArray populateDescription0(String path,
                              BaseFont font, FontDescription descr, RandomAccessFileOrArray rf)
    throws NoSuchFieldException, IllegalAccessException, DocumentException, IOException {
  Map<String, int[]> tables = extractTables(font);
  descr.setStyle(guessStyle(font));
origin: org.xhtmlrenderer/core-renderer

public static void populateDescription(String path, byte[] contents, BaseFont font, FontDescription descr) 
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(contents);
    
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}    
origin: org.xhtmlrenderer/core-renderer

BaseFont font = BaseFont.createFont(path, encoding, embedded);
String fontFamilyName = TrueTypeUtil.getFamilyName(font);
FontFamily fontFamily = getFontFamily(fontFamilyName);
  TrueTypeUtil.populateDescription(path, font, descr);
} catch (Exception e) {
  throw new XRRuntimeException(e.getMessage(), e);
origin: org.xhtmlrenderer/flying-saucer-pdf

  fontFamilyNames = new String[] { fontFamilyNameOverride };
} else {
  fontFamilyNames = TrueTypeUtil.getFamilyNames(font);
    TrueTypeUtil.populateDescription(path, font, descr);
  } catch (Exception e) {
    throw new XRRuntimeException(e.getMessage(), e);
origin: org.xhtmlrenderer/flying-saucer-pdf-openpdf

public static void populateDescription(String path, BaseFont font, FontDescription descr)
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(getTTCName(path));
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}
origin: org.xhtmlrenderer/flying-saucer-pdf-openpdf

private static RandomAccessFileOrArray populateDescription0(String path,
                              BaseFont font, FontDescription descr, RandomAccessFileOrArray rf)
    throws NoSuchFieldException, IllegalAccessException, DocumentException, IOException {
  Map<String, int[]> tables = extractTables(font);
  descr.setStyle(guessStyle(font));
origin: org.xhtmlrenderer/flying-saucer-pdf

public static void populateDescription(String path, byte[] contents, BaseFont font, FontDescription descr)
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(contents);
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}
origin: org.xhtmlrenderer/flying-saucer-pdf

/**
 * Utility method which uses iText libraries to determine the family name(s) for the font at the given path.
 * The iText APIs seem to indicate there can be more than one name, but this method will return a set of them.
 * Use a name from this list when referencing the font in CSS for PDF output. Note that family names as reported
 * by iText may vary from those reported by the AWT Font class, e.g. "Arial Unicode MS" for iText and
 * "ArialUnicodeMS" for AWT.
 *
 * @param path local path to the font file
 * @param encoding same as what you would use for {@link #addFont(String, String, boolean)}
 * @param embedded same as what you would use for {@link #addFont(String, String, boolean)}
 * @return set of all family names for the font file, as reported by iText libraries
 */
public static Set getDistinctFontFamilyNames(String path, String encoding, boolean embedded) {
  BaseFont font = null;
  try {
    font = BaseFont.createFont(path, encoding, embedded);
    String[] fontFamilyNames = TrueTypeUtil.getFamilyNames(font);
    Set distinct = new HashSet();
    for (int i = 0; i < fontFamilyNames.length; i++) {
      distinct.add(fontFamilyNames[i]);
    }
    return distinct;
  } catch (DocumentException e) {
    throw new RuntimeException(e);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

  fontFamilyNames = new String[] { fontFamilyNameOverride };
} else {
  fontFamilyNames = TrueTypeUtil.getFamilyNames(font);
    TrueTypeUtil.populateDescription(path, font, descr);
  } catch (Exception e) {
    throw new XRRuntimeException(e.getMessage(), e);
origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public static void populateDescription(String path, BaseFont font, FontDescription descr)
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(getTTCName(path));
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

private static RandomAccessFileOrArray populateDescription0(String path,
                              BaseFont font, FontDescription descr, RandomAccessFileOrArray rf)
    throws NoSuchFieldException, IllegalAccessException, DocumentException, IOException {
  Map<String, int[]> tables = extractTables(font);
  descr.setStyle(guessStyle(font));
origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

public static void populateDescription(String path, byte[] contents, BaseFont font, FontDescription descr)
    throws IOException, NoSuchFieldException, IllegalAccessException, DocumentException {
  RandomAccessFileOrArray rf = null;
  try {
    rf = new RandomAccessFileOrArray(contents);
    rf = populateDescription0(path, font, descr, rf);
  } finally {
    if (rf != null) {
      try {
        rf.close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}
org.xhtmlrenderer.pdfTrueTypeUtil

Javadoc

Uses code from iText's DefaultFontMapper and TrueTypeFont classes. See http://sourceforge.net/projects/itext/ for license information.

Most used methods

  • extractTables
  • getTTCName
  • guessStyle
  • populateDescription
  • populateDescription0
  • getFamilyNames
  • getFamilyName

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now