Location:
fbs.h
Link against:
fbscli.lib
CFbsFont
Supported from 5.0
Font managed by the font and bitmap server.
CFbsFont
objects are used for screen and off-screen bitmap fonts. They are usually obtained by calls to the CBitmapDevice::GetNearestFontInPixels()
and MGraphicsDeviceMap::GetNearestFontInTwips()
functions.
The class is derived from the abstract base class CFont
, and implements a number of functions defined in it.
|
Defined in CFbsFont
:
AscentInPixels()
, BaselineOffsetInPixels()
, CharWidthInPixels()
, CharacterMetrics()
, CodeSection()
, FontSpecInTwips()
, GetCharacterData()
, GetFaceAttrib()
, GetFontMetrics()
, Handle()
, HasCharacter()
, HeightInPixels()
, IsOpenFont()
, MaxCharWidthInPixels()
, MaxNormalCharWidthInPixels()
, NumCodeSections()
, RawTextWidthInPixels()
, TextCount()
, TextWidthInPixels()
, TypeUid()
Inherited from CBase
:
operator new()
Inherited from CFont
:
DescentInPixels()
,
EAllCharacterData
,
ECharacterWidthOnly
,
EHorizontal
,
ENoCharacterData
,
EVertical
,
GetCharacterPosition()
,
MeasureText()
,
TCharacterDataAvailability
,
TMeasureTextInput
,
TMeasureTextOutput
,
TPositionParam
,
TTextDirection
,
WidthZeroInPixels()
TInt Handle() const;
Gets the Font and Bitmap server handle of the font.
|
TCharacterMetrics CharacterMetrics(TInt aCode,const TUint8*& aBytes) const;
Gets the character metrics and a pointer to the compressed glyph bitmap for the specified character.
This function is deprecated, because TCharacterMetrics
cannot store metrics larger than 127 or less than 127 — use GetCharacterData()
instead.
|
|
TBool GetCharacterData(TInt aCode,TOpenFontCharMetrics& aMetrics,const TUint8*& aBytes) const;
Withdrawn in 6.0
Gets the character metrics and the glyph bitmap.
This function works for both bitmap fonts and those handled by the Open Font System. It is better than CharacterMetrics()
because TOpenFontCharMetrics
can handle 16-bit metrics, and contains more information.
|
|
CFont::TCharacterDataAvailability GetCharacterData(
TUint aCode, TOpenFontCharMetrics& aMetrics,
const TUint8*& aBitmap, TSize& aBitmapSize) const;
Supported from 6.0
Gets the character metrics and the glyph bitmap.
|
|
TBool GetFontMetrics(TOpenFontMetrics& aMetrics) const;
Gets the open font metrics. If the metrics cannot be obtained the function returns EFalse
.
|
|
TBool GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const;
Gets the typeface attributes of Open Font System fonts.
Notes:
Typeface attributes are different from the font metrics; they are not metrics, which are different for every different size, but size-independent attributes of the typeface, like name and style.
This function can be used if IsOpenFont()
returns true — i.e. the font is an Open Font.
|
|
TBool IsOpenFont() const;
Test whether the font is an Open Font system font.
Note:
If this function returns ETrue
, the function GetFaceAttrib()
will work.
|
TBool HasCharacter(TInt aCode) const;
Tests whether the font contains a particular character.
|
|
TUid TypeUid() const;
Gets the font's UID.
All CFbsFont
objects have the constant UID KCFbsFontUid
. It is safe to cast from CFont*
to CFbsFont*
if CFont::TypeUid()
returns KCFbsFontUid
.
|
TFontSpec FontSpecInTwips() const;
Gets the font specification of this font in twips.
|
TInt HeightInPixels() const;
Gets the height of the font, in pixels.
|
TInt AscentInPixels() const;
Gets the ascent of the font, in pixels.
|
TInt BaselineOffsetInPixels() const;
Gets the baseline offset, in pixels.
The offset is how far a font is raised or lowered from its normal baseline.
|
TInt RawTextWidthInPixels(const TDesC& aText) const;
Gets the raw width of the text in the descriptor, in pixels.
This is the width of the text without adjusting for side bearings, algorithmic style etc.
|
|
TInt CharWidthInPixels(TChar aChar) const;
Gets the width of the specified character in this font, in pixels.
|
|
TInt MaxCharWidthInPixels() const;
Gets the width of the widest character in this font, in pixels.
|
TInt MaxNormalCharWidthInPixels() const;
Gets the width of the widest normal character in this font, in pixels.
Normal characters include all character in a character set except non-alphabetic characters (e.g. the copyright symbol, or a block graphics symbol, for example).
|
TInt TextWidthInPixels(const TDesC& aText) const;
Gets the width of the specified descriptor when displayed in this font, in pixels.
|
|
void TextWidthInPixels(const TDesC& aText,SCharWidth& aCharWidth) const;
Gets the text width, move and adjusts of the specified descriptor when displayed in this font.
|
TInt TextCount(const TDesC& aText,TInt aWidthInPixels) const;
Gets how much of the specified descriptor, when displayed in this font, will be able to be displayed without exceeding the specified width.
Note:
This function does not display any of the descriptor itself — it is used before display, to test whether the whole descriptor can be displayed.
|
|
TInt TextCount(const TDesC& aText,TInt aWidthInPixels,TInt& aExcessWidthInPixels) const;
Gets how much of the specified descriptor, when displayed in this font, will be able to be displayed without exceeding the specified width.
It also returns the excess width — defined as the specified available width minus the width of the portion of the descriptor which can be displayed without exceeding the available width.
|
|
virtual TCodeSection CodeSection(TInt aIndex) const;
Withdrawn in 6.0
Deprecated. This is not used anywhere in version 6.0.
Gets the code section at the specified index. A code section defines the bitmaps for characters in a specified range.
|
|
virtual TInt NumCodeSections() const;
Withdrawn in 6.0
Gets the number of code sections in the font.
A code section defines the bitmaps for characters in a specified range.
|