org.apache.pdfbox.preflight.font.descriptor

## 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 Object

### Field Summary

Fields
`protected PreflightContext` `context`
`protected T` `fContainer`
`protected org.apache.pdfbox.pdmodel.font.PDFontLike` `font`
`protected org.apache.pdfbox.pdmodel.font.PDFontDescriptor` `fontDescriptor`

### Constructor Summary

Constructors
Constructor and Description
`FontDescriptorHelper(PreflightContext context, org.apache.pdfbox.pdmodel.font.PDFontLike font, T fontContainer)`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`protected void` `checkFontFileMetaData(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor, org.apache.pdfbox.pdmodel.common.PDStream fontFile)` Type0, Type1 and TrueType FontValidator call this method to check the FontFile meta data.
`protected boolean` `checkMandatoryFields(org.apache.pdfbox.cos.COSDictionary fDescriptor)`
`abstract org.apache.pdfbox.pdmodel.common.PDStream` `extractFontFile(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor)`
`protected boolean` `fontFileNotEmbedded(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor)`
`protected byte[]` `getMetaDataStreamAsBytes(org.apache.pdfbox.pdmodel.common.PDMetadata metadata)`
`protected boolean` `hasOnlyOneFontFile(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor)` Return true if the FontDescriptor has only one FontFile entry.
`static boolean` `isSubSet(String fontName)`
`protected abstract void` `processFontFile(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor, org.apache.pdfbox.pdmodel.common.PDStream fontFile)`
`void` `validate()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### fContainer

    protected T extends FontContainer fContainer

#### context

    protected PreflightContext context

#### font

    protected org.apache.pdfbox.pdmodel.font.PDFontLike font

#### fontDescriptor

    protected org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor

### Constructor Detail

#### FontDescriptorHelper

    public FontDescriptorHelper(PreflightContext context,
                                org.apache.pdfbox.pdmodel.font.PDFontLike font,
                                T fontContainer)

### Method Detail

#### validate

    public void validate()

#### checkMandatoryFields

    protected boolean checkMandatoryFields(org.apache.pdfbox.cos.COSDictionary fDescriptor)

#### extractFontFile

    public abstract org.apache.pdfbox.pdmodel.common.PDStream extractFontFile(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor)

#### hasOnlyOneFontFile

    protected boolean hasOnlyOneFontFile(org.apache.pdfbox.pdmodel.font.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(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor)

#### processFontFile

    protected abstract void processFontFile(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor,
                                            org.apache.pdfbox.pdmodel.common.PDStream fontFile)

#### checkFontFileMetaData

    protected void checkFontFileMetaData(org.apache.pdfbox.pdmodel.font.PDFontDescriptor fontDescriptor,
                                         org.apache.pdfbox.pdmodel.common.PDStream fontFile)

Type0, Type1 and TrueType FontValidator call this method to check the FontFile meta data.

Parameters:
  `fontDescriptor` - The FontDescriptor which contains the FontFile stream
  `fontFile` - The font file stream to check

#### getMetaDataStreamAsBytes

    protected final byte[] getMetaDataStreamAsBytes(org.apache.pdfbox.pdmodel.common.PDMetadata metadata)

#### isSubSet

    public static boolean isSubSet(String fontName)