How can we check character codes for space and newline symbols?
Article Metadata
Linefeed: 0xe125
Space: 0xe118
Starting from S60 2nd Edition, FP2 and the Nokia 6630, these character codes have been changed to be the following:
Linefeed: 0xf200
Space: 0xf201
It is possible to dynamically check what codes to use by checking if the current font includes these characters.
#include <fbs.h>
#include <openfont.h>
TUid fontUid = CEikonEnv::Static()->NormalFont()->TypeUid();
if(fontUid == KCFbsFontUid)
{
const CFbsFont* font =
static_cast<const CFbsFont*>(CEikonEnv::Static()->NormalFont());
TOpenFontCharMetrics metrics;
const TUint8 *bitmap1, *bitmap2;
TSize size;
font->GetCharacterData(0xe118,metrics,bitmap1,size);
font->GetCharacterData(0xe125,metrics,bitmap2,size);
if(bitmap1 == bitmap2)
{
// glyph bitmap pointers for space + lf have
// the same value, pointing to the same 'undefined'
// bitmap -> Font does not have these chars
// Switch to using 0xF200 and 0xF201 as lf/space codes
}
}


(no comments yet)