Location:
OPENFONT.H
Link against: fntstr.lib
class TOpenFontSpec : public TOpenFontFaceAttribBase;
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.
TOpenFontFaceAttribBase
- Font attribute base class
TOpenFontSpec
- Font specification allowing more attributes to be specified than
Defined in TOpenFontSpec
:
BitmapType()
, CompensateForAspectRatio()
, CompensateForAspectRatio()
, GetTFontSpec()
, Height()
, PrintPosition()
, SetAttrib()
, SetBitmapType()
, SetHeight()
, SetScriptTypeForMetrics()
, SetSlantFactor()
, SetWidthFactor()
, SlantFactor()
, TOpenFontSpec()
, TOpenFontSpec()
, WidthFactor()
, operator=()
, operator==()
Inherited from TOpenFontFaceAttribBase
:
Coverage()
,
EArabicSet
,
EArmenianSet
,
EBengaliSet
,
EBold
,
ECJKSet
,
ECyrillicSet
,
EDevanagariSet
,
EGeorgianSet
,
EGreekSet
,
EGujuratiSet
,
EGurmukhiSet
,
EHangulJamoSet
,
EHangulSet
,
EHebrewSet
,
EItalic
,
EKanaSets
,
EKannadaSet
,
ELaoSet
,
ELatinSet
,
EMalayalamSet
,
EMonoWidth
,
ENameLength
,
EOriyaSet
,
ESerif
,
ESymbolSets
,
ETamilSet
,
ETeluguSet
,
EThaiSet
,
HasCJK()
,
HasCyrillic()
,
HasGreek()
,
HasHangul()
,
HasKana()
,
HasLatin()
,
IsBold()
,
IsItalic()
,
IsMonoWidth()
,
IsSerif()
,
IsSymbol()
,
Name()
,
SetBold()
,
SetCoverage()
,
SetItalic()
,
SetMonoWidth()
,
SetName()
,
SetSerif()
,
anonymous
,
iCoverage
,
iName
,
iReserved
,
iStyle
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.
IMPORT_C TOpenFontSpec(const TFontSpec &aFontSpec);
C++ constructor taking a reference to a TFontSpec
.
This object's members are initialised from the values of the aFontSpec parameter.
|
IMPORT_C void operator=(const TFontSpec &aFontSpec);
Assignment operator.
|
inline TBool operator==(const TOpenFontSpec &aFontSpec) const;
Compares this and another open font specification. Compares all the properties of the two fonts.
|
|
IMPORT_C void SetAttrib(const TOpenFontFaceAttribBase &aAttrib);
Sets the font attributes.
|
IMPORT_C void GetTFontSpec(TFontSpec &aFontSpec) const;
Gets the TFontSpec
corresponding to this Open Font System font specification.
|
IMPORT_C void CompensateForAspectRatio(TInt aPixelWidth, TInt aPixelHeight);
Adjust the width factor and slant factor to suit a pixel aspect ratio.
|
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.
|
inline TInt Height() const;
Gets the height of the font.
|
inline TInt32 WidthFactor() const;
Gets the algorithmic width factor.
|
inline TInt32 SlantFactor() const;
Gets the algorithmic slant factor.
|
inline TGlyphBitmapType BitmapType() const;
Gets the anti-aliasing setting for the font, as set by SetBitmapType()
.
|
inline TFontPrintPosition PrintPosition() const;
Gets the print position.
|
inline void SetHeight(TInt aHeight);
Sets the font's height.
|
inline void SetWidthFactor(TInt32 aWidthFactor);
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.
|
inline void SetSlantFactor(TInt32 aSlantFactor);
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.
|
inline void SetBitmapType(TGlyphBitmapType aBitmapType);
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.
|
IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);
Specifies the script with which font metrics calculation will be based on.
|