#include <openfont.h>
class TOpenFontSpec : public TOpenFontFaceAttribBase |
Public Member Enumerations | |
---|---|
enum | anonymous { EAlgorithmicBold, EDropShadow, EOutline } |
Public Member Functions | |
---|---|
TOpenFontSpec() | |
TOpenFontSpec(const TFontSpec &) | |
TInt | ApplyRatio(TInt &, TInt, TInt) |
TInt | ApplyRatio(TInt32 &, TInt, TInt) |
TGlyphBitmapType | BitmapType() |
IMPORT_C void | CompensateForAspectRatio(TInt, TInt) |
IMPORT_C void | CompensateForAspectRatio(const MGraphicsDeviceMap &) |
TUint32 | Effects() |
IMPORT_C void | GetTFontSpec(TFontSpec &) |
TInt | Height() |
TBool | IsCompensationForAspectRatioNeeded(TInt, TInt) |
IMPORT_C TBool | IsEffectOn(FontEffect::TEffect) |
TFontPrintPosition | PrintPosition() |
IMPORT_C TInt | ScriptTypeForMetrics() |
IMPORT_C void | SetAttrib(const TOpenFontFaceAttribBase &) |
void | SetBitmapType(TGlyphBitmapType) |
void | SetEffects(TUint32) |
IMPORT_C void | SetEffects(FontEffect::TEffect, TBool) |
void | SetHeight(TInt) |
IMPORT_C void | SetScriptTypeForMetrics(TLanguage) |
void | SetSlantFactor(TInt32) |
void | SetWidthFactor(TInt32) |
TInt32 | SlantFactor() |
TInt32 | WidthFactor() |
TBool | operator!=(const TOpenFontSpec &) |
IMPORT_C void | operator=(const TFontSpec &) |
TBool | operator==(const TOpenFontSpec &) |
Inherited Attributes | |
---|---|
TOpenFontFaceAttribBase::iCoverage | |
TOpenFontFaceAttribBase::iName | |
TOpenFontFaceAttribBase::iReserved | |
TOpenFontFaceAttribBase::iStyle |
Font specification allowing more attributes to be specified than TFontSpec.
In addition to the attributes specified by TFontSpec, this font specification allows stretching and slanting in the x dimension, and other algorithmic effects. This is used to correct for non-square pixels, and to allow algorithmic slanting and bold. The width factor and slant factor transform any point (x,y) to (x iWidthFactor + y * iSlantFactor,y). The width and slant factors are 16.16 fixed-point numbers.
The font specification also provides access to information about the scripts which are supported by the font. This information is not always reliable, because it may be incorrectly specified, or not specified at all, by some font manufacturers.
Algorithmic effects flags.
These can be combined using an OR operation.
WARNING: Enum for internal and partner use ONLY. Compatibility is not guaranteed in future releases.
DeprecatedUse FontEffect::TEffect instead.
IMPORT_C | TOpenFontSpec | ( | ) |
Default C++ constructor setting height to 16 pixels or twips, width factor to 1 (65536 in 16.16 format), slant factor to 0 (no slant), effects to ENone, symbol to 0 (assuming EScriptNone = 0), print position to EPrintPosNormal.
TGlyphBitmapType | BitmapType | ( | ) | const [inline] |
Gets the anti-aliasing setting for the font, as set by SetBitmapType().
Returns: Indicates whether or not the font should be drawn using anti-aliasing.
IMPORT_C void | CompensateForAspectRatio | ( | const MGraphicsDeviceMap & | aMap | ) |
Adjust the width factor and slant factor to suit a pixel aspect ratio stored in a MGraphicsDeviceMap derived object.
Parameter | Description |
---|---|
aMap | The MGraphicsDeviceMap defining the pixel aspect ratio. |
TUint32 | Effects | ( | ) | const [inline] |
Gets the font effects flags. Because the flags encoded in the Effects are anonymous, the return value should only be tested for the specific bits that are of interest, and never tested as a whole.
See also: TOpenFontSpec::SetEffects()
Returns: The font effects flags.
TInt | Height | ( | ) | const [inline] |
Gets the height of the font.
See also: SetHeight()
Returns: The height of the font, in pixels or twips.
IMPORT_C TBool | IsEffectOn | ( | FontEffect::TEffect | aEffect | ) | const |
Checks if a font effect is on.
See also: TOpenFontSpec::SetEffects()
Parameter | Description |
---|---|
aEffect | The font effect to be checked. |
Returns: True represents the specified font effect is on, otherwise off.
TFontPrintPosition | PrintPosition | ( | ) | const [inline] |
Gets the print position.
Returns: The print position.
IMPORT_C TInt | ScriptTypeForMetrics | ( | ) | const |
Gets the script which the font metrics calculation will be based on.
Returns: The script.
IMPORT_C void | SetAttrib | ( | const TOpenFontFaceAttribBase & | aAttrib | ) |
Sets the font attributes.
Parameter | Description |
---|---|
aAttrib | The font attributes. |
void | SetBitmapType | ( | TGlyphBitmapType | aBitmapType | ) | [inline] |
Sets whether the font should be drawn using anti-aliasing. If set, this value overrides the default setting (set by CFbsTypefaceStore::SetDefaultBitmapType()) for this font.
Anti-aliasing can only be used for scalable fonts. There is currently no anti-aliasing support for bitmapped fonts.
Parameter | Description |
---|---|
aBitmapType | Indicates whether or not the font should be drawn using anti-aliasing. |
void | SetEffects | ( | TUint32 | aEffects | ) | [inline] |
Sets the font effects flags. Prior to calling this routine, the value from Effects() should be read, and its flags modified as required, before passing them back in.
See also: TOpenFontSpec::Effects()
IMPORT_C void | SetEffects | ( | FontEffect::TEffect | aEffect, |
TBool | aOn | |||
) |
Sets a font effect to the given state.
See also: TOpenFontSpec::IsEffectOn()
Parameter | Description |
---|---|
aEffect | The font effect to be set. |
aOn | True represents on, otherwise off. |
IMPORT_C void | SetScriptTypeForMetrics | ( | TLanguage | aLanguage | ) |
Specifies the script which font metrics calculation will be based on.
Parameter | Description |
---|---|
aLanguage | The language used to derive the required script. |
void | SetSlantFactor | ( | TInt32 | aSlantFactor | ) | [inline] |
Sets the algorithmic slant factor.
Note: The slant factor is used to create an italic effect for characters which do not have an italic glyph in the typeface. When slanting is active, pixel x co-ordinates are shifted by a factor relative to the y co-ordinate (i.e. x = x + y x slant factor).
The slant factor is a 32 bit, 16.16 fixed-point number. This means that the first 16 bits are treated as a whole number, and the second 16 as the fractional part. e.g. if aSlantFactor=0, there is no slant. If aSlantFactor=65536 this is equivalent to an integer slant value of 1, which causes a 45 degree slant on the character.
See also: SlantFactor()
Parameter | Description |
---|---|
aSlantFactor | The slant factor as a 16.16 fixed-point number. |
void | SetWidthFactor | ( | TInt32 | aWidthFactor | ) | [inline] |
Sets the algorithmic width factor.
The width factor is multiplied by the pixel's x position to get the new position, causing characters to become wider or narrower. A width factor of 1 (65536 in 16.16 fixed-point number format) should be used if the character width is not to be changed.
See also: WidthFactor()
Parameter | Description |
---|---|
aWidthFactor | The algorithmic width factor as a 16.16 fixed-point number. |
TInt32 | SlantFactor | ( | ) | const [inline] |
Gets the algorithmic slant factor.
See also: SetSlantFactor()
Returns: The algorithmic slant factor as a 16.16 fixed-point number.
TInt32 | WidthFactor | ( | ) | const [inline] |
Gets the algorithmic width factor.
See also: SetWidthFactor()
Returns: The algorithmic width factor as a 16.16 fixed-point number.
IMPORT_C void | operator= | ( | const TFontSpec & | aFontSpec | ) |
Assignment operator.
Parameter | Description |
---|---|
aFontSpec | The old-style font specification to copy into this font specification. |
TBool | operator== | ( | const TOpenFontSpec & | aFontSpec | ) | const [inline] |
Compares this and another open font specification. Compares all the properties of the two fonts.
Parameter | Description |
---|---|
aFontSpec | The open font specification to compare with this one. |
Returns: ETrue if all values are equal, EFalse if not.