Can I use CFontStore to find a font?
| Thu, 2004-07-22 20:13 | |
|
From Symbian Doc, I can find a font and draw text as followings:
void Draw() { CWindowGc& gc = SystemGc(); _LIT(KMyFontName, "Arial"); CFont* myFont; TFontSpec myFontSpec(KMyFontName, 1); CGraphicsDevice* screenDevice = iCoeEnv->ScreenDevice(); screenDevice->GetNearestFontInTwips(myFont, myFontSpec); gc.UseFont(myFont); _LIT(KMyText, "My text"); gc.DrawText(KMyText, TPoint(40,40)); gc.DiscardFont(); screenDevice->ReleaseFont(myFont); } Can I use CFontStore to find a font instead of using CGraphicDevice? Because CFontStore::GetNearestFontInTwips() let users pass-in TOpenFontSpec, the CGraphicDevice::GetNearestFontInTwips() only let users pass-in TFontSpec (TOpenFontSpec can define more effects). |
|





