I am rendering a box with a number inside it using the following code:
void CContainer:rawNumberInBox(TInt aIndex, TBool aHighlight) const
CWindowGc& gc = SystemGc();
gc.SetBrushColor(TRgb(230, 230, 230));
const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);
gc.UseFont(font /* iEikonEnv->NormalFont()*/);
// draw the number
TInt baseline(iKeys[aIndex].Height() /2 + iEikonEnv->NormalFont()->AscentInPixels()/2);
gc.DrawText(KKeys().Mid(aIndex, 1), iKeys[aIndex], baseline, CGraphicsContext::ECenter);
// draw the box
This routine is called in two situations, from inside a CCoeControl:raw() situation and inside a DrawXXXNow() kind of routine, which looks like below, and which is called when the rect is pressed or not
void CContainer:rawXXXNow(TInt aIndex, TBool aHighlight) const
const TRect rect(iKeys[aIndex]);
On the N97 emulator, this results in a bold number being drawn, when called through Draw() and when called through the DrawXXXNow() routine.
However, on real devices (5800, N97) a bold number is only drawn when called through Draw(). When called through DrawXXXNow(), the number is not bold.
Is this a known bug in the platform, because the used font must be the same in both situation.
Also, the bug happens too the iEikonEnv->NormalFont() is used.
This problem can be circumvented by only calling DrawNow() on the control, but that is flicker-prone.