#include <fontimpl.h>
Static Public Member Functions | |
static MILLIPOINT | GetCharsKerning (wxDC *pDC, WCHAR chLeft, WCHAR chRight, CharDescription &FontDesc) |
Get the kern between two chars of a font Note: The kern pairs are cached (see FontKerningPairsCacheEntry::GetCharsKerning). | |
Protected Types | |
enum | CacheInfo { NUMENTRIES = 3 } |
Static Protected Attributes | |
static FontKerningPairsCacheEntry | m_FontKerningPairsCacheData [NUMENTRIES] |
Private Member Functions | |
CC_DECLARE_MEMDUMP (FontKerningPairsCache) |
Definition at line 256 of file fontimpl.h.
|
Definition at line 271 of file fontimpl.h. 00271 { NUMENTRIES=3 };
|
|
|
|
Get the kern between two chars of a font Note: The kern pairs are cached (see FontKerningPairsCacheEntry::GetCharsKerning).
Definition at line 1166 of file fontbase.cpp. 01168 { 01169 // TRACEUSER("wuerthne", _T("GetCharsKerning %04x %04x"), chLeft, chRight); 01170 ERROR2IF(pDC==NULL, 0, "FontKerningPairsCache::GetCharsKerning() - pDC==NULL"); 01171 ERROR2IF(FontDesc.GetCharCode() != FONTEMCHAR, FALSE, 01172 "FontKerningPairsCache::GetCharsKerning() - FontDesc char should be 'FONTEMCHAR'"); 01173 #ifndef DISABLE_TEXT_RENDERING 01174 // find out whether the font is in the cache (and if so which entry) 01175 INT32 CacheEntry = 0; 01176 while (CacheEntry < NUMENTRIES && m_FontKerningPairsCacheData[CacheEntry].GetFontDesc() != FontDesc) 01177 CacheEntry++; 01178 01179 if (CacheEntry >= NUMENTRIES) 01180 { 01181 // TRACEUSER("wuerthne", _T("did not find cache entry, so allocate new one")); 01182 // the font is not in the cache, so throw out a random cache entry and prepare 01183 // the cache entry so we can start caching the kerning data for the new font 01184 CacheEntry = rand() % NUMENTRIES; 01185 m_FontKerningPairsCacheData[CacheEntry].Reinitialise(FontDesc); 01186 } 01187 return m_FontKerningPairsCacheData[CacheEntry].GetCharsKerning(chLeft, chRight); 01188 #else 01189 return 0; 01190 #endif 01191 }
|
|
Definition at line 273 of file fontimpl.h. |