|
CartoType API
|
#include <cartotype_engine.h>
Public Types | |
| enum | { EGlyphLogEntries = 128 } |
Public Member Functions | |
| CT_IMPORT TResult | Configure (MString &aFilename) |
| CT_IMPORT TResult | Configure (MInputStream &aStream) |
| CT_IMPORT TResult | Render (const MPath &aOutline, MRaster &aRaster, uint32 aFlags) |
| CT_IMPORT TResult | LoadTypefaceResource (MString &aName) |
| CT_IMPORT TResult | LoadTypefaceResource (const uint8 *aData, int32 aLength, bool aCopyData) |
| CT_IMPORT TResult | LoadTypefaceResource (const TTypefaceResourceId &aResourceId) |
| CT_IMPORT CTypeface * | Typeface (const TFontSpec &aSpec, int32 aChar=0) |
| CT_IMPORT TResult | LoadTypefaceAccessor (CTypefaceAccessor *aAccessor) |
| CT_IMPORT CGlyph * | Glyph (TResult &aError, const TGlyphKey &aKey) |
| CT_IMPORT void | LogGlyph (const CGlyph *aGlyph, const TPoint &aOrigin) |
| CT_IMPORT void | ClearAbbreviations () |
| CT_IMPORT TResult | AddAbbreviation (const MString &aLongForm, const MString &aShortForm) |
| CT_IMPORT int32 | MemoryUsed () |
| CT_IMPORT void | ClearCachedData () |
| int32 * | MapDrawInterrupt () |
| const MPointerDictionary < MString, MString > & | AbbreviationDictionary () const |
| const MDictionary< MString, int32 > & | TitleCaseDictionary () const |
| COutline & | Envelope () |
| COutline & | TempEnvelope () |
| int32 | GlyphLogIndex () const |
| const TLoggedGlyph & | LoggedGlyph (int32 aIndex) const |
Static Public Member Functions | |
| static CT_IMPORT CEngine * | New (TResult &aError) |
The engine class holds any global information needed by CartoType. This includes the typeface cache, the glyph cache, and the working memory used when converting shapes into bitmaps. Anything that uses these things must have access to an engine. A single engine object must be created by any process that uses CartoType.
| anonymous enum |
| EGlyphLogEntries |
The size of the glyph log. This is the maximum number of glyphs that can be redrawn at high speed using CGraphicsContext::DrawLoggedText, |
| const MPointerDictionary<MString,MString>& CartoType::CEngine::AbbreviationDictionary | ( | ) | const [inline] |
Return the dictionary of abbreviations for words in map labels.
| CT_EXPORT TResult CEngine::AddAbbreviation | ( | const MString & | aLongForm, |
| const MString & | aShortForm | ||
| ) |
Add an abbreviation, to be used to shorten labels where necessary. The case of the two forms is ignored and the abbreviation is added for uppercase and titlecase forms. No error is returned if the abbreviation is already in use.
| CT_EXPORT void CEngine::ClearAbbreviations | ( | ) |
Delete all abbreviations used to shorten labels.
| CT_EXPORT void CEngine::ClearCachedData | ( | ) |
Clear cached data from the engine. This function clears the caches but retains any typefaces that have been loaded.
The caches comprise the glyph cache and any data cached by the typeface accessors and typefaces.
Configure the CartoType engine by reading an XML configuration file.
| CT_EXPORT TResult CEngine::Configure | ( | MInputStream & | aStream | ) |
Configure the CartoType engine by reading XML configuration data from a stream.
| COutline& CartoType::CEngine::Envelope | ( | ) | [inline] |
Return the reusable outline used by the envelope algorithm.
Get a pointer to a glyph, specifying the character code using a glyph key. The returned glyph pointer is owned by the engine. A returned glyph pointer is guaranteed to remain valid until 64 more calls to CEngine::Glyph have been made. It may then be removed from the glyph cache.
| int32 CartoType::CEngine::GlyphLogIndex | ( | ) | const [inline] |
Return the current glyph log index.
| CT_EXPORT TResult CEngine::LoadTypefaceAccessor | ( | CTypefaceAccessor * | aAccessor | ) |
Load a typeface accessor object that can provide access to one or more typeface formats. The engine takes ownership of aAccessor. The caller must not delete it.
Load a typeface resource identified by name.
| CT_EXPORT TResult CEngine::LoadTypefaceResource | ( | const uint8 * | aData, |
| int32 | aLength, | ||
| bool | aCopyData | ||
| ) |
Load a typeface resource from data in memory. If aCopyData is true, make a copy of the data and use the copy, otherwise use the supplied pointer aData, which must point to data that survives at least as long as the CEngine object exists, or until the typeface is unloaded.
| CT_EXPORT TResult CEngine::LoadTypefaceResource | ( | const TTypefaceResourceId & | aResourceId | ) |
Load a typeface resource.
| const TLoggedGlyph& CartoType::CEngine::LoggedGlyph | ( | int32 | aIndex | ) | const [inline] |
Return a logged glyph by index.
Log a glyph and its position.
| int32* CartoType::CEngine::MapDrawInterrupt | ( | ) | [inline] |
Return a pointer to an integer to be set to non-zero by another thread to interrupt map drawing.
| CT_EXPORT int32 CEngine::MemoryUsed | ( | ) |
Return the number of bytes of heap used by the engine. The macro CARTOTYPE_TRACK_FT_MEMORY must be defined, either in ftsystem.c or on the compiler command line, to track heap memory used by FreeType.
Create and return a new engine object.
Render the path defined by aOutline. Draw it using the interface aRaster. The argument aFlags is made from bit values defined in CGraphicsContext, allowing a choice of anti-aliasing versus plain rendering, fractional pixels or unitary pixels, and even-odd versus non-zero winding rules.
| COutline& CartoType::CEngine::TempEnvelope | ( | ) | [inline] |
Return the reusable outline for temporary contours in the envelope algorithm.
| const MDictionary<MString,int32>& CartoType::CEngine::TitleCaseDictionary | ( | ) | const [inline] |
Return the dictionary of special case treatments for title-case words in map labels. For example, 'on' is not changed to 'On' even when other words are capitalized.
Find the typeface that best matches aSpec. If aChar is non-zero the typeface must contain the character aChar.
1.7.5.1