CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Static Public Member Functions | List of all members
CartoTypeCore::FrameworkEngine Class Reference

#include <cartotype_framework.h>

Public Member Functions

 FrameworkEngine (const std::vector< TypefaceData > &aTypefaceDataArray, int32_t aFileBufferSizeInBytes, int32_t aMaxFileBufferCount, int32_t aTextIndexLevels)
 
Result Configure (const String &aFilename)
 
Result LoadFont (const String &aFontFileName)
 
Result LoadFont (const uint8_t *aData, size_t aLength, bool aCopyData)
 
std::unique_ptr< FrameworkEngineCopy (Result &aError, bool aCopyFonts)
 
std::shared_ptr< CEngine > Engine () const
 

Static Public Member Functions

static std::unique_ptr< FrameworkEngineNew (Result &aError, const String &aFontFileName, int32_t aFileBufferSizeInBytes=0, int32_t aMaxFileBufferCount=0, int32_t aTextIndexLevels=0)
 
static std::unique_ptr< FrameworkEngineNew (Result &aError, const std::vector< TypefaceData > &aTypefaceDataArray, int32_t aFileBufferSizeInBytes=0, int32_t aMaxFileBufferCount=0, int32_t aTextIndexLevels=0)
 

Detailed Description

FrameworkEngine holds a CTM1 data accessor and a standard font. Together with a FrameworkMapDataSet object it makes up the 'model' part of the model-view-controller pattern.

Constructor & Destructor Documentation

◆ FrameworkEngine()

CartoTypeCore::FrameworkEngine::FrameworkEngine ( const std::vector< TypefaceData > &  aTypefaceDataArray,
int32_t  aFileBufferSizeInBytes,
int32_t  aMaxFileBufferCount,
int32_t  aTextIndexLevels 
)

Creates a FrameworkEngine object, loading the fonts in aTypefaceDataArray. Throws an exception on error.

aFileBufferSizeInBytes and aMaxFileBufferCount can be used to control file buffering when reading map data files. Zero values cause defaults to be used.

aTextIndexLevels sets the number of levels of the text index to be loaded into RAM. A value of zero causes the default number of levels (1) to be loaded. Low levels save run-time RAM; -1 prevents the text index from being loaded.

Member Function Documentation

◆ Configure()

Result CartoTypeCore::FrameworkEngine::Configure ( const String aFilename)

Configure the CartoTypeCore engine by reading an XML configuration file.

◆ Copy()

std::unique_ptr< FrameworkEngine > CartoTypeCore::FrameworkEngine::Copy ( Result aError,
bool  aCopyFonts 
)

Create a copy of a FrameworkEngine object, loading the same fonts and reading the same configuration file.

◆ Engine()

std::shared_ptr< CEngine > CartoTypeCore::FrameworkEngine::Engine ( ) const
inline

Returns the CEngine object used by this FrameworkEngine. For internal use only.

◆ LoadFont() [1/2]

Result CartoTypeCore::FrameworkEngine::LoadFont ( const String aFontFileName)

Loads a font in addition to any fonts already loaded.

◆ LoadFont() [2/2]

Result CartoTypeCore::FrameworkEngine::LoadFont ( const uint8_t *  aData,
size_t  aLength,
bool  aCopyData 
)

Loads a font from data in memory. If aCopyData is true, makes a copy of the data and uses the copy, otherwise uses the supplied pointer aData, which must point to data that survives at least as long as the FrameworkEngine object exists, or until the font is unloaded.

◆ New() [1/2]

std::unique_ptr< FrameworkEngine > CartoTypeCore::FrameworkEngine::New ( Result aError,
const std::vector< TypefaceData > &  aTypefaceDataArray,
int32_t  aFileBufferSizeInBytes = 0,
int32_t  aMaxFileBufferCount = 0,
int32_t  aTextIndexLevels = 0 
)
static

Creates a FrameworkEngine object, loading the fonts in aTypefaceDataArray. If any error occurs it is returned in aError and the function returns nullptr.

aFileBufferSizeInBytes and aMaxFileBufferCount can be used to control file buffering when reading map data files. Zero values cause defaults to be used.

aTextIndexLevels sets the number of levels of the text index to be loaded into RAM. A value of zero causes the default number of levels (1) to be loaded. Low levels save run-time RAM; -1 prevents the text index from being loaded.

◆ New() [2/2]

std::unique_ptr< FrameworkEngine > CartoTypeCore::FrameworkEngine::New ( Result aError,
const String aFontFileName,
int32_t  aFileBufferSizeInBytes = 0,
int32_t  aMaxFileBufferCount = 0,
int32_t  aTextIndexLevels = 0 
)
static

Creates a FrameworkEngine object, loading the font aFontFileName. If any error occurs it is returned in aError and the function returns nullptr.

aFileBufferSizeInBytes and aMaxFileBufferCount can be used to control file buffering when reading map data files. Zero values cause defaults to be used.

aTextIndexLevels sets the number of levels of the text index to be loaded into RAM. A value of zero causes the default number of levels (1) to be loaded. Low levels save run-time RAM; -1 prevents the text index from being loaded.


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