com.itextpdf.text.pdf.BaseFont.getAllFontNames()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中com.itextpdf.text.pdf.BaseFont.getAllFontNames()方法的一些代码示例,展示了BaseFont.getAllFontNames()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BaseFont.getAllFontNames()方法的具体详情如下:
包路径:com.itextpdf.text.pdf.BaseFont
类名称:BaseFont
方法名:getAllFontNames

BaseFont.getAllFontNames介绍

[英]Gets all the names from the font. Only the required tables are read.
[中]获取字体中的所有名称。只读取所需的表。

代码示例

代码示例来源:origin: com.itextpdf/itextpdf

/** Inserts one font file into the map. The encoding
 * will be <CODE>BaseFont.CP1252</CODE> but can be
 * changed later.
 * @param file the file to insert
 * @return the number of files inserted
 * @since 5.0.5
 */
public int insertFile(File file) {
  String name = file.getPath().toLowerCase();
  try {
    if (name.endsWith(".ttf") || name.endsWith(".otf") || name.endsWith(".afm")) {
      Object allNames[] = BaseFont.getAllFontNames(file.getPath(), BaseFont.CP1252, null);
      insertNames(allNames, file.getPath());
      return 1;
    } else if (name.endsWith(".ttc")) {
      String ttcs[] = BaseFont.enumerateTTCNames(file.getPath());
      for (int j = 0; j < ttcs.length; ++j) {
        String nt = file.getPath() + "," + j;
        Object allNames[] = BaseFont.getAllFontNames(nt, BaseFont.CP1252, null);
        insertNames(allNames, nt);
      }
      return 1;
    }
  } catch (Exception e) {
  }
  return 0;
}

代码示例来源:origin: com.itextpdf/itextpdf

try {
  if (path.toLowerCase().endsWith(".ttf") || path.toLowerCase().endsWith(".otf") || path.toLowerCase().indexOf(".ttc,") > 0) {
    Object allNames[] = BaseFont.getAllFontNames(path, BaseFont.WINANSI, null);
    trueTypeFonts.put(((String)allNames[0]).toLowerCase(), path);
    if (alias != null) {

代码示例来源:origin: com.itextpdf/itextg

try {
  if (path.toLowerCase().endsWith(".ttf") || path.toLowerCase().endsWith(".otf") || path.toLowerCase().indexOf(".ttc,") > 0) {
    Object allNames[] = BaseFont.getAllFontNames(path, BaseFont.WINANSI, null);
    trueTypeFonts.put(((String)allNames[0]).toLowerCase(), path);
    if (alias != null) {

相关文章