Pepper_31_C++_interfaces
Public Member Functions | Static Public Member Functions | List of all members
pp::TrueTypeFont_Dev Class Reference

The TrueTypeFont_Dev class represents a TrueType font resource. More...

#include <truetype_font_dev.h>

Inheritance diagram for pp::TrueTypeFont_Dev:
Inheritance graph
Collaboration diagram for pp::TrueTypeFont_Dev:
Collaboration graph

Public Member Functions

 TrueTypeFont_Dev ()
 Default constructor for creating a TrueTypeFont_Dev object. More...
 
 TrueTypeFont_Dev (const InstanceHandle &instance, const TrueTypeFontDesc_Dev &desc)
 
 TrueTypeFont_Dev (const TrueTypeFont_Dev &other)
 
 TrueTypeFont_Dev (PassRef, PP_Resource resource)
 
int32_t Describe (const CompletionCallbackWithOutput< TrueTypeFontDesc_Dev > &callback)
 
int32_t GetTableTags (const CompletionCallbackWithOutput< std::vector< uint32_t > > &callback)
 
int32_t GetTable (uint32_t table, int32_t offset, int32_t max_data_length, const CompletionCallbackWithOutput< std::vector< char > > &callback)
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor. More...
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor. More...
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Static Public Member Functions

static int32_t GetFontFamilies (const InstanceHandle &instance, const CompletionCallbackWithOutput< std::vector< Var > > &callback)
 
static int32_t GetFontsInFamily (const InstanceHandle &instance, const Var &family, const CompletionCallbackWithOutput< std::vector< TrueTypeFontDesc_Dev > > &callback)
 

Additional Inherited Members

- Protected Member Functions inherited from pp::Resource
 Resource (PP_Resource resource)
 
 Resource (PassRef, PP_Resource resource)
 
void PassRefFromConstructor (PP_Resource resource)
 

Detailed Description

The TrueTypeFont_Dev class represents a TrueType font resource.

Definition at line 94 of file truetype_font_dev.h.

Constructor & Destructor Documentation

pp::TrueTypeFont_Dev::TrueTypeFont_Dev ( )

Default constructor for creating a TrueTypeFont_Dev object.

pp::TrueTypeFont_Dev::TrueTypeFont_Dev ( const InstanceHandle instance,
const TrueTypeFontDesc_Dev desc 
)

A constructor used to create a TrueTypeFont_Dev and associate it with the provided Instance.

Parameters
[in]instanceThe instance that owns this resource.
pp::TrueTypeFont_Dev::TrueTypeFont_Dev ( const TrueTypeFont_Dev other)

The copy constructor for TrueTypeFont_Dev.

Parameters
[in]otherA reference to a TrueTypeFont_Dev.
pp::TrueTypeFont_Dev::TrueTypeFont_Dev ( PassRef  ,
PP_Resource  resource 
)

A constructor used when you have received a PP_Resource as a return value that has had its reference count incremented for you.

Parameters
[in]resourceA PP_Resource corresponding to a TrueType font.

Member Function Documentation

int32_t pp::TrueTypeFont_Dev::Describe ( const CompletionCallbackWithOutput< TrueTypeFontDesc_Dev > &  callback)

Returns a description of the given font resource. This description may differ from the description passed to Create, reflecting the host's font matching and fallback algorithm.

Parameters
[in]callbackA CompletionCallback to be called upon completion of Describe.
Returns
A return code from pp_errors.h. If an error code is returned, the descriptor will be left unchanged.
static int32_t pp::TrueTypeFont_Dev::GetFontFamilies ( const InstanceHandle instance,
const CompletionCallbackWithOutput< std::vector< Var > > &  callback 
)
static

Gets an array of TrueType font family names available on the host. These names can be used to create a font from a specific family.

Parameters
[in]instanceA InstanceHandle requesting the family names.
[in]callbackA CompletionCallbackWithOutput to be called upon completion of GetFontFamilies.
Returns
If >= 0, the number of family names returned, otherwise an error code from pp_errors.h.
static int32_t pp::TrueTypeFont_Dev::GetFontsInFamily ( const InstanceHandle instance,
const Var family,
const CompletionCallbackWithOutput< std::vector< TrueTypeFontDesc_Dev > > &  callback 
)
static

Gets an array of TrueType font descriptors for a given font family. These descriptors can be used to create a font in that family and matching the descriptor attributes.

Parameters
[in]instanceA PP_Instance requesting the font descriptors.
[in]familyA Var holding a string specifying the font family.
[in]callbackA CompletionCallbackWithOutput to be called upon completion of GetFontsInFamily.
Returns
If >= 0, the number of font descriptors returned, otherwise an error code from pp_errors.h.
int32_t pp::TrueTypeFont_Dev::GetTable ( uint32_t  table,
int32_t  offset,
int32_t  max_data_length,
const CompletionCallbackWithOutput< std::vector< char > > &  callback 
)

Copies the given font table into client memory.

Parameters
[in]tableA 4 byte value indicating which table to copy. For example, 'glyf' will cause the outline table to be copied into the output array. A zero tag value will cause the entire font to be copied.
[in]offsetThe offset into the font table.
[in]max_data_lengthThe maximum number of bytes to transfer from offset.
[in]callbackA CompletionCallbackWithOutput to be called upon completion of GetTable.
Returns
If >= 0, the table size in bytes, otherwise an error code from pp_errors.h.
int32_t pp::TrueTypeFont_Dev::GetTableTags ( const CompletionCallbackWithOutput< std::vector< uint32_t > > &  callback)

Gets an array of identifying tags for each table in the font. These tags can be used to request specific tables using GetTable.

Parameters
[in]callbackA CompletionCallbackWithOutput to be called upon completion of GetTableTags.
Returns
If >= 0, the number of table tags returned, otherwise an error code from pp_errors.h.

The documentation for this class was generated from the following file: