Package com.itextpdf.io.font.woff2
Class Woff2Dec
- java.lang.Object
-
- com.itextpdf.io.font.woff2.Woff2Dec
-
class Woff2Dec extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Woff2Dec.Checksums
private static class
Woff2Dec.CompositeGlyphInfo
private static class
Woff2Dec.RebuildMetadata
private static class
Woff2Dec.StreamInfo
private static class
Woff2Dec.TableChecksumInfo
private static class
Woff2Dec.TtcFont
private static class
Woff2Dec.Woff2FontInfo
Accumulates data we may need to reconstruct a single font.private static class
Woff2Dec.Woff2Header
-
Field Summary
Fields Modifier and Type Field Description private static int
FLAG_ARG_1_AND_2_ARE_WORDS
private static int
FLAG_MORE_COMPONENTS
private static int
FLAG_WE_HAVE_A_SCALE
private static int
FLAG_WE_HAVE_A_TWO_BY_TWO
private static int
FLAG_WE_HAVE_AN_X_AND_Y_SCALE
private static int
FLAG_WE_HAVE_INSTRUCTIONS
private static int
kDefaultGlyphBuf
private static int
kEndPtsOfContoursOffset
private static int
kGlyfOnCurve
private static int
kGlyfRepeat
private static int
kGlyfThisXIsSame
private static int
kGlyfThisYIsSame
private static int
kGlyfXShort
private static int
kGlyfYShort
private static float
kMaxPlausibleCompressionRatio
-
Constructor Summary
Constructors Constructor Description Woff2Dec()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
computeBbox(int n_points, Woff2Common.Point[] points, byte[] dst)
private static int
computeOffsetToFirstTable(Woff2Dec.Woff2Header hdr)
static int
computeWoff2FinalSize(byte[] data, int length)
static void
convertWoff2ToTtf(byte[] data, int length, Woff2Out out)
private static Woff2Common.Table
findTable(java.util.ArrayList<Woff2Common.Table> tables, int tag)
private static void
pad4(Woff2Out out)
private static short
readNumHMetrics(byte[] data, int offset, int data_length)
private static void
readTableDirectory(Buffer file, Woff2Common.Table[] tables, int num_tables)
private static void
readWoff2Header(byte[] data, int length, Woff2Dec.Woff2Header hdr)
private static void
reconstructFont(byte[] transformed_buf, int transformed_buf_offset, int transformed_buf_size, Woff2Dec.RebuildMetadata metadata, Woff2Dec.Woff2Header hdr, int font_index, Woff2Out out)
private static Woff2Dec.Checksums
reconstructGlyf(byte[] data, int data_offset, Woff2Common.Table glyf_table, int glyph_checksum, Woff2Common.Table loca_table, int loca_checksum, Woff2Dec.Woff2FontInfo info, Woff2Out out)
private static int
reconstructTransformedHmtx(byte[] transformed_buf, int transformed_offset, int transformed_size, int num_glyphs, int num_hmetrics, short[] x_mins, Woff2Out out)
private static Woff2Dec.CompositeGlyphInfo
sizeOfComposite(Buffer composite_stream)
private static int
storeLoca(int[] loca_values, int index_format, Woff2Out out)
private static int
storeOffsetTable(byte[] result, int offset, int flavor, int num_tables)
private static int
storePoints(int n_points, Woff2Common.Point[] points, int n_contours, int instruction_length, byte[] dst, int dst_size)
private static int
storeTableEntry(byte[] result, int offset, int tag)
private static java.util.ArrayList<Woff2Common.Table>
tables(Woff2Dec.Woff2Header hdr, int font_index)
private static int
tripletDecode(byte[] data, int flags_in_offset, int in_offset, int in_size, int n_points, Woff2Common.Point[] result)
private static int
withSign(int flag, int baseval)
private static void
woff2Uncompress(byte[] dst_buf, int dst_offset, int dst_length, byte[] src_buf, int src_offset, int src_length)
private static void
writeHeaders(byte[] data, int length, Woff2Dec.RebuildMetadata metadata, Woff2Dec.Woff2Header hdr, Woff2Out out)
-
-
-
Field Detail
-
kGlyfOnCurve
private static final int kGlyfOnCurve
- See Also:
- Constant Field Values
-
kGlyfXShort
private static final int kGlyfXShort
- See Also:
- Constant Field Values
-
kGlyfYShort
private static final int kGlyfYShort
- See Also:
- Constant Field Values
-
kGlyfRepeat
private static final int kGlyfRepeat
- See Also:
- Constant Field Values
-
kGlyfThisXIsSame
private static final int kGlyfThisXIsSame
- See Also:
- Constant Field Values
-
kGlyfThisYIsSame
private static final int kGlyfThisYIsSame
- See Also:
- Constant Field Values
-
FLAG_ARG_1_AND_2_ARE_WORDS
private static final int FLAG_ARG_1_AND_2_ARE_WORDS
- See Also:
- Constant Field Values
-
FLAG_WE_HAVE_A_SCALE
private static final int FLAG_WE_HAVE_A_SCALE
- See Also:
- Constant Field Values
-
FLAG_MORE_COMPONENTS
private static final int FLAG_MORE_COMPONENTS
- See Also:
- Constant Field Values
-
FLAG_WE_HAVE_AN_X_AND_Y_SCALE
private static final int FLAG_WE_HAVE_AN_X_AND_Y_SCALE
- See Also:
- Constant Field Values
-
FLAG_WE_HAVE_A_TWO_BY_TWO
private static final int FLAG_WE_HAVE_A_TWO_BY_TWO
- See Also:
- Constant Field Values
-
FLAG_WE_HAVE_INSTRUCTIONS
private static final int FLAG_WE_HAVE_INSTRUCTIONS
- See Also:
- Constant Field Values
-
kEndPtsOfContoursOffset
private static final int kEndPtsOfContoursOffset
- See Also:
- Constant Field Values
-
kDefaultGlyphBuf
private static final int kDefaultGlyphBuf
- See Also:
- Constant Field Values
-
kMaxPlausibleCompressionRatio
private static final float kMaxPlausibleCompressionRatio
- See Also:
- Constant Field Values
-
-
Method Detail
-
withSign
private static int withSign(int flag, int baseval)
-
tripletDecode
private static int tripletDecode(byte[] data, int flags_in_offset, int in_offset, int in_size, int n_points, Woff2Common.Point[] result)
-
storePoints
private static int storePoints(int n_points, Woff2Common.Point[] points, int n_contours, int instruction_length, byte[] dst, int dst_size)
-
computeBbox
private static void computeBbox(int n_points, Woff2Common.Point[] points, byte[] dst)
-
sizeOfComposite
private static Woff2Dec.CompositeGlyphInfo sizeOfComposite(Buffer composite_stream)
-
pad4
private static void pad4(Woff2Out out)
-
storeLoca
private static int storeLoca(int[] loca_values, int index_format, Woff2Out out)
-
reconstructGlyf
private static Woff2Dec.Checksums reconstructGlyf(byte[] data, int data_offset, Woff2Common.Table glyf_table, int glyph_checksum, Woff2Common.Table loca_table, int loca_checksum, Woff2Dec.Woff2FontInfo info, Woff2Out out)
-
findTable
private static Woff2Common.Table findTable(java.util.ArrayList<Woff2Common.Table> tables, int tag)
-
readNumHMetrics
private static short readNumHMetrics(byte[] data, int offset, int data_length)
-
reconstructTransformedHmtx
private static int reconstructTransformedHmtx(byte[] transformed_buf, int transformed_offset, int transformed_size, int num_glyphs, int num_hmetrics, short[] x_mins, Woff2Out out)
-
woff2Uncompress
private static void woff2Uncompress(byte[] dst_buf, int dst_offset, int dst_length, byte[] src_buf, int src_offset, int src_length)
-
readTableDirectory
private static void readTableDirectory(Buffer file, Woff2Common.Table[] tables, int num_tables)
-
storeOffsetTable
private static int storeOffsetTable(byte[] result, int offset, int flavor, int num_tables)
-
storeTableEntry
private static int storeTableEntry(byte[] result, int offset, int tag)
-
computeOffsetToFirstTable
private static int computeOffsetToFirstTable(Woff2Dec.Woff2Header hdr)
-
tables
private static java.util.ArrayList<Woff2Common.Table> tables(Woff2Dec.Woff2Header hdr, int font_index)
-
reconstructFont
private static void reconstructFont(byte[] transformed_buf, int transformed_buf_offset, int transformed_buf_size, Woff2Dec.RebuildMetadata metadata, Woff2Dec.Woff2Header hdr, int font_index, Woff2Out out)
-
readWoff2Header
private static void readWoff2Header(byte[] data, int length, Woff2Dec.Woff2Header hdr)
-
writeHeaders
private static void writeHeaders(byte[] data, int length, Woff2Dec.RebuildMetadata metadata, Woff2Dec.Woff2Header hdr, Woff2Out out)
-
computeWoff2FinalSize
public static int computeWoff2FinalSize(byte[] data, int length)
-
convertWoff2ToTtf
public static void convertWoff2ToTtf(byte[] data, int length, Woff2Out out)
-
-