Class FontDescriptorHelper<T extends FontContainer>
- java.lang.Object
-
- org.apache.pdfbox.preflight.font.descriptor.FontDescriptorHelper<T>
-
- Direct Known Subclasses:
CIDType0DescriptorHelper
,CIDType2DescriptorHelper
,TrueTypeDescriptorHelper
,Type1DescriptorHelper
public abstract class FontDescriptorHelper<T extends FontContainer> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected PreflightContext
context
protected T
fContainer
protected PDFontLike
font
protected PDFontDescriptor
fontDescriptor
private static java.util.Set<java.lang.String>
MANDATORYFIELDS
-
Constructor Summary
Constructors Constructor Description FontDescriptorHelper(PreflightContext context, PDFontLike font, T fontContainer)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkFontFileMetaData(PDFontDescriptor fontDescriptor, PDStream fontFile)
Type0, Type1 and TrueType FontValidator call this method to check the FontFile meta data.protected boolean
checkMandatoryFields(COSDictionary fDescriptor)
abstract PDStream
extractFontFile(PDFontDescriptor fontDescriptor)
protected boolean
fontFileNotEmbedded(PDFontDescriptor fontDescriptor)
protected byte[]
getMetaDataStreamAsBytes(PDMetadata metadata)
protected boolean
hasOnlyOneFontFile(PDFontDescriptor fontDescriptor)
Return true if the FontDescriptor has only one FontFile entry.static boolean
isSubSet(java.lang.String fontName)
protected abstract void
processFontFile(PDFontDescriptor fontDescriptor, PDStream fontFile)
void
validate()
-
-
-
Field Detail
-
fContainer
protected T extends FontContainer fContainer
-
context
protected PreflightContext context
-
font
protected PDFontLike font
-
fontDescriptor
protected PDFontDescriptor fontDescriptor
-
MANDATORYFIELDS
private static final java.util.Set<java.lang.String> MANDATORYFIELDS
-
-
Constructor Detail
-
FontDescriptorHelper
public FontDescriptorHelper(PreflightContext context, PDFontLike font, T fontContainer)
-
-
Method Detail
-
validate
public void validate()
-
checkMandatoryFields
protected boolean checkMandatoryFields(COSDictionary fDescriptor)
-
extractFontFile
public abstract PDStream extractFontFile(PDFontDescriptor fontDescriptor)
-
hasOnlyOneFontFile
protected boolean hasOnlyOneFontFile(PDFontDescriptor fontDescriptor)
Return true if the FontDescriptor has only one FontFile entry.- Parameters:
fontDescriptor
-- Returns:
- true if the FontDescriptor has only one FontFile entry.
-
fontFileNotEmbedded
protected boolean fontFileNotEmbedded(PDFontDescriptor fontDescriptor)
-
processFontFile
protected abstract void processFontFile(PDFontDescriptor fontDescriptor, PDStream fontFile)
-
checkFontFileMetaData
protected void checkFontFileMetaData(PDFontDescriptor fontDescriptor, PDStream fontFile)
Type0, Type1 and TrueType FontValidator call this method to check the FontFile meta data.- Parameters:
fontDescriptor
- The FontDescriptor which contains the FontFile streamfontFile
- The font file stream to check
-
getMetaDataStreamAsBytes
protected final byte[] getMetaDataStreamAsBytes(PDMetadata metadata)
-
isSubSet
public static boolean isSubSet(java.lang.String fontName)
-
-