#include <fntstore.h>
class CBitmapFont : public CFont |
Public Attributes | |
---|---|
TAlgStyle | iAlgStyle |
Public Member Functions | |
---|---|
IMPORT_C TInt | BitmapEncoding() |
IMPORT_C TCharacterMetrics | CharacterMetrics(TInt, const TUint8 *&) |
IMPORT_C TBool | CharacterNeedsToBeRasterized(TInt, TInt) |
IMPORT_C void | DeleteShape(TInt, TShapeHeader *) |
IMPORT_C TBool | GetCharacterData(TInt, TInt, TOpenFontCharMetrics &, const TUint8 *&) |
IMPORT_C TBool | GetFaceAttrib(TOpenFontFaceAttrib &) |
IMPORT_C void | GetFontMetrics(TOpenFontMetrics &) |
TGlyphBitmapType | GlyphBitmapType() |
IMPORT_C TBool | HasCharacterL(TInt) |
TBool | IsOpenFont() |
COpenFont * | OpenFont() |
IMPORT_C TBool | Rasterize(TInt, TInt, TOpenFontGlyphData *) |
IMPORT_C TShapeHeader * | ShapeTextL(const TDesC16 &, TInt, const TShapeMessageParameters &) |
TUid | Uid() |
IMPORT_C TUint32 | UniqueFontId() |
IMPORT_C void | operator delete(TAny *) |
Inherited Enumerations | |
---|---|
CFont:TCharacterDataAvailability | |
CFont:TTextDirection |
Bitmap font class. An object of this class may either access and use a bitmap font (a CFontBitmap) or an open font (a COpenFont). Stored in a CFontStore.
IMPORT_C TInt | BitmapEncoding | ( | ) | const |
Gets encoding if a bitmap font (a CFontBitmap) is used.
Returns: Bitmap encoding value.
IMPORT_C TCharacterMetrics | CharacterMetrics | ( | TInt | aCode, |
const TUint8 *& | aBytes | |||
) | const |
Gets a pointer to a bitmap and the metrics for a specified character, but only if a CFontBitmap is being used by the bitmap font object.
This function does not work when a COpenFont is being used, but GetCharacterData() can be used instead.
If the specified character does not exist in the font then the bitmap pointer and character metrics are gotten for a replacement character, KReplacementCharacter.
Parameter | Description |
---|---|
aCode | A character code. |
aBytes | On return, a pointer to the bitmap for the specified character. |
Returns: Metrics for the specified character.
Gets whether the specified character needs to be rasterised.
False is returned if it is a bitmap font (a CFontBitmap) being used by the bitmap font object (so no rasterization is required) or if is an open font (a COpenFont) and the character has been rasterized.
Parameter | Description |
---|---|
aSessionHandle | A session handle for the open font system. |
aCode | A character code. |
Returns: ETrue if the character needs to be rasterized; otherwise EFalse.
IMPORT_C void | DeleteShape | ( | TInt | aSessionHandle, |
TShapeHeader * | aHeader | |||
) |
Frees the memory taken up as a result of shaping
IMPORT_C TBool | GetCharacterData | ( | TInt | aSessionHandle, |
TInt | aCode, | |||
TOpenFontCharMetrics & | aMetrics, | |||
const TUint8 *& | aBitmap | |||
) | const |
Gets a pointer to a bitmap and the metrics for a specified character.
Note that this function calls CharacterMetrics() if a CFontBitmap is being used by the bitmap font object, and maps the TCharacterMetrics values returned by that function to aMetrics.
If the function fails to get the bitmap and metric values (because the character is in an open font and has not yet been rasterized) returns EFalse.
Parameter | Description |
---|---|
aSessionHandle | A session handle for the open font system. |
aCode | A character code. |
aMetrics | On return, metrics for the specified character. |
aBitmap | On return, a pointer to the bitmap for the specified character. |
Returns: ETrue if successful, otherwise EFalse.
IMPORT_C TBool | GetFaceAttrib | ( | TOpenFontFaceAttrib & | aAttrib | ) | const |
Gets the open font typeface attributes if possible.
At present no attempt is made to sythesize these attributes for bitmap fonts (CFontBitmaps).
Parameter | Description |
---|---|
aAttrib | On return, the open font typeface attributes. |
Returns: ETrue if successful; EFalse if not possible to get the open font typeface attributes.
IMPORT_C void | GetFontMetrics | ( | TOpenFontMetrics & | aMetrics | ) | const |
Gets the open font metrics.
These metrics distinguish between maximum character height and depth and typographic ascent and descent, so that the clipping rectangle for text can be distinguished from the distance to neighbouring baselines.
Parameter | Description |
---|---|
aMetrics | Open font metrics. |
TGlyphBitmapType | GlyphBitmapType | ( | ) | const [inline] |
Gets the anti-aliasing setting for the font, see TGlyphBitmapType for the range of values.
This is only applicable to open fonts (COpenFonts) not bitmap fonts (CBitmapFonts).
Note that this setting is stored in the device-independent font specification which is set when the bitmap font object is constructed.
See also: IsOpenFont() TGlyphBitmapType COpenFont CBitmapFont
Returns: The anti-aliasing setting for the font.
TBool | IsOpenFont | ( | ) | const [inline] |
Returns whether the bitmap font object is an open font (a COpenFont) rather than a bitmap font (a CFontBitmap).
See also: OpenFont()
Returns: ETrue if the bitmap font object is using an open font (a COpenFont); EFalse if it is using a bitmap font (a CFontBitmap).
COpenFont * | OpenFont | ( | ) | const [inline] |
Returns a pointer to the open font being used by the bitmap font object.
See also: IsOpenFont()
Returns: A pointer to an open font.
IMPORT_C TBool | Rasterize | ( | TInt | aSessionHandle, |
TInt | aCode, | |||
TOpenFontGlyphData * | aGlyphData | |||
) | const |
Attempts to rasterize a character (aCode) into a data area (aGlyphData) in shared memory.
This works only for open fonts: where the bitmap font object is using a COpenFont.
Bitmap fonts are deemed to be fully rasterized after they have been loaded from file.
Returns ETrue if the character was successfully rasterized or was already in the cache. This function can be called only by the server; rasterization uses memory and other resources (e.g., file handles) owned by the server.
Parameter | Description |
---|---|
aSessionHandle | A session handle for the open font system. |
aCode | A character code. |
aGlyphData | A data area in shared memory. |
Returns: ETrue if the character was successfully rasterized or was already in the cache; otherwise EFalse.
IMPORT_C TShapeHeader * | ShapeTextL | ( | const TDesC16 & | aText, |
TInt | aSessionHandle, | |||
const TShapeMessageParameters & | aParams | |||
) |
Turns text into glyph codes and positions.
Parameter | Description |
---|---|
aText | The Unicode text to shape plus context |
Returns: The output shape header from the per-font cache, or 0 on failure.
TUid | Uid | ( | ) | const |
Returns a font identifier.
If it uses an open font the UID returned has a value of zero. Otherwise it has the UID value of the CFontBitmap it uses.
Returns: A font identifier.