FontResourceBase

Inheritance: java.lang.Object

All Implemented Interfaces: com.groupdocs.editor.htmlcss.resources.IHtmlResource

public abstract class FontResourceBase implements IHtmlResource

Base class for any supported font type as a resource for the HTML document with all its properties

Constructors

Constructor Description
FontResourceBase()

Fields

Field Description
Disposed Event, which occurs when this font is disposed

Methods

Method Description
getName() Returns name of this font resource.
getFilenameWithExtension() Returns correct filename of this font resource, which consists of name and extension.
getByteContent() Returns content of this font as byte stream
getTextContent() Returns content of this font as base64-encoded string.
save(String fullPathToFile) Saves this font to the specified file
equals(IHtmlResource other) Checks this instance with specified HTML resource on reference equality
equals(FontResourceBase other) Checks this instance with specified font resource on reference equality
dispose() Disposes this font resource, disposing its content and making most methods and properties non-working
isDisposed() Determines whether this font is disposed or not
getType() In implementing type should return information about type of specific font resource as an instance of specific FontType type, which encapsulates all type-specific info

FontResourceBase()

public FontResourceBase()

Disposed

public final Event<EventHandler> Disposed

Event, which occurs when this font is disposed

getName()

public final String getName()

Returns name of this font resource. Usually doesn’t contain filename extension and theoretically can differ from filename.

Returns: java.lang.String

getFilenameWithExtension()

public final String getFilenameWithExtension()

Returns correct filename of this font resource, which consists of name and extension. Theoretically can differ from the name.

Returns: java.lang.String

getByteContent()

public final InputStream getByteContent()

Returns content of this font as byte stream

Returns: java.io.InputStream -

getTextContent()

public final String getTextContent()

Returns content of this font as base64-encoded string. This value is cached after first invoke.

Returns: java.lang.String -

save(String fullPathToFile)

public final void save(String fullPathToFile)

Saves this font to the specified file

Parameters:

Parameter Type Description
fullPathToFile java.lang.String Full path to the file, which will be created or rewritten

equals(IHtmlResource other)

public final boolean equals(IHtmlResource other)

Checks this instance with specified HTML resource on reference equality

Parameters:

Parameter Type Description
other IHtmlResource Other inheritor of IHtmlResource interface

Returns: boolean - True if are equal, false if are unequal

equals(FontResourceBase other)

public final boolean equals(FontResourceBase other)

Checks this instance with specified font resource on reference equality

Parameters:

Parameter Type Description
other FontResourceBase Other inheritor of FontResourceBase abstract class

Returns: boolean - True if are equal, false if are unequal

dispose()

public final void dispose()

Disposes this font resource, disposing its content and making most methods and properties non-working

isDisposed()

public final boolean isDisposed()

Determines whether this font is disposed or not

Returns: boolean -

getType()

public abstract FontType getType()

In implementing type should return information about type of specific font resource as an instance of specific FontType type, which encapsulates all type-specific info

Returns: FontType