TAknFontSpecification Class Reference

#include <mw/AknFontSpecification.h>

Link against: FontUtils.lib

class TAknFontSpecification

Detailed Description

Object representing the series 60 requirements for a font. It contains information from the layout specification that fonts bound to the given font id should honor.

It formst the basis of the request to font provisioning to provide a suitable font

Since
2.8

Member Enumeration Documentation

Enum TAknFontSpecificationUnits

EnumeratorValueDescription
EPixels0
ETwips

Constructor & Destructor Documentation

TAknFontSpecification ( TInt )

IMPORT_CTAknFontSpecification(TIntaFontId)

Construct font specification from Font ID.

Parameters
aFontIdSeries 60 font id from which to create a font.

TAknFontSpecification ( TAknFontCategory, const TFontSpec &, const MGraphicsDeviceMap * )

IMPORT_CTAknFontSpecification(TAknFontCategoryaCategory,
const TFontSpec &aFontSpec,
const MGraphicsDeviceMap *aDeviceMap
)

Construct the font specifiation from Symbian OS TFontSpec and MGraphicsDeviceMap The Symbian OS TFontSpec must be set in Twips. The MGraphicsDeviceMap is used to convert to pixels for the text pane height.

Note that the units policy during and in effect at the end of this constructor is EPixels.

Note that the TTypeface part of the TFontSpec is lost in this construction

Parameters
aCategorySeries 60 Font category to use
aFontSpecProvides the metrics and Style information to use for the match
aDeviceMapDevice map used to convert the aFontSpec's twips to pixels

Member Function Documentation

BitmapType ( )

IMPORT_C TGlyphBitmapTypeBitmapType()const

Accessor for the requested bitmap type

Since
S^3 PS2
Return Value
Symbian OS glyph bitmap type (e.g. EAntialiasedGlyphBitmap)

ExactMatchRequired ( )

IMPORT_C TBoolExactMatchRequired()const

Accessor API for whether an exact match is required for the font (See SetExactMatchRequired() )

Return Value
whether an exact match is required or not.

FontCategory ( )

IMPORT_C TAknFontCategoryFontCategory()const

Series 60 Layout Specification font category: Primary, Secondary, Title etc.

Return Value
Series 60 font category

IsOutlineEffectOn ( )

IMPORT_C TBoolIsOutlineEffectOn()const

Accessor for the requested outline effect

Since
5.0
Return Value
ETrue iff outline font effect has been requested

Posture ( )

IMPORT_C TFontPosturePosture()const

Accessor for the requested posture

Return Value
Symbian OS font posture enumeration (e.g. EPostureItalic)

SetBitmapType ( TGlyphBitmapType )

IMPORT_C voidSetBitmapType(TGlyphBitmapTypeaBitmapType)
Sets the glyph bitmap type (e.g. monochrome, antialiased) of requested font using the Symbian OS enumeration.
Since
S^3 PS2
Parameters
aBitmapTypebitmap type to request

SetExactMatchRequired ( TBool )

IMPORT_C voidSetExactMatchRequired(TBoolaRequiresExactMatch)
Sets a flag indicating to font requests whether they should insist upon an exact match. Whether a font match is treated as exact or not depends upon various things, including:
  • if a request is made via a generic font family or via a font family enumeration, then typeface is not tested for "exactness"

  • fonts may be forced to be rendered at certain sizes (within a small number of pixels). This still counts as an exact match

The default value upon construction is EFalse;

SetFontCategory ( TAknFontCategory )

IMPORT_C voidSetFontCategory(TAknFontCategoryaCategory)

Sets the Series 60 font category.

Parameters
aCategoryNew category to set.

SetPosture ( TFontPosture )

IMPORT_C voidSetPosture(TFontPostureaPosture)

Sets the posture (e.g. upright, italic) of requested font using the Symbian OS enumeration.

SetTextPaneHeight ( TInt )

IMPORT_C voidSetTextPaneHeight(TIntaNewHeight)

The requested height for a font. This represents the maximum vertical range that can be guraranteed to draw in the text pane.

Note also that this value is the height requested by layout or the client, and might not correspond to the design height, ascent + descent, or max height reported by the attached font. See the APIs CAknLayoutFont::TextPaneTopToBaseline and BaselineToTextPaneBottom.

If TextPaneHeightIsDesignHeight() is EFalse, then the font will be requested to fit entirely within this range.

If TextPaneHeightIsDesignHeight() is set, then this value is passed to the font request as the font design height, in which case the font may not render entirely within the "text pane height".

Parameters
aNewHeightText pane height to be used by the font.

SetTextPaneHeightIsDesignHeight ( TBool )

IMPORT_C voidSetTextPaneHeightIsDesignHeight(TBoolaTextPaneHeightIsDesignHeight)

Sets the policy to use in requesting the font height. Fonts may be requested either by "design height" (which is usually approximately the ascent + descent) or by maximum height. If false, this setting means the number set by SetTextPaneHeight is intended to match the font's maximum extent; all characters will fit within the text pane. If true, then the value passed by SetTextPaneHeight will be used to request design height.

This API has no effect if called on a TAknFontSpecification that has already been bound to a font

The default value upon construction is EFalse.

Parameters
aTextPaneHeightIsDesignHeightIf EFalse, ensure that the font fits entirely within the text pane height If not EFalse, then the text pane height is treated as the font design height.

SetUnits ( TAknFontSpecification::TAknFontSpecificationUnits )

Sets the units for the Text Pane Height APIs. Note that calling this API does not result in the numerical value of the text pane height being recalculated. Upon construction, TAknFontSpecification objects store TextPaneHeight in pixels. If you then call SetUnits to Twips, you will also have to call SetTextPaneHeight to pass in the new (twips) value.

SetWeight ( TFontStrokeWeight )

IMPORT_C voidSetWeight(TFontStrokeWeightaWeight)

Set the stoke weight to request using the Symbian OS stroke weight enumeration.

aWeight The stroke weight.

TextPaneHeight ( )

IMPORT_C TIntTextPaneHeight()const

The requested height of the font. This represents the maximum vertical range that can be guaranteed to draw in the text pane.

Note also that this value is the height requested by layout or the client, and may not correspond to the design height, ascent + descent, or max height reported by the attached font. See the APIs CAknLayoutFont::TextPaneTopToBaseline and BaselineToTextPaneBottom.

If TextPaneHeightIsDesignHeight() is EFalse, then the font is to be requested to fit entirely within this range.

If TextPaneHeightIsDesignHeight() is set, then this value is passed to the font request as the font design height, in which case the font may not render entirely within the "text pane height".

Depending upon the value of TextPaneHeightIsInTwips(), the value returned is in Pixels or Twips. Note that calling SetTextPaneHeightIsInTwips() does not perform any conversion of the text pane height; It retains its set value.

Return Value
Requested text pane height.

TextPaneIsDesignHeight ( )

IMPORT_C TBoolTextPaneIsDesignHeight()const

Accessor API for the height policy.

Return Value
EFalse if text pane height is to be the maximum font extent. ETrue if text pane height is to be treated as the font's design height

Units ( )

Accessor API for the units being used.

Return Value
units currently being used.

Weight ( )

IMPORT_C TFontStrokeWeightWeight()const

Accessor for the requested weight

Return Value
Symbian OS stroke weight enumeration (e.g. EStrokeWeightBold)