#include <FBS.H>
Link against:
fbscli.lib
class CFbsFont : public CFont;
Description
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(CFont *&,const TFontSpec &)
and MGraphicsDeviceMap::GetNearestFontInTwips(CFont *&,const TFontSpec &)
functions. The class implements a number of functions inherited from CFont
.
Derivation
CBase
-
Base class for all classes to be instantiated on the heap.
CFont
- Abstract font interface.
CFbsFont
- Font managed by the font and bitmap server. CFbsFont objects are used for screen...
Members
Defined in CFbsFont
:
Address()const
CFbsFont()
CFbsFont(const CFbsFont &)
DoAscentInPixels()const
Gets the font ascent in pixels.
DoBaselineOffsetInPixels()const
Gets the baseline offset, in pixels. The offset is how far a font is raised or l...
DoCharWidthInPixels(TChar)const
Gets the width of the specified character in this font, in pixels.
DoFontSpecInTwips()const
Gets the font specification of this font in twips.
DoGetCharacterData(TUint,TOpenFontCharMetrics &,const TUint8 *&,TSize &)const
Gets the character metrics and the glyph bitmap.
DoHeightInPixels()const
Gets the font height in pixels.
DoMaxCharWidthInPixels()const
Gets the width of the widest character in this font, in pixels.
DoMaxNormalCharWidthInPixels()const
Gets the width of the widest normal character in this font, in pixels. Normal ch...
DoTextCount(const TDesC &,TInt)const
Gets how much of the specified descriptor can be displayed in this font without ...
DoTextCount(const TDesC &,TInt,TInt &)const
Gets how much of the specified descriptor can be displayed in this font without ...
DoTextWidthInPixels(const TDesC &)const
Gets the width of the specified descriptor when displayed in this font, in pixel...
DoTypeUid()const
Gets the font's UID. All CFbsFont objects have the constant UID KCFbsFontUid. It...
Duplicate(TInt)
Duplicates a font. This function does not create a copy of the font. It just ass...
GetFaceAttrib(TOpenFontFaceAttrib &)const
Gets the typeface attributes of Open Font System fonts. Notes: Typeface attribut...
GetFontMetrics(TOpenFontMetrics &)const
Gets the open font metrics. If the metrics cannot be obtained the function retur...
Handle()const
Gets the Font and Bitmap server handle of the font.
HasCharacter(TInt)const
Tests whether the font contains a particular character.
IsOpenFont()const
Tests whether the font is an Open Font system font. Note: If this function retur...
RawTextWidthInPixels(const TDesC &)const
Gets the raw width of the text in the descriptor, in pixels. DEPRECATED: Same as...
Reset()
TextWidthInPixels(const TDesC &)const
Gets the width of the specified descriptor when displayed in this font, in pixel...
TextWidthInPixels(const TDesC &,SCharWidth &)const
Gets the text width, move and adjusts of the specified descriptor when displayed...
iAddressPointer
iFbs
iHandle
iServerHandle
~CFbsFont()
Inherited from CBase
:
Inherited from CFont
:
AscentInPixels()const
Gets the font ascent in pixels. Note that this deprecated function is replaced b...
BaselineOffsetInPixels()const
Gets the baseline offset in pixels.
CharWidthInPixels(TChar)const
Gets the width in pixels in this font of the specified character.
CharactersJoin(TInt,TInt)
Determines if aLeftCharacter and aRightCharacter affect each other's contextual ...
DescentInPixels()const
Gets the font descent in pixels. Note that this deprecated function is replaced ...
EAllCharacterData
All character data is available.
ECharacterWidthOnly
Width information only is available.
EHorizontal
Text is drawn horizontally.
ENoCharacterData
No font information available.
EVertical
Text is drawn vertically.
ExtendedFunction(TUid,TAny *)const
Enables the caller to access a particular API extension function. N.B. Any overl...
FontCapitalAscent()const
Gets the ascent of an ANSI capital letter in the font whether or not there are a...
FontLineGap()const
Gets the suggested line gap for the font. This is the recommended baseline to ba...
FontMaxAscent()const
Gets the max ascent of any pre-composed glyph in the font. This will include acc...
FontMaxDescent()const
Gets the max descent of any pre-composed glyph in the font. This will include ac...
FontMaxHeight()const
Gets the (positive) maximum height in pixels of the font. This may differ from t...
FontSpecInTwips()const
Gets the font specification of this font in twips.
FontStandardDescent()const
Gets the descent of an ANSI descending character in the font. Whether or not the...
GetCharacterData(TUint,TOpenFontCharMetrics &,const TUint8 *&,TSize &)const
Gets the character metrics for a character.
GetCharacterPosition2(TPositionParam &,RShapeInfo &)const
Takes Unicode text and produces the glyph cluster for the first character in tha...
HeightInPixels()const
Gets the font height in pixels. Note that this deprecated function is replaced b...
MaxCharWidthInPixels()const
Gets the width in pixels of the widest character in this font.
MaxNormalCharWidthInPixels()const
Gets the width in pixels of the widest normal character in this font.
MeasureText(const TDesC &,const TMeasureTextInput *,TMeasureTextOutput *)const
Text measurement function.
TCharacterDataAvailability
Data availability flags.
TMeasureTextInput
Input parameter block.
TMeasureTextOutput
Output parameter block.
TPositionParam
Complicated parameter block used for contextual glyph selection, ligature creati...
TTextDirection
Text direction flags.
TextCount(const TDesC &,TInt)const
Gets how much of the specified descriptor can be displayed in this font without ...
TextCount(const TDesC &,TInt,TInt &)const
Gets how much of the specified descriptor can be displayed in this font without ...
TypeUid()const
Gets run-time identity of the actual font type. This enables safe casting to a d...
WidthZeroInPixels()const
Gets the width of the zero character of this font in pixels.
See also:
Construction and destruction
protected: IMPORT_C CFbsFont();
Description
protected: IMPORT_C ~CFbsFont();
Description
CFbsFont(const CFbsFont &)
protected: IMPORT_C CFbsFont(const CFbsFont &aFont);
Description
Parameters
private: inline virtual TUid DoTypeUid() const;
Description
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()const
returns KCFbsFontUid.
Return value
TUid
|
The font's UID. This should be KCFbsFontUid.
|
|
See also:
private: IMPORT_C virtual TInt DoHeightInPixels() const;
Description
Gets the font height in pixels.
Return value
TInt
|
The font height in pixels.
|
|
See also:
private: IMPORT_C virtual TInt DoAscentInPixels() const;
Description
Gets the font ascent in pixels.
Return value
TInt
|
The font ascent in pixels.
|
|
See also:
DoCharWidthInPixels(TChar)const
private: IMPORT_C virtual TInt DoCharWidthInPixels(TChar aChar) const;
Description
Gets the width of the specified character in this font, in pixels.
Parameters
TChar aChar |
The character whose width should be determined.
|
|
Return value
TInt
|
The width of the specified character in this font, in pixels.
|
|
See also:
DoTextWidthInPixels(const TDesC &)const
private: IMPORT_C virtual TInt DoTextWidthInPixels(const TDesC &aText) const;
Description
Gets the width of the specified descriptor when displayed in this font, in pixels.
Parameters
const TDesC16 &aText |
The descriptor whose width should be determined.
|
|
Return value
TInt
|
The width of the specified descriptor when displayed in this font, in pixels
|
|
See also:
DoBaselineOffsetInPixels()const
private: IMPORT_C virtual TInt DoBaselineOffsetInPixels() const;
Description
Gets the baseline offset, in pixels. The offset is how far a font is raised or lowered from its normal baseline.
Return value
TInt
|
Offset from normal baseline, in pixels.
|
|
See also:
DoTextCount(const TDesC &,TInt)const
private: IMPORT_C virtual TInt DoTextCount(const TDesC &aText, TInt aWidthInPixels) const;
Description
Gets how much of the specified descriptor can be displayed in this font 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.
Parameters
const TDesC16 &aText |
The descriptor.
|
TInt aWidthInPixels |
The available width for character display
|
|
Return value
TInt
|
The number of characters (starting from the beginning of the descriptor) which will be able to be displayed without exceeding
the specified width.
|
|
See also:
DoTextCount(const TDesC &,TInt,TInt &)const
private: IMPORT_C virtual TInt DoTextCount(const TDesC &aText, TInt aWidthInPixels, TInt &aExcessWidthInPixels) const;
Description
Gets how much of the specified descriptor can be displayed in this font 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.
Parameters
const TDesC16 &aText |
The descriptor.
|
TInt aWidthInPixels |
The available width for character display.
|
TInt &aExcessWidthInPixels |
The excess width after displaying the portion of the descriptor, in pixels.
|
|
Return value
TInt
|
The number of characters (starting from the beginning of the descriptor) which will be able to be displayed without exceeding
the specified width.
|
|
See also:
DoMaxCharWidthInPixels()const
private: IMPORT_C virtual TInt DoMaxCharWidthInPixels() const;
Description
Gets the width of the widest character in this font, in pixels.
Return value
TInt
|
The width of the maximum width character, in pixels.
|
|
See also:
DoMaxNormalCharWidthInPixels()const
private: IMPORT_C virtual TInt DoMaxNormalCharWidthInPixels() const;
Description
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).
Return value
TInt
|
The width of the maximum width normal character, in pixels.
|
|
See also:
private: IMPORT_C virtual TFontSpec DoFontSpecInTwips() const;
Description
Gets the font specification of this font in twips.
Return value
TFontSpec
|
The font specification of this font (in twips).
|
|
See also:
DoGetCharacterData(TUint,TOpenFontCharMetrics &,const TUint8 *&,TSize &)const
private: IMPORT_C virtual CFont::TCharacterDataAvailability DoGetCharacterData(TUint aCode, TOpenFontCharMetrics &aMetrics,
const TUint8 *&aBitmap, TSize &aBitmapSize) const;
Description
Gets the character metrics and the glyph bitmap.
Parameters
TUint aCode |
The character code in Unicode.
|
TOpenFontCharMetrics &aMetrics |
On return, contains the character metrics.
|
const TUint8 *&aBitmap |
On return, contains a pointer to the compressed glyph bitmap.
|
TSize &aBitmapSize |
The size of the returned glyph bitmap in pixels. This is not necessarily the same as the size implied by the returned metrics,
which may incorporate algorithmic multiplication.
|
|
Return value
GetFontMetrics(TOpenFontMetrics &)const
IMPORT_C TBool GetFontMetrics(TOpenFontMetrics &aMetrics) const;
Description
Gets the open font metrics. If the metrics cannot be obtained the function returns EFalse.
Parameters
TOpenFontMetrics &aMetrics |
On return, contains the font metrics
|
|
Return value
TBool
|
EFalse if the metrics cannot be obtained
|
|
TextWidthInPixels(const TDesC &)const
IMPORT_C TInt TextWidthInPixels(const TDesC &aText) const;
Description
Gets the width of the specified descriptor when displayed in this font, in pixels. Override of the base class to resolve name
clash with other TextWidthInPixels variant.
Parameters
const TDesC16 &aText |
The descriptor whose width should be determined.
|
|
Return value
TInt
|
The width of the specified descriptor when displayed in this font, in pixels
|
|
See also:
TextWidthInPixels(const TDesC &,SCharWidth &)const
IMPORT_C void TextWidthInPixels(const TDesC &aText, SCharWidth &aCharWidth) const;
Description
Gets the text width, move and adjusts of the specified descriptor when displayed in this font.
Parameters
const TDesC16 &aText |
The descriptor whose width should be determined.
|
SCharWidth &aCharWidth |
The width of the specified descriptor when displayed in this font, in pixels (including information on the width, move and
adjusts of the descriptor).
|
|
IMPORT_C TInt Handle() const;
Description
Gets the Font and Bitmap server handle of the font.
Return value
TInt
|
The handle of the font.
|
|
RawTextWidthInPixels(const TDesC &)const
Interface status: |
deprecated |
|
IMPORT_C TInt RawTextWidthInPixels(const TDesC &aText) const;
Description
Gets the raw width of the text in the descriptor, in pixels. DEPRECATED: Same as MeasureText(const TDesC&). This is the width
of the text without adjusting for side bearings, algorithmic style etc.
Parameters
const TDesC16 &aText |
Any text descriptor (TPtrC, TPtr, _LIT, TBuf etc.).
|
|
Return value
TInt
|
The width (in pixels) of the text in the descriptor.
|
|
GetFaceAttrib(TOpenFontFaceAttrib &)const
IMPORT_C TBool GetFaceAttrib(TOpenFontFaceAttrib &aAttrib) const;
Description
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 CFbsFont::IsOpenFont()const
returns true i.e. the font is an Open Font.
Parameters
TOpenFontFaceAttrib &aAttrib |
On return, contains the typeface attributes.
|
|
Return value
IMPORT_C TBool IsOpenFont() const;
Description
Tests whether the font is an Open Font system font. Note: If this function returns ETrue, the function CFbsFont::GetFaceAttrib(TOpenFontFaceAttrib &)const
will work.
Return value
TBool
|
ETrue if font is an Open Font system font (e.g. TrueType). EFalse if the font is a bitmap font loaded from a GDR file.
|
|
IMPORT_C TBool HasCharacter(TInt aCode) const;
Description
Tests whether the font contains a particular character.
Parameters
TInt aCode |
Character code to be tested. This code is in the code page 1252 encoding in v5, otherwise it is in Unicode
|
|
Return value
TBool
|
ETrue if the font contains aCode.
|
|
protected: IMPORT_C CBitmapFont* Address() const;
Description
Return value
protected: IMPORT_C TInt Duplicate(TInt aHandle);
Description
Duplicates a font. This function does not create a copy of the font. It just assigns another handle to the bitmap in the font
and bitmap server, and sets this object's handle to that.
Parameters
TInt aHandle |
The handle to an existing CFbsFont.
|
|
Return value
TInt
|
KErrNone if successful; KErrCouldNotConnect if no connection to the font and bitmap server could be made; KErrUnknown if no
font could be found with the specified handle number.
|
|
protected: IMPORT_C void Reset();
Description
protected: RFbsSession * iFbs;
Description
protected: CBitmapFont * iAddressPointer;
Description
protected: TInt iHandle;
Description
protected: TInt iServerHandle;
Description