Class Type1SegSplitParser

java.lang.Object
org.ofdrw.converter.font.type1.Type1SegSplitParser

public class Type1SegSplitParser extends Object
将Type1 字体分段

https://adobe-type-tools.github.io/font-tech-notes/pdfs/T1_SPEC.pdf

Since:
2021-10-24 16:44:53
Author:
权观宇
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    indexOf(byte[] array, byte[] target)
    查找目标字节串偏移量
    static boolean
    isType1(byte[] raw)
    判断是否是Type1 字体
    static org.apache.fontbox.type1.Type1Font
    parse(byte[] raw)
    尝试解析Type1 字体
    static org.apache.fontbox.type1.Type1Font
    尝试解析Type1 字体
    static byte[][]
    split(byte[] raw)
    Tyep1 字体 格式分段

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Type1SegSplitParser

      public Type1SegSplitParser()
  • Method Details

    • parse

      public static org.apache.fontbox.type1.Type1Font parse(byte[] raw) throws IOException
      尝试解析Type1 字体
      Parameters:
      raw - 字体
      Returns:
      Type1 字体或 null
      Throws:
      IOException - IOE
    • parse

      public static org.apache.fontbox.type1.Type1Font parse(InputStream in) throws IOException
      尝试解析Type1 字体
      Parameters:
      in - 字体流
      Returns:
      Type1 字体或 null
      Throws:
      IOException - IOE
    • isType1

      public static boolean isType1(byte[] raw)
      判断是否是Type1 字体
      Parameters:
      raw - 字体内容
      Returns:
      true - type1 字体;false - 非 type1
    • split

      public static byte[][] split(byte[] raw) throws IOException
      Tyep1 字体 格式分段
      Parameters:
      raw - 字体字节
      Returns:
      分段或null
      Throws:
      IOException - IO异常
    • indexOf

      public static int indexOf(byte[] array, byte[] target)
      查找目标字节串偏移量

      copy from guava from com.google.common.primitives.Bytes

      Parameters:
      array - 数组
      target - 查找目标
      Returns:
      偏移量