public abstract class FontResourceBase extends Object implements IHtmlResource
Base class for any supported font type as a resource for the HTML document with all its properties
Modifier and Type | Field and Description |
---|---|
Event<EventHandler> |
Disposed
Event, which occurs when this font is disposed
|
Constructor and Description |
---|
FontResourceBase() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this font resource, disposing its content and making most
methods and properties non-working
|
boolean |
equals(FontResourceBase other)
Checks this instance with specified font resource on reference equality
|
boolean |
equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
|
InputStream |
getByteContent()
Returns content of this font as byte stream
|
String |
getFilenameWithExtension()
Returns correct filename of this font resource, which consists of name
and extension.
|
String |
getName()
Returns name of this font resource.
|
String |
getTextContent()
Returns content of this font as base64-encoded string.
|
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
|
boolean |
isDisposed()
Determines whether this font is disposed or not
|
void |
save(String fullPathToFile)
Saves this font to the specified file
|
public final Event<EventHandler> Disposed
public final void dispose()
Disposes this font resource, disposing its content and making most methods and properties non-working
dispose
in interface IDisposable
public final boolean equals(FontResourceBase other)
Checks this instance with specified font resource on reference equality
other
- Other inheritor of FontResourceBase abstract classpublic final boolean equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
other
- Other inheritor of IHtmlResource interfacepublic final InputStream getByteContent()
Returns content of this font as byte stream
getByteContent
in interface IHtmlResource
public final String getFilenameWithExtension()
Returns correct filename of this font resource, which consists of name and extension. Theoretically can differ from the name.
getFilenameWithExtension
in interface IHtmlResource
public final String getName()
Returns name of this font resource. Usually doesn't contain filename extension and theoretically can differ from filename.
getName
in interface IHtmlResource
public final String getTextContent()
Returns content of this font as base64-encoded string. This value is cached after first invoke.
getTextContent
in interface IHtmlResource
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
getType
in interface IHtmlResource
public final boolean isDisposed()
Determines whether this font is disposed or not
isDisposed
in interface IAuxDisposable
public final void save(String fullPathToFile)
Saves this font to the specified file
save
in interface IHtmlResource
fullPathToFile
- Full path to the file, which will be created or
rewritten