Hi
I m trying to draw two different fonts such as Arial & Impact in my application.
but its drawing only the Arial font, its not drawing the Impact font.
can any one help me out
this is the code
//CustomFOnt ARIAL
CFont* iFont;
TInt iFontUid;
CEikonEnv::Static()->ScreenDevice()->AddFile(_L("\\system\\apps\\arial.gdr"),
iFontUid);
const CFont* logical_font =
AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
TFontSpec font_spec = logical_font->FontSpecInTwips();
TFontSpec myFontSpec(_L("Arial"),font_spec.iHeight);
CEikonEnv::Static()->ScreenDevice()->GetNearestFontToDesignHeightInTwips(iFont,
myFontSpec);
// Using the custom font & drawing some sample text.
gc.UseFont(iFont);
const TPoint point(10,20);
gc.DrawText(_L("Hi Hello how r u?"), point);
// unloading the custom font
CEikonEnv::Static()->ScreenDevice()->ReleaseFont(iFont);
CEikonEnv::Static()->ScreenDevice()->RemoveFile(iFontUid);
//CustomFOnt Impact
CFont* iFont1;
TInt iFontUid1;
CEikonEnv::Static()->ScreenDevice()->AddFile(_L("\\system\\apps\\impact.gdr"),
iFontUid1);
const CFont* logical_font1 =
AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
TFontSpec font_spec1 = logical_font1->FontSpecInTwips();
TFontSpec myFontSpec1(_L("Impact"),font_spec1.iHeight-15);
CEikonEnv::Static()->ScreenDevice()->GetNearestFontToDesignHeightInTwips(iFont1,
myFontSpec1);
// Using the custom font & drawing some sample text.
gc.UseFont(iFont1);
const TPoint point1(10,60);
gc.DrawText(_L("Hi Hello how r u?"), point1);
// unloading the custom font
CEikonEnv::Static()->ScreenDevice()->ReleaseFont(iFont1);
CEikonEnv::Static()->ScreenDevice()->RemoveFile(iFontUid1);
Waiting for more replies
Thanks
Hidayath

Reply With Quote



