|
Ultralight C++ API 2.0.0
|
#include <Ultralight/platform/FontLoader.h>
Represents a font file, either on-disk path or in-memory file contents.
Static Public Member Functions | |
| static RefPtr< FontFile > | Create (const String &filepath, int face_index=-1) |
| Create a font file from an on-disk file path. | |
| static RefPtr< FontFile > | Create (RefPtr< Buffer > buffer, int face_index=-1) |
| Create a font file from an in-memory buffer. | |
Public Member Functions | |
| virtual bool | is_in_memory () const =0 |
| Whether or not this font file was created from an in-memory buffer. | |
| virtual String | filepath () const =0 |
| The file path (if any). | |
| virtual RefPtr< Buffer > | buffer () const =0 |
| The in-memory buffer (if any). | |
| virtual int | face_index () const =0 |
| The index of the face within a font collection, or -1 when the library chooses the face. | |
| virtual uint32_t | hash () const =0 |
| Unique hash (if this is a filepath, only the path string is hashed). | |
| Public Member Functions inherited from RefCounted | |
| virtual void | AddRef () const =0 |
| Increment the reference count (thread-safe). | |
| virtual void | Release () const =0 |
| Decrement the reference count (thread-safe). | |
| virtual int | ref_count () const =0 |
| Get the current reference count. | |
| virtual WeakControlBlock * | weak_control_block () const |
| Get the control block used to track weak references to this object. | |
Protected Member Functions | |
| FontFile () | |
| virtual | ~FontFile () |
| FontFile (const FontFile &) | |
| void | operator= (const FontFile &) |
| Protected Member Functions inherited from RefCounted | |
| virtual | ~RefCounted () |
|
protected |
|
protectedvirtual |
|
protected |
Create a font file from an on-disk file path.
| filepath | The path to the font file on disk. The file should already exist. |
| face_index | The index of the face to use when the file is a font collection (eg, a .ttc holding several families). Pass -1 to let the library choose the face that best matches the requested weight and style. |
Create a font file from an in-memory buffer.
| buffer | The font file data (TTF/OTF, or a collection). |
| face_index | The index of the face to use when the data is a font collection. Pass -1 to let the library choose the face that best matches the requested weight and style. |
|
pure virtual |
The index of the face within a font collection, or -1 when the library chooses the face.
|
pure virtual |
The file path (if any).
|
pure virtual |
Unique hash (if this is a filepath, only the path string is hashed).
|
pure virtual |
Whether or not this font file was created from an in-memory buffer.
|
protected |