Location: openfont.h
Link against: fntstr.lib
TOpenFontSpec
Supported from 5.0
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.
|
Defined in TOpenFontSpec
:
Anonymous
, CompensateForAspectRatio()
, EAlgorithmicBold
, EDropShadow
, EOutline
, Effects()
, GetTFontSpec()
, Height()
, PrintPosition()
, SetAttrib()
, SetEffects()
, SetHeight()
, SetSlantFactor()
, SetWidthFactor()
, SlantFactor()
, TOpenFontSpec()
, WidthFactor()
, 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()
,
operator==()
TOpenFontSpec();
Default C++ constructor.
Sets the height to 16,
width factor to 1 (65536 in 16.16 format),
slant factor to 0 (no slant),
effects to 0, symbol to FALSE, and print position to EPrintPosNormal
.
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.
|
void CompensateForAspectRatio(TInt aKPixelWidth,TInt aKPixelHeight);
Adjust the width factor and slant factor to suit a pixel aspect ratio.
Notes:
The pixel width and height are only used to derive a ratio, and so can be in any units.
Aspect ratios differing by less than 1/1000 are treated as 1:1.
|
void CompensateForAspectRatio(const MGraphicsDeviceMap& aMap);
Adjust the width factor and slant factor to suit a pixel aspect ratio stored in a MGraphicsDeviceMap
derived object.
|
TUint32 Effects() const;
Gets the algorithmic effects flags.
This is the logical ORing of values in this class's anonymous enum — e.g. EAlgorithmicBold
.
|
void GetTFontSpec(TFontSpec& aFontSpec) const;
Gets the TFontSpec
corresponding to this Open Font System font specification.
|
TInt Height() const;
Gets the height of the font.
|
TFontPrintPosition PrintPosition() const;
Gets the print position.
|
void SetAttrib(const TOpenFontFaceAttribBase& aAttrib);
Sets the font attributes.
|
void SetEffects(TUint32 aEffects);
Sets the effects flags.
The flags are the logical ORing of values in this class's anonymous enum — e.g. EAlgorithmicBold
.
|
void SetHeight(TInt aHeight);
Sets the font's height.
|
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 × 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.
|
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.
|
TInt32 SlantFactor() const;
Gets the algorithmic slant factor.
|
TInt32 WidthFactor() const;
Gets the algorithmic width factor.
|
void operator=(const TFontSpec& aFontSpec);
Assignment operator.
|
Anonymous
Algorothmic effects flags. These can be combined using an OR operation.
|