public final class IFUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
adjustPA(int[] paDst,
int[] paSrc)
Adjust a position adjustments array.
|
static int[] |
convertDPToDX(int[][] dp)
Convert the general gpos 'dp' adjustments to the older 'dx' adjustments.
|
static int[] |
convertDPToDX(int[][] dp,
int count)
Convert the general gpos 'dp' adjustments to the older 'dx' adjustments.
|
static int[][] |
convertDXToDP(int[] dx)
Convert the general gpos 'dp' adjustments to the older 'dx' adjustments.
|
static int[][] |
convertDXToDP(int[] dx,
int count)
Convert the general gpos 'dp' adjustments to the older 'dx' adjustments.
|
static int[][] |
copyDP(int[][] dp,
int offset,
int count)
Copy entries from position adjustments.
|
static String |
getEffectiveMIMEType(IFDocumentHandler documentHandler)
Returns the MIME type of the output format that the given document handler is supposed to
handle.
|
static boolean |
isDPIdentity(int[][] dp)
Determine if position adjustments is the identity adjustment, i.e., no non-zero adjustment.
|
static boolean |
isDPOnlyDX(int[][] dp)
Determine if position adjustments comprises only DX adjustments as encoded by
convertDPToDX(int[][], int) . |
static boolean |
isPAIdentity(int[] pa)
Determine if position adjustment is the identity adjustment, i.e., no non-zero adjustment.
|
static void |
setupFonts(IFDocumentHandler documentHandler)
Sets up the fonts on a document handler.
|
static void |
setupFonts(IFDocumentHandler documentHandler,
FontInfo fontInfo)
Sets up the fonts on a document handler.
|
static String |
toString(AffineTransform transform)
Converts an
AffineTransform instance to an SVG style transform method. |
static String |
toString(AffineTransform[] transforms)
Converts an
AffineTransform array to an SVG style transform method sequence. |
static StringBuffer |
toString(AffineTransform[] transforms,
StringBuffer sb)
Converts an
AffineTransform array to an SVG style transform method sequence. |
static StringBuffer |
toString(AffineTransform transform,
StringBuffer sb)
Converts an
AffineTransform instance to an SVG style transform method. |
static String |
toString(int[] coordinates)
Converts an array of integer coordinates into a space-separated string.
|
static String |
toString(Rectangle rect)
Converts a rectangle into a space-separated string.
|
public static StringBuffer toString(AffineTransform transform, StringBuffer sb)
AffineTransform
instance to an SVG style transform method.transform
- the transformation matrixsb
- the StringBuffer to write the transform method topublic static StringBuffer toString(AffineTransform[] transforms, StringBuffer sb)
AffineTransform
array to an SVG style transform method sequence.transforms
- the transformation matrix arraysb
- the StringBuffer to write the transform method sequence topublic static String toString(AffineTransform[] transforms)
AffineTransform
array to an SVG style transform method sequence.transforms
- the transformation matrix arraypublic static String toString(AffineTransform transform)
AffineTransform
instance to an SVG style transform method.transform
- the transformation matrixpublic static String toString(int[] coordinates)
coordinates
- the coordinatespublic static String toString(Rectangle rect)
rect
- the rectanglepublic static void setupFonts(IFDocumentHandler documentHandler, FontInfo fontInfo) throws FOPException
FopFactory
will be used.
Otherwise, a default font configuration will be set up.documentHandler
- the document handlerfontInfo
- the font info object (may be null)FOPException
- if an error occurs while setting up the fontspublic static void setupFonts(IFDocumentHandler documentHandler) throws FOPException
FopFactory
will be used.
Otherwise, a default font configuration will be set up.documentHandler
- the document handlerFOPException
- if an error occurs while setting up the fontspublic static String getEffectiveMIMEType(IFDocumentHandler documentHandler)
IFSerializer
it returns the MIME type of the
document handler it is mimicking.documentHandler
- the document handlerpublic static int[] convertDPToDX(int[][] dp, int count)
dp
- an array of 4-tuples, expressing [X,Y] placment
adjustments and [X,Y] advancement adjustments, in that order (may be null)count
- if dp
is not null, then a count of dp values to convertdp
is not null, then an array of adjustments to the current
x position prior to rendering individual glyphs; otherwise, nullpublic static int[] convertDPToDX(int[][] dp)
dp
- an array of 4-tuples, expressing [X,Y] placment
adjustments and [X,Y] advancement adjustments, in that order (may be null)dp
is not null, then an array of adjustments to the current
x position prior to rendering individual glyphs; otherwise, nullpublic static int[][] convertDXToDP(int[] dx, int count)
dx
- an array of adjustments to the current x position prior to rendering
individual glyphs or nullcount
- if dx
is not null, then a count of dx values to convertdx
is not null, then an array of 4-tuples, expressing [X,Y]
placment adjustments and [X,Y] advancement adjustments, in that order; otherwise, nullpublic static int[][] convertDXToDP(int[] dx)
dx
- an array of adjustments to the current x position prior to rendering
individual glyphs or nulldx
is not null, then an array of 4-tuples, expressing [X,Y]
placment adjustments and [X,Y] advancement adjustments, in that order; otherwise, nullpublic static boolean isPAIdentity(int[] pa)
pa
- a 4-tuple, expressing [X,Y] placment and [X,Y] advance adjuustments (may be null)dp
is null or contains no non-zero adjustmentpublic static boolean isDPIdentity(int[][] dp)
dp
- an array of 4-tuples, expressing [X,Y] placment
adjustments and [X,Y] advancement adjustments, in that order (may be null)dp
is null or contains no non-zero adjustmentpublic static boolean isDPOnlyDX(int[][] dp)
convertDPToDX(int[][], int)
. Note that if given a set of all all zero position
adjustments, both this method and isDPIdentity(int[][])
will return true;
however, this method may return true when isDPIdentity(int[][])
returns false.dp
- an array of 4-tuples, expressing [X,Y] placment
adjustments and [X,Y] advancement adjustments, in that order (may be null)dp
is not null and contains only xPlaAdjust
and xAdvAdjust values consistent with the output of convertDPToDX(int[][], int)
.public static void adjustPA(int[] paDst, int[] paSrc)
paDst
and paSrc
are
non-null, then paSrc[i]
is added to paDst[i]
.paDst
- a 4-tuple, expressing [X,Y] placment
and [X,Y] advance adjuustments (may be null)paSrc
- a 4-tuple, expressing [X,Y] placment
and [X,Y] advance adjuustments (may be null)public static int[][] copyDP(int[][] dp, int offset, int count)
dp
- an array of 4-tuples, expressing [X,Y] placment
adjustments and [X,Y] advancement adjustments, in that orderoffset
- starting offset from which to copycount
- number of entries to copyCopyright © 2025 Apache Software Foundation. All rights reserved.