org.apache.pdfbox.preflight.font.container

## Class FontContainer<T extends org.apache.pdfbox.pdmodel.font.PDFontLike>

- java.lang.Object
- - org.apache.pdfbox.preflight.font.container.FontContainer<T>

Direct Known Subclasses:
  CIDType0Container, CIDType2Container, TrueTypeContainer, Type0Container, Type1Container, Type3Container

    public abstract class FontContainer<T extends org.apache.pdfbox.pdmodel.font.PDFontLike>
    extends Object

### Field Summary

Fields
`protected boolean` `embeddedFont` Boolean used to known if the font is embedded.
`protected List<ValidationResult.ValidationError>` `errorBuffer` List of validation errors that occur during the font validation.
`protected T` `font` Font-like object.

### Constructor Summary

Constructors
Constructor and Description
`FontContainer(T font)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`void` `checkGlyphWidth(int code)` Check that the Width or W entry in the PDF matches the widths in the embedded font program.
`boolean` `errorsAleadyMerged()`
`List<ValidationResult.ValidationError>` `getAllErrors()`
`protected abstract boolean` `hasGlyph(int code)` Checks if the embedded font contains a glyph for the given character code.
`boolean` `isEmbeddedFont()`
`boolean` `isValid()`
`void` `markAsInvalid(int code, GlyphException e)`
`void` `markAsValid(int code)`
`void` `notEmbedded()`
`void` `push(List<ValidationResult.ValidationError> errors)`
`void` `push(ValidationResult.ValidationError error)`
`void` `setErrorsAlreadyMerged(boolean errorsAlreadyMerged)`

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

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

### Field Detail

#### errorBuffer

    protected List<ValidationResult.ValidationError> errorBuffer

List of validation errors that occur during the font validation. If the font is used by an object in the PDF, all these errors will be appended to the Error list of the PreflightContext.

#### embeddedFont

    protected boolean embeddedFont

Boolean used to known if the font is embedded.

#### font

    protected final T extends org.apache.pdfbox.pdmodel.font.PDFontLike font

Font-like object.

### Constructor Detail

#### FontContainer

    public FontContainer(T font)

### Method Detail

#### push

    public void push(ValidationResult.ValidationError error)

#### push

    public void push(List<ValidationResult.ValidationError> errors)

#### getAllErrors

    public List<ValidationResult.ValidationError> getAllErrors()

#### isValid

    public boolean isValid()

#### errorsAleadyMerged

    public boolean errorsAleadyMerged()

#### setErrorsAlreadyMerged

    public void setErrorsAlreadyMerged(boolean errorsAlreadyMerged)

#### isEmbeddedFont

    public boolean isEmbeddedFont()

#### notEmbedded

    public void notEmbedded()

#### checkGlyphWidth

    public void checkGlyphWidth(int code)
                         throws GlyphException

Check that the Width or W entry in the PDF matches the widths in the embedded font program.

Parameters:
  `code` - character code
Throws:
  `GlyphException`

#### hasGlyph

    protected abstract boolean hasGlyph(int code)
                                 throws IOException

Checks if the embedded font contains a glyph for the given character code.

Parameters:
  `code` - character code
Throws:
  `IOException`

#### markAsValid

    public final void markAsValid(int code)

#### markAsInvalid

    public final void markAsInvalid(int code,
                                    GlyphException e)