CartoType C++ API 8.6-17-gb54a9a81b
for Windows, Linux, Qt and other platforms supporting C++ development
|
#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< FrameworkEngine > | Copy (Result &aError, bool aCopyFonts) |
std::shared_ptr< CEngine > | Engine () const |
Static Public Member Functions | |
static std::unique_ptr< FrameworkEngine > | New (Result &aError, const String &aFontFileName, int32_t aFileBufferSizeInBytes=0, int32_t aMaxFileBufferCount=0, int32_t aTextIndexLevels=0) |
static std::unique_ptr< FrameworkEngine > | New (Result &aError, const std::vector< TypefaceData > &aTypefaceDataArray, int32_t aFileBufferSizeInBytes=0, int32_t aMaxFileBufferCount=0, int32_t aTextIndexLevels=0) |
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.
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.
Configure the CartoTypeCore engine by reading an XML configuration file.
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.
|
inline |
Returns the CEngine object used by this FrameworkEngine. For internal use only.
Loads a font in addition to any fonts already loaded.
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.
|
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.
|
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.