1.1 --- a/epoc32/include/openfont.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/openfont.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,29 +1,39 @@
1.4 -// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -// A header for the open font system, which allows
1.18 -// EPOC32 to use fonts of arbitrary types, including TrueType
1.19 -// and other outline font formats.
1.20 -//
1.21 -//
1.22 -
1.23 -#ifndef OPENFONT_H__
1.24 -#define OPENFONT_H__
1.25 +/*
1.26 +* Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.27 +* All rights reserved.
1.28 +* This component and the accompanying materials are made available
1.29 +* under the terms of "Eclipse Public License v1.0"
1.30 +* which accompanies this distribution, and is available
1.31 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.32 +*
1.33 +* Initial Contributors:
1.34 +* Nokia Corporation - initial contribution.
1.35 +*
1.36 +* Contributors:
1.37 +*
1.38 +* Description:
1.39 +* A header for the open font system, which allows SymbianOS
1.40 +* to use fonts of arbitrary types, including TrueType/OpenType
1.41 +* and other outline font formats.
1.42 +*
1.43 +*/
1.44 +
1.45 +
1.46 +#ifndef __OPENFONT_H__
1.47 +#define __OPENFONT_H__
1.48
1.49 #include <e32base.h>
1.50 #include <gdi.h>
1.51 #include <ecom/ecom.h>
1.52
1.53 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.54 +#include <linkedfonts.h>
1.55 +#include <graphics/openfontconstants.h>
1.56 +#include <graphics/openfontrasterizer.h>
1.57 +#include <openfontlinkedtypefaceelementspec.h>
1.58 +#include <graphics/openfontlinkedtypefacespecification.h>
1.59 +#include <graphics/openfontlinkedtypefaceextension.h>
1.60 +#endif
1.61
1.62 class CFont;
1.63 class COpenFontFile;
1.64 @@ -48,50 +58,15 @@
1.65 class TFontShapeDeleteFunctionParameters;
1.66 class RShapeInfo;
1.67 class TShapeMessageParameters;
1.68 -/**
1.69 -The OpenFont ECOM Plug-in Interface Definition UID.
1.70 -
1.71 -@internalTechnology
1.72 -*/
1.73 -const TInt KUidOpenFontRasterizerPlunginInterface = 0x101F7F5D;
1.74 -
1.75 -/**
1.76 -
1.77 -The Shaper Factory ECOM Plug-in Interface Definition UID.
1.78 -
1.79 -@internalTechnology
1.80 -*/
1.81 -const TInt KUidShaperFactoryPlunginInterface = 0x10279726;
1.82 -
1.83 -
1.84 -/**
1.85 -Replacement character code.
1.86 -
1.87 -This is a Unicode private use area codepoint, which is reserved in the Symbian
1.88 -OS to represent characters for which a glyph does not exist in a font (either
1.89 -a bitmap or scalable font). If a glyph exists in a font with this character
1.90 -code, it will be used for nonexistent characters, otherwise, the rasterizer's
1.91 -default replacement character glyph will be used. For example, TrueType fonts
1.92 -return glyph index 0 for nonexistent characters, and that is usually mapped
1.93 -to an empty rectangle.
1.94 -@internalTechnology
1.95 -*/
1.96 -const TUint KReplacementCharacter = 0xF6DB;
1.97 -
1.98 -/**
1.99 -KFillCharacterOffset is a significant offset that is set when a character within a code section is
1.100 -not in the font. This means that for these fill characters nothing is stored within the binary
1.101 -data part of the code section.
1.102 -@internalTechnology
1.103 -*/
1.104 -const TInt KFillCharacterOffset = 0x7FFF;
1.105 +class CRasterizerLinkedTypefaceSpecification;
1.106 +class TLinkedTypefaceSpecificationArgs;
1.107
1.108 /**
1.109 Supplied to COpenFont::ExtendedInterface() to access the extended
1.110 API interface MOpenFontShapingExtension.
1.111
1.112 -@see COpenFont::ExtendedInterface()
1.113 -@see MOpenFontShapingExtension
1.114 +@see COpenFont::ExtendedInterface()
1.115 +@see MOpenFontShapingExtension
1.116 @publishedAll
1.117 @released
1.118 */
1.119 @@ -101,27 +76,28 @@
1.120 Supplied to COpenFont::ExtendedInterface() to access the extended
1.121 API interface MOpenFontTrueTypeExtension.
1.122
1.123 -@see COpenFont::ExtendedInterface()
1.124 -@see MOpenFontTrueTypeExtension
1.125 +@see COpenFont::ExtendedInterface()
1.126 +@see MOpenFontTrueTypeExtension
1.127 @publishedAll
1.128 @released
1.129 */
1.130 const TUid KUidOpenFontTrueTypeExtension = {0x1027553E};
1.131 +const TUid KUidOpenFontGlyphOutlineExtension = {0x102872CE};
1.132
1.133 /**
1.134 Supplied to CShaper::ExtendedInterface() to get the language and script
1.135 code with which the current shaper is instatsiated.
1.136 -@see CShaper::ExtendedInterface()
1.137 +@see CShaper::ExtendedInterface()
1.138 @publishedAll
1.139 @released
1.140 */
1.141 const TUid KUidShaperGetScript = {0x20009966};
1.142 const TUid KUidShaperGetLang = {0x20009967};
1.143
1.144 -/**
1.145 +/**
1.146 Font metrics.
1.147
1.148 -@see CFbsFont::GetFontMetrics()
1.149 +@see CFbsFont::GetFontMetrics()
1.150 @publishedAll
1.151 @released
1.152 */
1.153 @@ -142,6 +118,9 @@
1.154 inline void SetMaxHeight(TInt aMaxHeight);
1.155 inline void SetMaxDepth(TInt aMaxDepth);
1.156 inline void SetMaxWidth(TInt aMaxWidth);
1.157 + /** WARNING: Function for internal and partner use ONLY. Compatibility is not guaranteed in future releases.*/
1.158 + IMPORT_C void SetBaselineCorrection(TInt aBaselineCorrection);
1.159 + IMPORT_C TInt BaselineCorrection();
1.160 private:
1.161 TInt16 iDesignHeight; // size of the font ('pointsize' in pixels)
1.162 TInt16 iAscent; // typographic ascent
1.163 @@ -149,11 +128,12 @@
1.164 TInt16 iMaxHeight; // maximum height of a character; may be greater than iAscent
1.165 TInt16 iMaxDepth; // maximum depth of a character; may be greater than iDescent
1.166 TInt16 iMaxWidth; // maximum width of a character
1.167 - TInt32 iReserved;
1.168 + TInt16 iBaselineCorrection;
1.169 + TInt16 iReserved;
1.170 };
1.171
1.172 -
1.173 -/**
1.174 +
1.175 +/**
1.176 Character metrics includes more information than TCharacterMetrics.
1.177
1.178 Character metrics allow characters to be placed horizontally or vertically.
1.179 @@ -167,8 +147,8 @@
1.180 Vertical drawing (in the sense of characters drawn with horizontal baselines,
1.181 but in a vertical line) is not yet supported by Symbian OS.
1.182
1.183 -@see CFont::GetCharacterData()
1.184 -@see CFbsFont::GetCharacterData()
1.185 +@see CFont::GetCharacterData()
1.186 +@see CFbsFont::GetCharacterData()
1.187 @publishedAll
1.188 @released
1.189 */
1.190 @@ -177,10 +157,10 @@
1.191 public:
1.192 enum TUninitialized { EUninitialized };
1.193 public:
1.194 - /** Default constructor initializes all members to 0. */
1.195 + /** Default constructor initializes all members to 0. */
1.196 inline TOpenFontCharMetrics();
1.197
1.198 - /** Constructor that does not initialize any members. */
1.199 + /** Constructor that does not initialize any members. */
1.200 TOpenFontCharMetrics(TUninitialized) {}
1.201 IMPORT_C TOpenFontCharMetrics(const TCharacterMetrics& aMetrics);
1.202 IMPORT_C TBool GetTCharacterMetrics(TCharacterMetrics& aMetrics) const;
1.203 @@ -202,6 +182,8 @@
1.204 inline void SetVertBearingX(TInt aVertBearingX);
1.205 inline void SetVertBearingY(TInt aVertBearingY);
1.206 inline void SetVertAdvance(TInt aVertAdvance);
1.207 + IMPORT_C void SetGlyphType(TGlyphBitmapType);
1.208 + IMPORT_C TGlyphBitmapType GlyphType() const;
1.209 private:
1.210 TInt16 iWidth; // width of the glyph
1.211 TInt16 iHeight; // height of the glyph
1.212 @@ -211,11 +193,12 @@
1.213 TInt16 iVertBearingX; // x component of vertical bearing
1.214 TInt16 iVertBearingY; // y component of vertical bearing
1.215 TInt16 iVertAdvance; // vertical advance
1.216 - TInt32 iReserved;
1.217 + TUint16 iGlyphBitmapType;// Glyph bitmap type; TGlyphBitmapType
1.218 + TInt16 iReserved;
1.219 };
1.220
1.221 -
1.222 -/**
1.223 +
1.224 +/**
1.225 Font glyph data.
1.226
1.227 Objects of this type are used by rasterizers to supply glyph data to font
1.228 @@ -225,7 +208,7 @@
1.229 The object cannot be constructed and destroyed by normal means. It resides
1.230 on a specified heap. It is created by New() and deleted by RHeap::Free().
1.231
1.232 -@see COpenFont::RasterizeL()
1.233 +@see COpenFont::RasterizeL()
1.234 @publishedAll
1.235 @released
1.236 */
1.237 @@ -269,8 +252,7 @@
1.238 };
1.239
1.240 class COpenFontGlyph;
1.241 -class CLinkedFontInformation;
1.242 -/**
1.243 +/**
1.244 Open Font System font abstract base class.
1.245
1.246 Derive a class from this class to represent an instance of a typeface at a
1.247 @@ -294,7 +276,7 @@
1.248
1.249 Information about deriving from this class is also provided in the API guide.
1.250
1.251 -@see COpenFontFile::GetNearestFontInPixelsL()
1.252 +@see COpenFontFile::GetNearestFontInPixelsL()
1.253 @publishedAll
1.254 @released
1.255 */
1.256 @@ -302,16 +284,16 @@
1.257 {
1.258 public:
1.259 /** Creates a bitmap for the specified Unicode character.
1.260 -
1.261 +
1.262 Implementations of this function should put the bitmap in
1.263 aGlyphData->iBitmapBuffer, and the character metrics are placed in
1.264 aGlyphData->iMetricsBuffer. The other parts of aGlyphData should be left
1.265 alone.
1.266 -
1.267 +
1.268 There are a number of strategies for achieving this, e.g. pass the
1.269 rasterization task all the way up to the rasterizer engine. These are
1.270 discussed in the API guide.
1.271 -
1.272 +
1.273 At present you must write the bitmap in the Symbian platform's
1.274 run-length-encoded format. This is a packed binary format starting on a
1.275 byte boundary and made up of a number of sections. Each section starts
1.276 @@ -321,7 +303,7 @@
1.277 aGlyphData->iMetricsBuffer.Width()) follows. If the first bit of the header
1.278 is 1 the next four bits are a count of non-repeating rows, again starting
1.279 with the least significant bit, and that many rows of bits follow.
1.280 -
1.281 +
1.282 @param aCode The character code of the Unicode character for which the
1.283 bitmap is required.
1.284 @param aGlyphData On return, contains a pointer to a TOpenFontGlyphData
1.285 @@ -356,55 +338,86 @@
1.286 inline TInt FontLineGap() const;
1.287 inline TInt FontMaxHeight() const;
1.288 void DeleteShaper() const;
1.289 + TInt GetFontTable(TUint32 aTag, TAny*& aTableContent, TInt& aLength);
1.290 + TInt GetGlyphOutline(TUint aCode, TBool aHinted, TAny*& aOutline, TInt& aLength);
1.291 +
1.292 +protected:
1.293 + /** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.294 + */
1.295 + TInt PointerToThisOffset(const TAny* aAny);
1.296 + /** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.297 + */
1.298 + TAny* ThisOffsetToPointer(const TInt aOffset);
1.299 +
1.300 protected:
1.301 RHeap* iHeap;
1.302 TOpenFontMetrics iMetrics;
1.303 private:
1.304 /** The shaper for performing complex character positioning and
1.305 substitution, if available. Null otherwise.
1.306 - @internalComponent */
1.307 +
1.308 + WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.
1.309 + */
1.310 CShaper* iShaper;
1.311 -
1.312 +
1.313 protected:
1.314 /** The positive distance in pixels from the baseline to
1.315 the top of an ANSI capital (whether or not there are
1.316 ANSI capitals in the font) */
1.317 - TInt iFontCapitalAscent;
1.318 + TInt iFontCapitalAscent;
1.319 /** The positive distance in pixels from the baseline to
1.320 the top of the highest pre-composed glyph in the font */
1.321 - TInt iFontMaxAscent;
1.322 + TInt iFontMaxAscent;
1.323 /** The positive distance in pixels from the baseline to
1.324 the bottom of the lowest ANSI descender (whether or
1.325 not there are ANSI chars in the font)*/
1.326 - TInt iFontStandardDescent;
1.327 + TInt iFontStandardDescent;
1.328 /** The positive distance in pixels from the baseline to
1.329 the bottom of the lowest pre-composed glyph in the font */
1.330 - TInt iFontMaxDescent;
1.331 + TInt iFontMaxDescent;
1.332 /** The recommended baseline to baseline gap for successive
1.333 lines of text in the font */
1.334 - TInt iFontLineGap;
1.335 + TInt iFontLineGap;
1.336 private:
1.337 const COpenFontGlyph* Glyph(TInt aSessionHandle,TInt aCode) const;
1.338 protected:
1.339 - /**
1.340 - @internalTechnology
1.341 +
1.342 + /** WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.343 */
1.344 - const COpenFontGlyph* FontCacheGlyph(TInt aCode,COpenFontGlyphTreeEntry**& aNode);
1.345 -private:
1.346 + const COpenFontGlyph* FontCacheGlyph(TInt aCode,TInt*& aNode);
1.347 + const COpenFontGlyph* FontCacheGlyph(TInt aCode);
1.348 +
1.349 + void SetGlyphCache(COpenFontGlyphCache* aGlyphCache);
1.350 +
1.351 +private:
1.352 const COpenFontGlyph* SessionCacheGlyph(RHeap* aHeap,TInt aSessionHandle,TInt aCode,
1.353 COpenFontSessionCache*& aCache,TInt& aIndex,TBool aCreate) const;
1.354 void RasterizeHelperL(TInt aCode,TOpenFontGlyphData* aGlyphData,TOpenFontGlyphData*& aTempGlyphData);
1.355 +
1.356 + COpenFontSessionCacheList* SessionCacheList()const;
1.357 +
1.358 + void SetSessionCacheList(COpenFontSessionCacheList* aSessionCacheList);
1.359 +
1.360 + void SetFile(COpenFontFile* aFile);
1.361 private:
1.362 - COpenFontFile* iFile; // the file used by this font; null if it has been deleted
1.363 - // or cannot be used
1.364 +
1.365 + // Offset from the address of the file used by this font.
1.366 + // If the file has been deleted or cannot be used, the offest will be zero.
1.367 + TInt iFileOffset;
1.368 +
1.369 TInt iFaceIndex; // index of the face in the font file
1.370 protected:
1.371 - /**
1.372 - @internalTechnology
1.373 - */
1.374 - COpenFontGlyphCache* iGlyphCache; // the per-font glyph cache; owned by the font
1.375 -private:
1.376 - COpenFontSessionCacheList* iSessionCacheList; // the list of per-session glyph caches; owned by CFontStore
1.377 + /**
1.378 + WARNING: Compatibility is not guaranteed in future releases. Please use the provided APIs only.
1.379 + Offset from the address of this font of the per-font glyph cache which is owned by the font
1.380 + @internalTechnology
1.381 + */
1.382 + TInt iGlyphCacheOffset;
1.383 +private:
1.384 + // Offset from the address of this font of the list of per-session glyph
1.385 + // caches which are owned by CFontStore
1.386 + TInt iSessionCacheListOffset;
1.387 +
1.388 TAny* iReserved; // unused; for future expansion
1.389 };
1.390
1.391 @@ -417,8 +430,8 @@
1.392 COpenFont::ExtendedInterface function when KUidOpenFontShapingExtension is
1.393 supplied as the UID.
1.394
1.395 -@see COpenFont
1.396 -@see KUidOpenFontShapingExtension
1.397 +@see COpenFont
1.398 +@see KUidOpenFontShapingExtension
1.399 @publishedAll
1.400 @released
1.401 */
1.402 @@ -458,12 +471,10 @@
1.403 the unicode.
1.404
1.405 For more information:
1.406 - @see COpenFont::RasterizeL()
1.407 -
1.408 - @param aCode
1.409 - The glyph code of the character for which the bitmap is required.
1.410 - @param aGlyphData
1.411 - The function puts its output here.
1.412 + @see COpenFont::RasterizeL()
1.413 +
1.414 + @param aCode The glyph code of the character for which the bitmap is required.
1.415 + @param aGlyphData The function puts its output here.
1.416 */
1.417 virtual void RasterizeGlyphL(TInt aCode,TOpenFontGlyphData* aGlyphData) = 0;
1.418
1.419 @@ -507,7 +518,7 @@
1.420 This interface should be returned by the overridden
1.421 COpenFont::ExtendedInterface function when KUidOpenFontTrueTypeExtension is
1.422 supplied as the UID.
1.423 -@see KUidOpenFontTrueTypeExtension
1.424 +@see KUidOpenFontTrueTypeExtension
1.425 @publishedAll
1.426 @released
1.427 */
1.428 @@ -543,14 +554,20 @@
1.429 @see GetTrueTypeTable */
1.430 virtual TBool HasTrueTypeTable(TUint32 aTag) = 0;
1.431 };
1.432 -
1.433 +
1.434 +class MOpenFontGlyphOutlineExtension
1.435 + {
1.436 +public:
1.437 + virtual TInt GetGlyphOutline(TUint aCode, TBool aIsGlyphId,
1.438 + TBool aHinted, TAny*& aOutline, TInt& aLength) = 0;
1.439 + };
1.440 /**
1.441 Font attribute base class.
1.442
1.443 This class is not intended for user derivation.
1.444
1.445 -@see TOpenFontFaceAttrib
1.446 -@see TOpenFontSpec
1.447 +@see TOpenFontFaceAttrib
1.448 +@see TOpenFontSpec
1.449 @publishedAll
1.450 @released
1.451 */
1.452 @@ -579,7 +596,7 @@
1.453 inline void SetMonoWidth(TBool aMonoWidth);
1.454 inline TBool operator==(const TOpenFontFaceAttribBase& aAttrib) const;
1.455
1.456 - // Unicode ranges for iCoverage[0] (incomplete; see the TrueType documentation for other values)
1.457 + // Unicode ranges for iCoverage[0] (see the TrueType documentation for other values which are not included)
1.458 enum
1.459 {
1.460 ELatinSet = 0x1, // 0000-007F
1.461 @@ -636,13 +653,13 @@
1.462 TInt32 iReserved;
1.463 };
1.464
1.465 -
1.466 +
1.467 /**
1.468 Typeface attributes.
1.469
1.470 These attributes include the name, family name, and supported scripts.
1.471
1.472 -@see CFbsFont::GetFaceAttrib()
1.473 +@see CFbsFont::GetFaceAttrib()
1.474 @publishedAll
1.475 @released
1.476 */
1.477 @@ -673,8 +690,8 @@
1.478 TInt32 iReserved2;
1.479 };
1.480
1.481 -
1.482 -/**
1.483 +
1.484 +/**
1.485 Font specification allowing more attributes to be specified than TFontSpec.
1.486
1.487 In addition to the attributes specified by TFontSpec, this font specification
1.488 @@ -718,12 +735,16 @@
1.489 IMPORT_C TBool IsEffectOn(FontEffect::TEffect aEffect) const;
1.490 IMPORT_C void SetScriptTypeForMetrics(TLanguage aLanguage);
1.491 IMPORT_C TInt ScriptTypeForMetrics() const;
1.492 - static TBool IsCompensationForAspectRatioNeeded(TInt aPixelWidth, TInt aPixelHeight, TReal& aRatio);
1.493 + static TBool IsCompensationForAspectRatioNeeded(TInt aPixelWidth, TInt aPixelHeight);
1.494 + static TInt ApplyRatio(TInt& aValue,TInt aNumerator,TInt aDenominator);
1.495 + static TInt ApplyRatio(TInt32& aValue,TInt aNumerator,TInt aDenominator);
1.496 public:
1.497 /** Algorithmic effects flags.
1.498
1.499 - These can be combined using an OR operation.
1.500 - @publishedPartner For use by system/UI software.
1.501 + These can be combined using an OR operation.
1.502 +
1.503 + WARNING: Enum for internal and partner use ONLY. Compatibility is not guaranteed in future releases.
1.504 +
1.505 @deprecated Use FontEffect::TEffect instead.
1.506 */
1.507 enum
1.508 @@ -756,24 +777,6 @@
1.509 };
1.510
1.511 /**
1.512 -Constants for attachment points for diacritics.
1.513 -@internalComponent
1.514 -*/
1.515 -enum TOpenFontAttachment
1.516 - {
1.517 - EBaselineLeft,
1.518 - EBaselineRight,
1.519 - ETopLeft,
1.520 - ETopCenter,
1.521 - ETopRight,
1.522 - EBottomLeft,
1.523 - EBottomCenter,
1.524 - EBottomRight
1.525 - };
1.526 -
1.527 -
1.528 -
1.529 -/**
1.530 Font file abstract base class.
1.531
1.532 Write a class derived from COpenFontFile to manage a file with the font format
1.533 @@ -806,8 +809,8 @@
1.534 these functions is provided in the definitions below. Information about
1.535 deriving from this class is also provided in the API guide.
1.536
1.537 -@see COpenFontRasterizer::NewFontFileL()
1.538 -@see CWsScreenDevice::AddFile()
1.539 +@see COpenFontRasterizer::NewFontFileL()
1.540 +@see CWsScreenDevice::AddFile()
1.541 @publishedAll
1.542 @released
1.543 */
1.544 @@ -828,21 +831,19 @@
1.545 Implementations may use the utility function GetNearestFontHelper()
1.546 to get the attributes of the closest matching font.
1.547
1.548 - @param aHeap Shared heap. This value should be passed to the COpenFont derived
1.549 - classes' constructor.
1.550 - @param aSessionCacheList The session cache list. This value should be passed
1.551 - to the COpenFont derived classes' constructor.
1.552 - @param aDesiredFontSpec The desired font specification.
1.553 - @param aPixelWidth The width of a pixel. Used with aPixelHeight for calculating
1.554 - the algorithmic slant of the typeface.
1.555 - @param aPixelHeight The height of a pixel. Used with aPixelWidth for calculating
1.556 - the algorithmic slant of the typeface.
1.557 - @param aFont On return, contains a pointer to the newly created COpenFont
1.558 - derived object, or NULL if no font matching aDesiredFontSpec exists.
1.559 - @param aActualFontSpec The actual font specification of the font retrieved
1.560 - into aFont.
1.561 - @publishedAll
1.562 - @see GetNearestFontHelper()
1.563 + @param aHeap Shared heap. This value should be passed to the
1.564 + COpenFont derived classes' constructor.
1.565 + @param aSessionCacheList The session cache list. This value should be passed
1.566 + to the COpenFont derived classes' constructor.
1.567 + @param aDesiredFontSpec The desired font specification.
1.568 + @param aPixelWidth The width of a pixel. Used with aPixelHeight for calculating
1.569 + the algorithmic slant of the typeface.
1.570 + @param aPixelHeight The height of a pixel. Used with aPixelWidth for calculating
1.571 + the algorithmic slant of the typeface.
1.572 + @param aFont On return, contains a pointer to the newly created COpenFont
1.573 + derived object, or NULL if no font matching aDesiredFontSpec exists.
1.574 + @param aActualFontSpec The actual font specification of the font retrieved into aFont.
1.575 + @see GetNearestFontHelper()
1.576 */
1.577 virtual void GetNearestFontInPixelsL(
1.578 RHeap* aHeap, COpenFontSessionCacheList* aSessionCacheList,
1.579 @@ -863,21 +864,19 @@
1.580 Implementations may use the utility function GetNearestFontHelper()
1.581 to get the attributes of the closest matching font.
1.582
1.583 - @param aHeap Shared heap. This value should be passed to the COpenFont derived
1.584 - classes' constructor.
1.585 - @param aSessionCacheList The session cache list. This value should be passed
1.586 - to the COpenFont derived classes' constructor.
1.587 - @param aDesiredFontSpec The desired font specification.
1.588 - @param aPixelWidth The width of a pixel. Used with aPixelHeight for calculating
1.589 - the algorithmic slant of the typeface.
1.590 - @param aPixelHeight The height of a pixel. Used with aPixelWidth for calculating
1.591 - the algorithmic slant of the typeface.
1.592 - @param aFont On return, contains a pointer to the newly created COpenFont
1.593 - derived object, or NULL if no font matching aDesiredFontSpec exists.
1.594 - @param aActualFontSpec The actual font specification of the font retrieved
1.595 - into aFont.
1.596 - @publishedAll
1.597 - @see GetNearestFontHelper()
1.598 + @param aHeap Shared heap. This value should be passed to the COpenFont
1.599 + derived classes' constructor.
1.600 + @param aSessionCacheList The session cache list. This value should be passed
1.601 + to the COpenFont derived classes' constructor.
1.602 + @param aDesiredFontSpec The desired font specification.
1.603 + @param aPixelWidth The width of a pixel. Used with aPixelHeight for calculating
1.604 + the algorithmic slant of the typeface.
1.605 + @param aPixelHeight The height of a pixel. Used with aPixelWidth for calculating
1.606 + the algorithmic slant of the typeface.
1.607 + @param aFont On return, contains a pointer to the newly created COpenFont
1.608 + derived object, or NULL if no font matching aDesiredFontSpec exists.
1.609 + @param aActualFontSpec The actual font specification of the font retrieved into aFont.
1.610 + @see GetNearestFontHelper()
1.611 */
1.612 virtual void GetNearestFontToDesignHeightInPixelsL(
1.613 RHeap* /*aHeap*/, COpenFontSessionCacheList* /*aSessionCacheList*/,
1.614 @@ -897,22 +896,20 @@
1.615 Implementations may use the utility function GetNearestFontHelper()
1.616 to get the attributes of the closest matching font.
1.617
1.618 - @param aHeap Shared heap. This value should be passed to the COpenFont derived
1.619 - classes' constructor.
1.620 - @param aSessionCacheList The session cache list. This value should be passed
1.621 - to the COpenFont derived classes' constructor.
1.622 - @param aDesiredFontSpec The desired font specification.
1.623 - @param aPixelWidth The width of a pixel. Used with aPixelHeight for calculating
1.624 - the algorithmic slant of the typeface.
1.625 - @param aPixelHeight The height of a pixel. Used with aPixelWidth for calculating
1.626 - the algorithmic slant of the typeface.
1.627 - @param aFont On return, contains a pointer to the newly created COpenFont
1.628 - derived object, or NULL if no font matching aDesiredFontSpec exists.
1.629 - @param aActualFontSpec The actual font specification of the font retrieved
1.630 - into aFont.
1.631 - @param aMaxHeight The maximum height within which the font must fit.
1.632 - @publishedAll
1.633 - @see GetNearestFontHelper()
1.634 + @param aHeap Shared heap. This value should be passed to the COpenFont
1.635 + derived classes' constructor.
1.636 + @param aSessionCacheList The session cache list. This value should be passed
1.637 + to the COpenFont derived classes' constructor.
1.638 + @param aDesiredFontSpec The desired font specification.
1.639 + @param aPixelWidth The width of a pixel. Used with aPixelHeight for calculating
1.640 + the algorithmic slant of the typeface.
1.641 + @param aPixelHeight The height of a pixel. Used with aPixelWidth for calculating
1.642 + the algorithmic slant of the typeface.
1.643 + @param aFont On return, contains a pointer to the newly created COpenFont
1.644 + derived object, or NULL if no font matching aDesiredFontSpec exists.
1.645 + @param aActualFontSpec The actual font specification of the font retrieved into aFont.
1.646 + @param aMaxHeight The maximum height (vertical extent) within which the font must fit.
1.647 + @see GetNearestFontHelper()
1.648 */
1.649 virtual void GetNearestFontToMaxHeightInPixelsL(
1.650 RHeap* /*aHeap*/, COpenFontSessionCacheList* /*aSessionCacheList*/,
1.651 @@ -920,10 +917,10 @@
1.652 COpenFont*& /*aFont*/, TOpenFontSpec& /*aActualFontSpec*/, TInt /*aMaxHeight*/) {}
1.653
1.654 /** Tests whether a specified typeface contains a particular character.
1.655 -
1.656 - @param aFaceIndex The index of the typeface to be tested.
1.657 - @param aCode The Unicode character code for the character to be tested.
1.658 - @return ETrue if the typeface contains aCode, otherwise EFalse. */
1.659 +
1.660 + @param aFaceIndex The index of the typeface to be tested.
1.661 + @param aCode The Unicode character code for the character to be tested.
1.662 + @return ETrue if the typeface contains aCode, otherwise EFalse. */
1.663 virtual TBool HasUnicodeCharacterL(TInt aFaceIndex,TInt aCode) const = 0;
1.664 IMPORT_C virtual void ExtendedInterface(TUid aUid, TAny*& aParam);
1.665 IMPORT_C COpenFontFile(TInt aUid,const TDesC& aFileName);
1.666 @@ -960,7 +957,7 @@
1.667 // A class to contain the public font attributes and private positioning information (for kerning, ligatures, etc.)
1.668 class TAttrib: public TOpenFontFaceAttrib
1.669 {
1.670 - public:
1.671 + public:
1.672 COpenFontPositioner* iPositioner; // if non-null, positioning information for the typeface
1.673 };
1.674 static TInt ScoreByName(const TOpenFontSpec& aDesiredFontSpec, const TAttrib& aAttrib);
1.675 @@ -983,80 +980,7 @@
1.676 TOpenFontFileData* iData;
1.677 };
1.678
1.679 -
1.680 -/**
1.681 -The Open Font rasterizer plug-in Interface Definition class.
1.682 -
1.683 -This interface allows the implementation of an Open Font rasterizer plug-in,
1.684 -which can then be dynamically loaded at run time by the ECOM plug-in framework.
1.685 -The plug-in implementation is instantiated by calling NewL(), passing the implementation
1.686 -UID so that ECOM can instantiate the correct implementation.
1.687 -
1.688 -The rasterizer interface declares a single pure virtual functions, which the
1.689 -plug-in derived from this interface must implement. The function reads font files, and creates
1.690 -a COpenFontFile object if the font file is of the right type.
1.691 -
1.692 -Writing derived classes:
1.693 -
1.694 -Open font rasterizers should derive from this class and implement the
1.695 -NewFontFileL() function.
1.696 -
1.697 -Derived classes should also define the factory function. It is a static function
1.698 -which takes no arguments. It creates a COpenFontRasterizer derived object on the heap, and returns it
1.699 -to the caller. This factory function, together with the implementation UID will form
1.700 -the TImplementationProxy used by the ECOM framework to instatiate the plug-in.
1.701 -
1.702 -The rasterizer class may also need to store an 'engine context'. This is an
1.703 -object derived from COpenFontRasterizerContext, which provides functions that
1.704 -make it easier to write the glyph bitmap during rasterization.
1.705 -
1.706 -
1.707 -@publishedAll
1.708 -@released
1.709 -*/
1.710 -class COpenFontRasterizer: public CBase
1.711 - {
1.712 -public:
1.713 - /** Creates a COpenFontFile derived object for loading font files in the
1.714 - new format.
1.715 -
1.716 - This function is called by the framework during font and bitmap server
1.717 - startup. It creates a font file object for font files in the \\resource\\fonts
1.718 - directory on all drives, using the default search path. The first font of
1.719 - a given name overrides subsequent ones. The directory search path is soft
1.720 - to hard: Y:, X:, W:, ..., C:, B:, A:, Z:. Files may also be added
1.721 - dynamically after startup using CWsScreenDevice::AddFile(), which
1.722 - indirectly calls this function.
1.723 -
1.724 - Implementations of this function should examine the file aFileName, and if
1.725 - it is of the correct type attempt to create a COpenFontFile derived object
1.726 - to load it. The caller is responsible for deleting the object. The function
1.727 - must return NULL if it cannot recognise the file, and it may also leave if
1.728 - there is an error.
1.729 -
1.730 - @param aUid An ID to be used for the file. UIDs are required by the font
1.731 - framework, so the font store allocates them for non Symbian OS-native font
1.732 - files. This ID persists until the font is unloaded, e.g. if the device is
1.733 - rebooted.
1.734 - @param aFileName The full path and filename of the file from which the
1.735 - COpenFontFile object is created, if the file is the correct type.
1.736 - @param aFileSession The file session owned by the Font and Bitmap server.
1.737 - This file session should be used for any file access. If COpenFontFile
1.738 - objects need to keep files open, aFileSession should be stored in a place
1.739 - that is accessible to them.
1.740 - @return A pointer to a new COpenFontFile derived object, or NULL if the
1.741 - file type is not recognised.
1.742 - @see CWsScreenDevice::AddFile() */
1.743 - virtual COpenFontFile* NewFontFileL(TInt aUid,const TDesC& aFileName,RFs& aFileSession) = 0;
1.744 - inline static COpenFontRasterizer* NewL(TUid aInterfaceImplUid);
1.745 - inline virtual ~COpenFontRasterizer();
1.746 - IMPORT_C virtual void Reserved(); // unused; for future expansion
1.747 -private:
1.748 - TUid iDtor_ID_Key;//ECOM identifier used during destruction
1.749 - };
1.750 -
1.751 -
1.752 -/**
1.753 +/**
1.754 Convenience class from which rasterizer contexts may be derived.
1.755
1.756 A rasterizer context object may (optionally) be created to provide the link
1.757 @@ -1091,8 +1015,10 @@
1.758
1.759
1.760 /**
1.761 - Shaper abstract class. All shaper implementations derive from this
1.762 - @publishedAll */
1.763 +Shaper abstract class. All shaper implementations derive from this
1.764 +@publishedAll
1.765 +@released
1.766 +*/
1.767 class CShaper : public CBase
1.768 {
1.769 public:
1.770 @@ -1127,67 +1053,65 @@
1.771 IMPORT_C virtual ~CShaper();
1.772
1.773 /** construct a shaper object
1.774 - @param aBitmapFont The font to be shaped.
1.775 - @param aHeap The heap to be used by the shaper.
1.776 - @return KErrNone if this font can be shaper or system wide error code*/
1.777 + @param aBitmapFont The font to be shaped.
1.778 + @param aHeap The heap to be used by the shaper.
1.779 + @return KErrNone if this font can be shaper or system wide error code*/
1.780 virtual TInt ConstructL(CBitmapFont* aBitmapFont, TInt aScript, TInt aLanguage, RHeap* iHeap) = 0;
1.781
1.782 - /** If possible, shape the text described by aInput, placing the
1.783 - output on aHeapForOutput.
1.784 - @param aOutput The output, as a newly allocate object on
1.785 - aHeapForOutput.
1.786 - @param aInput The input text and other parameters.
1.787 - @param aHeapForOutput. On success, aOutput should be allocated from
1.788 - this and nothing else. On failure, nothing should be allocated from
1.789 - it.
1.790 - @return Error value from one of the system-wide error codes on
1.791 - failure, KErrNone on success.
1.792 - @see TShapeHeader */
1.793 + /** If possible, shape the text described by aInput, placing the output on aHeapForOutput.
1.794 + @param aOutput The output, as a newly allocate object on aHeapForOutput.
1.795 + @param aInput The input text and other parameters.
1.796 + @param aHeapForOutput On success, aOutput should be allocated from this and nothing else.
1.797 + On failure, nothing should be allocated from it.
1.798 + @return Error value from one of the system-wide error codes on failure, KErrNone on success.
1.799 + @see TShapeHeader */
1.800 virtual TInt ShapeText(TShapeHeader*& aOutput, const TInput& aInput, RHeap* aHeapForOutput) = 0;
1.801
1.802 /** For future expansion. Any overriders must base-call
1.803 if aInterface is unrecognized.
1.804 - @param aInterfaceId The ID of the interface to return.
1.805 - @return A pointer to the extension interface.
1.806 - @internalComponent
1.807 +
1.808 + WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.809 +
1.810 + @param aInterfaceId The ID of the interface to return.
1.811 + @return A pointer to the extension interface.
1.812 */
1.813 -
1.814 - IMPORT_C virtual void* ExtendedInterface(TUid aInterfaceId);
1.815 + IMPORT_C virtual void* ExtendedInterface(TUid aInterfaceId);
1.816 };
1.817
1.818 /** ECOM plug-in base class for shaper factories.
1.819 -@publishedAll */
1.820 +@publishedAll
1.821 +@released
1.822 +*/
1.823 class CShaperFactory : public CBase
1.824 {
1.825 public:
1.826 /** Create a shaper if possible, for typeface aFaceIndex
1.827 within file aFileName.
1.828 - @param aFont The font to be shaped.
1.829 - @param iHeap The heap to use for constructing the shaper.
1.830 - @return 0 If the font is not understood or inappropriate for
1.831 - any shaper that might be constructed by this class, otherwise
1.832 - returns the newly-constructed shaper on iHeap. */
1.833 + @param aFont The font to be shaped.
1.834 + @param iHeap The heap to use for constructing the shaper.
1.835 + @return 0 If the font is not understood or inappropriate for any shaper that might be constructed
1.836 + by this class, otherwise returns the newly-constructed shaper on iHeap. */
1.837 virtual CShaper* NewShaperL(CBitmapFont* aFont, TInt aScript, TInt aLanguage, RHeap* iHeap) = 0;
1.838
1.839 inline static CShaperFactory* NewL(TUid aInterfaceImplUid);
1.840 inline virtual ~CShaperFactory();
1.841
1.842 - /** For future expansion. Any overriders must base-call
1.843 - if aInterface is unrecognized.
1.844 - @param aInterfaceId The ID of the interface to return.
1.845 - @return A pointer to the extension interface.
1.846 - @internalComponent
1.847 + /** For future expansion. Any overriders must base-call if aInterface is unrecognized.
1.848 +
1.849 + WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.
1.850 +
1.851 + @param aInterfaceId The ID of the interface to return.
1.852 + @return A pointer to the extension interface.
1.853 */
1.854 virtual void* ExtendedInterface(TUid aInterfaceId);
1.855
1.856 private:
1.857 TUid iDtor_ID_Key;//ECOM identifier used during destruction
1.858 };
1.859 -
1.860
1.861 // Inline functions start here.
1.862 /** Default C++ constructor.
1.863 -
1.864 +
1.865 This creates then zero fills the object. */
1.866 inline TOpenFontMetrics::TOpenFontMetrics()
1.867 {
1.868 @@ -1195,16 +1119,16 @@
1.869 }
1.870
1.871 /** Gets the font's size.
1.872 -
1.873 -@return The font's size.
1.874 -@see SetSize() */
1.875 +
1.876 +@return The font's size.
1.877 +@see SetSize() */
1.878 inline TInt TOpenFontMetrics::Size() const
1.879 {
1.880 return iDesignHeight;
1.881 }
1.882 -
1.883 +
1.884 /** Gets the font's ascent.
1.885 -
1.886 +
1.887 This is the ascent for the Latin character which is highest above the baseline.
1.888
1.889 @return The font's ascent, in pixels.
1.890 @@ -1215,32 +1139,32 @@
1.891 }
1.892
1.893 /** Gets the font's descent.
1.894 -
1.895 +
1.896 This is the descent for the Latin character in the font which falls furthest below the baseline.
1.897 -
1.898 +
1.899 @return The font's descent, in pixels.
1.900 @see SetDescent() */
1.901 inline TInt TOpenFontMetrics::Descent() const
1.902 {
1.903 return iDescent;
1.904 }
1.905 -
1.906 +
1.907 /** Sets the font's maximum height.
1.908
1.909 Note that if this object was initialised from the CFont this will be the same
1.910 as the ascent.
1.911
1.912 This is the ascent for the character which is highest above the baseline.
1.913 -In many fonts this will be the height of an accented character like Â,
1.914 +In many fonts this will be the height of an accented character like Â,
1.915 including the accent.
1.916 -
1.917 +
1.918 @return The maximum height of the font, in pixels.
1.919 @see SetMaxDepth() */
1.920 inline TInt TOpenFontMetrics::MaxHeight() const
1.921 {
1.922 return iMaxHeight;
1.923 }
1.924 -
1.925 +
1.926 /** Gets the font's maximum depth.
1.927
1.928 Note: If this object was initialised from the CFont this will be the same as the
1.929 @@ -1248,25 +1172,25 @@
1.930
1.931 This is the descent for the character in the font which falls furthest below
1.932 the baseline.
1.933 -
1.934 +
1.935 @return The font's maximum depth.
1.936 @see SetMaxDepth() */
1.937 inline TInt TOpenFontMetrics::MaxDepth() const
1.938 {
1.939 return iMaxDepth;
1.940 }
1.941 -
1.942 +
1.943 /** Gets the maximum character width, in pixels.
1.944 -
1.945 +
1.946 @return The maximum character width, in pixels.
1.947 @see SetMaxWidth() */
1.948 inline TInt TOpenFontMetrics::MaxWidth() const
1.949 {
1.950 return iMaxWidth;
1.951 }
1.952 -
1.953 +
1.954 /** Sets the font's size.
1.955 -
1.956 +
1.957 @param aSize The font's size.
1.958 @see Size() */
1.959 inline void TOpenFontMetrics::SetSize(TInt aSize)
1.960 @@ -1275,7 +1199,7 @@
1.961 }
1.962
1.963 /** Sets the ascent.
1.964 -
1.965 +
1.966 @param aAscent The ascent, in pixels.
1.967 @see Ascent() */
1.968 inline void TOpenFontMetrics::SetAscent(TInt aAscent)
1.969 @@ -1284,96 +1208,96 @@
1.970 }
1.971
1.972 /** Sets the descent.
1.973 -
1.974 +
1.975 @param aDescent The descent, in pixels.
1.976 @see Descent() */
1.977 inline void TOpenFontMetrics::SetDescent(TInt aDescent)
1.978 {
1.979 iDescent = static_cast<TInt16>(aDescent);
1.980 }
1.981 -
1.982 +
1.983 /** Sets the font's maximum height.
1.984 -
1.985 +
1.986 @param aMaxHeight The font's maximum height, in pixels.
1.987 @see MaxHeight() */
1.988 inline void TOpenFontMetrics::SetMaxHeight(TInt aMaxHeight)
1.989 {
1.990 iMaxHeight = static_cast<TInt16>(aMaxHeight);
1.991 }
1.992 -
1.993 +
1.994 /** Sets the font's maximum depth.
1.995 -
1.996 +
1.997 @param aMaxDepth The font's maximum depth, in pixels.
1.998 @see MaxDepth() */
1.999 inline void TOpenFontMetrics::SetMaxDepth(TInt aMaxDepth)
1.1000 {
1.1001 iMaxDepth = static_cast<TInt16>(aMaxDepth);
1.1002 }
1.1003 -
1.1004 +
1.1005 /** Sets the maximum character width, in pixels.
1.1006 -
1.1007 +
1.1008 @param aMaxWidth The maximum character width, in pixels.
1.1009 @see MaxWidth() */
1.1010 inline void TOpenFontMetrics::SetMaxWidth(TInt aMaxWidth)
1.1011 {
1.1012 iMaxWidth = static_cast<TInt16>(aMaxWidth);
1.1013 }
1.1014 -
1.1015 +
1.1016 /** Default C++ constructor.
1.1017 -
1.1018 +
1.1019 The constructor initialises all data members to zero. As for other T classes,
1.1020 there is no need to explicitly cleanup TOpenFontCharMetrics objects. */
1.1021 inline TOpenFontCharMetrics::TOpenFontCharMetrics()
1.1022 {
1.1023 Mem::FillZ(this,sizeof(*this));
1.1024 }
1.1025 -
1.1026 +
1.1027 /** Gets the width of the character's bitmap.
1.1028 -
1.1029 +
1.1030 @return The width of the bitmap in pixels. */
1.1031 inline TInt TOpenFontCharMetrics::Width() const
1.1032 {
1.1033 return iWidth;
1.1034 }
1.1035 -
1.1036 +
1.1037 /** Gets the height of the character's bitmap.
1.1038 -
1.1039 +
1.1040 @return The character's height in pixels. */
1.1041 inline TInt TOpenFontCharMetrics::Height() const
1.1042 {
1.1043 return iHeight;
1.1044 }
1.1045 -
1.1046 +
1.1047 /** Gets the horizontal bearing X.
1.1048 -
1.1049 +
1.1050 This is the distance in pixels from the pen point before the character is
1.1051 drawn (the origin) to the left edge of the bitmap, when drawing horizontally.
1.1052 A positive value means that the left edge of the bitmap is right of the origin.
1.1053 -
1.1054 +
1.1055 @return The horizontal bearing X in pixels */
1.1056 inline TInt TOpenFontCharMetrics::HorizBearingX() const
1.1057 {
1.1058 return iHorizBearingX;
1.1059 }
1.1060 -
1.1061 +
1.1062 /** Gets horizontal bearing Y.
1.1063 -
1.1064 +
1.1065 This is the vertical distance in pixels from the pen point before the character
1.1066 is drawn (the origin) to the top edge of the bitmap, when drawing horizontally.
1.1067 A positive value means that the top edge of the bitmap is above the origin
1.1068 -
1.1069 +
1.1070 @return The horizontal bearing Y in pixels. */
1.1071 inline TInt TOpenFontCharMetrics::HorizBearingY() const
1.1072 {
1.1073 return iHorizBearingY;
1.1074 }
1.1075 -
1.1076 +
1.1077 /** Gets the horizontal advance.
1.1078 -
1.1079 +
1.1080 This is the amount added to the x co-ordinate of the origin after the character
1.1081 is drawn what most people understand by the width or escapement of a character.
1.1082 The origin here is the pen point before the character is drawn.
1.1083 -
1.1084 +
1.1085 @return The horizontal advance in pixels */
1.1086 inline TInt TOpenFontCharMetrics::HorizAdvance() const
1.1087 {
1.1088 @@ -1381,47 +1305,47 @@
1.1089 }
1.1090
1.1091 /** Gets the vertical bearing X.
1.1092 -
1.1093 +
1.1094 This is the distance in pixels from the pen point before the character is
1.1095 drawn (the origin) to the left edge of the bitmap, when drawing vertically.
1.1096 A positive value means that the left edge of the bitmap is right of the origin.
1.1097 -
1.1098 +
1.1099 @return The vertical bearing X in pixels. */
1.1100 inline TInt TOpenFontCharMetrics::VertBearingX() const
1.1101 {
1.1102 return iVertBearingX;
1.1103 }
1.1104 -
1.1105 +
1.1106 /** Gets the vertical bearing Y.
1.1107 -
1.1108 +
1.1109 This is the distance in pixels from the pen point before the character is
1.1110 drawn (the origin) to the top edge of the bitmap, when drawing vertically.
1.1111 A positive value means that the top edge of the bitmap is above the origin.
1.1112 -
1.1113 +
1.1114 @return The vertical bearing Y in pixels. */
1.1115 inline TInt TOpenFontCharMetrics::VertBearingY() const
1.1116 {
1.1117 return iVertBearingY;
1.1118 }
1.1119 -
1.1120 +
1.1121 /** Gets the vertical advance.
1.1122 -
1.1123 +
1.1124 When drawing vertically, this is the amount added to the y co-ordinate of
1.1125 the origin after the character is drawn what most people understand by
1.1126 the height of a character. The origin here is the pen point before the character
1.1127 is drawn.
1.1128 -
1.1129 +
1.1130 Note: Vertical drawing is not supported in v5.
1.1131 -
1.1132 +
1.1133 @return The vertical advance in pixels. */
1.1134 inline TInt TOpenFontCharMetrics::VertAdvance() const
1.1135 {
1.1136 return iVertAdvance;
1.1137 }
1.1138 -
1.1139 +
1.1140 /** Gets the bounds of the character relative to its origin when setting text
1.1141 horizontally.
1.1142 -
1.1143 +
1.1144 The origin here is the pen point before the character is drawn.
1.1145
1.1146 @param aBounds The character's bounds. */
1.1147 @@ -1432,12 +1356,12 @@
1.1148 aBounds.iBr.iX = aBounds.iTl.iX + iWidth;
1.1149 aBounds.iBr.iY = aBounds.iTl.iY + iHeight;
1.1150 }
1.1151 -
1.1152 +
1.1153 /** Gets the bounds of the character relative to its origin when setting text
1.1154 vertically.
1.1155 -
1.1156 +
1.1157 The origin here is the pen point before the character is drawn.
1.1158 -
1.1159 +
1.1160 @param aBounds The character's bounds. */
1.1161 inline void TOpenFontCharMetrics::GetVertBounds(TRect& aBounds) const
1.1162 {
1.1163 @@ -1446,100 +1370,100 @@
1.1164 aBounds.iBr.iX = aBounds.iTl.iX + iWidth;
1.1165 aBounds.iBr.iY = aBounds.iTl.iY + iHeight;
1.1166 }
1.1167 -
1.1168 +
1.1169 /** Sets the width of the character's bitmap.
1.1170 -
1.1171 +
1.1172 @param aWidth The width of the bitmap in pixels. */
1.1173 inline void TOpenFontCharMetrics::SetWidth(TInt aWidth)
1.1174 {
1.1175 iWidth = (TInt16)aWidth;
1.1176 }
1.1177 -
1.1178 +
1.1179 /** Sets the height of the character's bitmap.
1.1180 -
1.1181 +
1.1182 @param aHeight The character height (in pixels). */
1.1183 inline void TOpenFontCharMetrics::SetHeight(TInt aHeight)
1.1184 {
1.1185 iHeight = (TInt16)aHeight;
1.1186 }
1.1187 -
1.1188 +
1.1189 /** Sets the horizontal bearing X.
1.1190 -
1.1191 +
1.1192 This is the distance in pixels from the pen point before the character is
1.1193 drawn (the origin) to the left edge of the bitmap, when drawing horizontally.
1.1194 A positive value means that the left edge of the bitmap is right of the origin.
1.1195 -
1.1196 +
1.1197 @param aHorizBearingX The horizontal bearing X (in pixels). */
1.1198 inline void TOpenFontCharMetrics::SetHorizBearingX(TInt aHorizBearingX)
1.1199 {
1.1200 iHorizBearingX = (TInt16)aHorizBearingX;
1.1201 }
1.1202 -
1.1203 +
1.1204 /** Sets the horizontal bearing Y.
1.1205 -
1.1206 +
1.1207 This is the distance in pixels from the pen point before the character is
1.1208 drawn (the origin) to the top edge of the bitmap, when drawing horizontally.
1.1209 A positive value means that the top edge of the bitmap is above the origin.
1.1210 -
1.1211 +
1.1212 @param aHorizBearingY The horizontal bearing Y (in pixels). */
1.1213 inline void TOpenFontCharMetrics::SetHorizBearingY(TInt aHorizBearingY)
1.1214 {
1.1215 iHorizBearingY = (TInt16)aHorizBearingY;
1.1216 }
1.1217 -
1.1218 +
1.1219 /** Sets the horizontal advance.
1.1220 -
1.1221 +
1.1222 This is the amount added to the x co-ordinate of the origin after the character
1.1223 is drawn, what most people understand by the width or escapement of a character.
1.1224 The origin here is the pen point before the character is drawn.
1.1225 -
1.1226 +
1.1227 @param aHorizAdvance The horizontal advance (in pixels). */
1.1228 inline void TOpenFontCharMetrics::SetHorizAdvance(TInt aHorizAdvance)
1.1229 {
1.1230 iHorizAdvance = (TInt16)aHorizAdvance;
1.1231 }
1.1232 -
1.1233 +
1.1234 /** Set vertical bearing X.
1.1235 -
1.1236 +
1.1237 This is the distance in pixels from the pen point before the character is
1.1238 drawn (the origin) to the left edge of the bitmap, when drawing vertically.
1.1239 A positive value means that the left edge of the bitmap is right of the origin.
1.1240 -
1.1241 +
1.1242 @param aVertBearingX The vertical bearing X (in pixels). */
1.1243 inline void TOpenFontCharMetrics::SetVertBearingX(TInt aVertBearingX)
1.1244 {
1.1245 iVertBearingX = (TInt16)aVertBearingX;
1.1246 }
1.1247 -
1.1248 +
1.1249 /** Sets the vertical bearing Y.
1.1250 -
1.1251 +
1.1252 This is the distance in pixels from the pen point before the character is
1.1253 drawn (the origin) to the top edge of the bitmap, when drawing vertically.
1.1254 A positive value means that the top edge of the bitmap is above the origin.
1.1255 -
1.1256 +
1.1257 @param aVertBearingY The vertical bearing Y (in pixels). */
1.1258 inline void TOpenFontCharMetrics::SetVertBearingY(TInt aVertBearingY)
1.1259 {
1.1260 iVertBearingY = (TInt16)aVertBearingY;
1.1261 }
1.1262 -
1.1263 +
1.1264 /** Sets the vertical advance.
1.1265 -
1.1266 +
1.1267 When drawing vertically, this is the amount added to the y co-ordinate of
1.1268 the origin after the character is drawn what most people understand by
1.1269 the height of a character. The origin here is the pen point before the character
1.1270 is drawn.
1.1271 -
1.1272 +
1.1273 Note: Vertical drawing is not supported in v5.
1.1274 -
1.1275 +
1.1276 @param aVertAdvance The vertical advance (in pixels). */
1.1277 inline void TOpenFontCharMetrics::SetVertAdvance(TInt aVertAdvance)
1.1278 {
1.1279 iVertAdvance = (TInt16)aVertAdvance;
1.1280 }
1.1281 -
1.1282 +
1.1283 /** Gets the character metrics for this font.
1.1284 -
1.1285 +
1.1286 @return The character metrics for this font. */
1.1287 inline const TOpenFontMetrics& COpenFont::Metrics() const
1.1288 {
1.1289 @@ -1547,56 +1471,56 @@
1.1290 }
1.1291
1.1292 /** Gets the glyph index.
1.1293 -
1.1294 +
1.1295 This is the index of a particular glyph within the font file.
1.1296 -
1.1297 +
1.1298 Note: This makes it possible to gain access to glyphs which are not referenced
1.1299 by the Unicode character set. However, this feature is not yet supported by
1.1300 Symbian OS.
1.1301 -
1.1302 +
1.1303 @return The glyph index.
1.1304 @see SetGlyphIndex() */
1.1305 inline TInt TOpenFontGlyphData::GlyphIndex() const
1.1306 {
1.1307 return iGlyphIndex;
1.1308 }
1.1309 -
1.1310 +
1.1311 /** Gets the typeface attributes.
1.1312 -
1.1313 +
1.1314 These are the attributes of the font represented by this object.
1.1315 -
1.1316 +
1.1317 @return The typeface attributes. */
1.1318 inline const TOpenFontFaceAttrib* COpenFont::FaceAttrib() const
1.1319 {
1.1320 - return iFile ? &iFile->FaceAttrib(iFaceIndex) : NULL;
1.1321 + return iFileOffset == 0 ? NULL : &File()->FaceAttrib(iFaceIndex);
1.1322 }
1.1323 -
1.1324 +
1.1325 /** Gets a pointer to the COpenFontFile which created this object.
1.1326 -
1.1327 +
1.1328 This is the COpenFontFile which owns the file that contains the definition
1.1329 of the typeface. It can be used to get information about the typeface, or
1.1330 to access the rasterizer context (engine).
1.1331 -
1.1332 +
1.1333 @return The COpenFontFile which created this object. */
1.1334 inline COpenFontFile* COpenFont::File() const
1.1335 {
1.1336 - return iFile;
1.1337 + return iFileOffset == 0 ? NULL : reinterpret_cast<COpenFontFile*>(const_cast<COpenFont*>(PtrAdd(this, iFileOffset)));
1.1338 }
1.1339 -
1.1340 +
1.1341 /** Gets the index of this typeface within the font file.
1.1342 -
1.1343 +
1.1344 @return The index of this typeface within the font file. */
1.1345 inline TInt COpenFont::FaceIndex() const
1.1346 {
1.1347 return iFaceIndex;
1.1348 }
1.1349 -
1.1350 +
1.1351 /** Tests whether or not a character needs to be rasterized.
1.1352 -
1.1353 +
1.1354 Characters that have been rasterized are cached there is no need to regenerate
1.1355 the character bitmap. This function should only be called by the Font and
1.1356 Bitmap server.
1.1357 -
1.1358 +
1.1359 @param aSessionHandle A handle to the font and bitmap server session.
1.1360 @param aCode The code for the Unicode character.
1.1361 @return ETrue if the character needs to be rasterized, otherwise EFalse. */
1.1362 @@ -1702,16 +1626,16 @@
1.1363 }
1.1364
1.1365 /** Default C++ constructor.
1.1366 -
1.1367 +
1.1368 This sets all attribute fields to zero. As for other T classes, there is no
1.1369 need to explicitly clean-up objects derived from this class. */
1.1370 inline TOpenFontFaceAttribBase::TOpenFontFaceAttribBase()
1.1371 {
1.1372 Mem::FillZ(this,sizeof(*this));
1.1373 }
1.1374 -
1.1375 +
1.1376 /** Default C++ constructor.
1.1377 -
1.1378 +
1.1379 The function initialises the minimum typeface size to zero, the names to NULL,
1.1380 and the coverage and style flags to zero. */
1.1381 inline TOpenFontFaceAttrib::TOpenFontFaceAttrib():
1.1382 @@ -1719,195 +1643,195 @@
1.1383 iReserved2(0)
1.1384 {
1.1385 }
1.1386 -
1.1387 +
1.1388 /** Tests for support of Latin characters.
1.1389 -
1.1390 +
1.1391 Note: A return value of ETrue implies that the font has a usable set of
1.1392 characters. It does not imply exhaustive coverage.
1.1393 -
1.1394 +
1.1395 @return ETrue if Latin characters are supported */
1.1396 inline TBool TOpenFontFaceAttribBase::HasLatin() const
1.1397 {
1.1398 return iCoverage[0] & ELatinSet;
1.1399 }
1.1400 -
1.1401 +
1.1402 /** Tests for support of Greek characters.
1.1403 -
1.1404 +
1.1405 Note: A return value of ETrue implies that the font has a usable set of
1.1406 characters. It does not imply exhaustive coverage.
1.1407 -
1.1408 +
1.1409 @return ETrue if Greek characters are supported. */
1.1410 inline TBool TOpenFontFaceAttribBase::HasGreek() const
1.1411 {
1.1412 return iCoverage[0] & EGreekSet;
1.1413 }
1.1414 -
1.1415 +
1.1416 /** Tests for support of Cyrillic characters.
1.1417 -
1.1418 +
1.1419 Note: A return value of ETrue implies that the font has a usable set of
1.1420 characters. It does not imply exhaustive coverage.
1.1421 -
1.1422 +
1.1423 @return ETrue if Cyrillic characters are supported. */
1.1424 inline TBool TOpenFontFaceAttribBase::HasCyrillic() const
1.1425 {
1.1426 return iCoverage[0] & ECyrillicSet;
1.1427 }
1.1428 -
1.1429 +
1.1430 /** Tests for support of Japanese syllabic characters.
1.1431 -
1.1432 +
1.1433 This function tests for the presence of Hiragana and Katakana syllabic
1.1434 characters in the font, collectively called kana. These characters are not
1.1435 sufficient for the Japanese language, which also makes use of Chinese characters.
1.1436 -
1.1437 +
1.1438 Note: A return value of ETrue implies that the font has a usable set of
1.1439 characters. It does not imply exhaustive coverage.
1.1440 -
1.1441 +
1.1442 @return ETrue if Japanese characters are supported
1.1443 @see HasCJK() */
1.1444 inline TBool TOpenFontFaceAttribBase::HasKana() const
1.1445 {
1.1446 return iCoverage[1] & EKanaSets;
1.1447 }
1.1448 -
1.1449 +
1.1450 /** Tests for support of Korean Hangul characters.
1.1451 -
1.1452 +
1.1453 Korean may also make use of Chinese characters.
1.1454 -
1.1455 +
1.1456 Note: A return value of ETrue implies that the font has a usable set of
1.1457 characters. It does not imply exhaustive coverage.
1.1458 -
1.1459 +
1.1460 @return ETrue if Korean characters are supported
1.1461 @see HasCJK() */
1.1462 inline TBool TOpenFontFaceAttribBase::HasHangul() const
1.1463 {
1.1464 return iCoverage[1] & EHangulSet;
1.1465 }
1.1466 -
1.1467 +
1.1468 /** Tests for support of Chinese ideographic characters.
1.1469 -
1.1470 +
1.1471 These are used in Chinese, Japanese and Korean.
1.1472 -
1.1473 +
1.1474 Note: A return value of ETrue implies that the font has a usable set of
1.1475 characters. It does not imply exhaustive coverage.
1.1476 -
1.1477 +
1.1478 @return ETrue if Chinese ideographs are supported. */
1.1479 inline TBool TOpenFontFaceAttribBase::HasCJK() const
1.1480 {
1.1481 return iCoverage[1] & ECJKSet;
1.1482 }
1.1483 -
1.1484 +
1.1485 /** Tests if the typeface contains symbols only.
1.1486 -
1.1487 +
1.1488 @return ETrue if the typeface contains symbols only. */
1.1489 inline TBool TOpenFontFaceAttribBase::IsSymbol() const
1.1490 {
1.1491 return iCoverage[0] == 0 && iCoverage[2] == 0 && iCoverage[3] == 0 &&
1.1492 iCoverage[1] & ESymbolSets && !(iCoverage[1] & ~ESymbolSets);
1.1493 }
1.1494 -
1.1495 +
1.1496 /** Tests if the typeface is inherently bold.
1.1497 -
1.1498 +
1.1499 @return ETrue if the typeface is inherently bold. */
1.1500 inline TBool TOpenFontFaceAttribBase::IsBold() const
1.1501 {
1.1502 return iStyle & EBold;
1.1503 }
1.1504 -
1.1505 +
1.1506 /** Tests if the typeface is inherently italic.
1.1507 -
1.1508 +
1.1509 @return ETrue if the typeface is inherently italic. */
1.1510 inline TBool TOpenFontFaceAttribBase::IsItalic() const
1.1511 {
1.1512 return iStyle & EItalic;
1.1513 }
1.1514 -
1.1515 +
1.1516 /** Tests if the typeface has serifs.
1.1517 -
1.1518 +
1.1519 @return ETrue if the typeface has serifs. */
1.1520 inline TBool TOpenFontFaceAttribBase::IsSerif() const
1.1521 {
1.1522 return iStyle & ESerif;
1.1523 }
1.1524 -
1.1525 +
1.1526 /** Tests if all the characters have the same width.
1.1527 -
1.1528 +
1.1529 @return ETrue if all the characters have the same width. */
1.1530 inline TBool TOpenFontFaceAttribBase::IsMonoWidth() const
1.1531 {
1.1532 return iStyle & EMonoWidth;
1.1533 }
1.1534 -
1.1535 +
1.1536 /** Gets the typeface's name.
1.1537 -
1.1538 +
1.1539 @return Descriptor containing typeface name. */
1.1540 inline TPtrC TOpenFontFaceAttribBase::Name() const
1.1541 {
1.1542 return iName;
1.1543 }
1.1544 -
1.1545 +
1.1546 /** Gets the full name.
1.1547 -
1.1548 +
1.1549 The full name of the typeface includes style attributes like Italic, Bold,
1.1550 and Cursive.
1.1551 -
1.1552 +
1.1553 @return The full name of the typeface.
1.1554 @see FamilyName() */
1.1555 inline TPtrC TOpenFontFaceAttrib::FullName() const
1.1556 {
1.1557 return Name();
1.1558 }
1.1559 -
1.1560 +
1.1561 /** Gets the family name.
1.1562 -
1.1563 +
1.1564 Note: The family name of the typeface does not include style attributes like
1.1565 "Italic".
1.1566 -
1.1567 +
1.1568 @return The family name of the typeface.
1.1569 @see FullName() */
1.1570 inline TPtrC TOpenFontFaceAttrib::FamilyName() const
1.1571 {
1.1572 return iFamilyName;
1.1573 }
1.1574 -
1.1575 +
1.1576 /** Gets the local full name.
1.1577 -
1.1578 +
1.1579 The local full name of the typeface includes style attributes like Italic,
1.1580 Bold, and Cursive.
1.1581 -
1.1582 +
1.1583 The local name of the typeface is the name in the language of the current
1.1584 locale, where this is provided by the font file. If the local name is not
1.1585 available then the local name will be the same as the ordinary name.
1.1586 -
1.1587 +
1.1588 @return The local full name of the typeface. */
1.1589 inline TPtrC TOpenFontFaceAttrib::LocalFullName() const
1.1590 {
1.1591 return iLocalFullName;
1.1592 }
1.1593 -
1.1594 +
1.1595 /** Gets the local family name.
1.1596 -
1.1597 +
1.1598 The local name of the typeface is the name in the language of the current
1.1599 locale, where this is provided by the font file. If the local name is not
1.1600 available then the local name will be the same as the ordinary name.
1.1601 -
1.1602 +
1.1603 Note: The family name of the typeface does not include style attributes like
1.1604 'Italic'.
1.1605 -
1.1606 +
1.1607 @return The local family name of the typeface. */
1.1608 inline TPtrC TOpenFontFaceAttrib::LocalFamilyName() const
1.1609 {
1.1610 return iLocalFamilyName;
1.1611 }
1.1612 -
1.1613 +
1.1614 /** Gets the short full name.
1.1615 -
1.1616 +
1.1617 This is the full name of the typeface, truncated to KMaxTypefaceNameLength,
1.1618 if necessary.
1.1619 -
1.1620 +
1.1621 Note: Short names are names truncated to KMaxTypefaceNameLength (24) characters
1.1622 where necessary so that they can be used in the TTypeFace class. The Open
1.1623 Font Framework allows 32 characters as a maximum name length.
1.1624 -
1.1625 +
1.1626 @return The short full name of the typeface.
1.1627 @see FullName() */
1.1628 inline TPtrC TOpenFontFaceAttrib::ShortFullName() const
1.1629 @@ -1915,62 +1839,62 @@
1.1630 // Can't use TDesC::Left for this because it panics if the desired length is > the existing length!
1.1631 return TPtrC(iName.Ptr(),Min(iName.Length(),KMaxTypefaceNameLength));
1.1632 }
1.1633 -
1.1634 +
1.1635 /** Gets the short family name.
1.1636 -
1.1637 +
1.1638 This is the family name, truncated to KMaxTypefaceNameLength, if necessary.
1.1639 -
1.1640 +
1.1641 Note: Short names are names truncated to KMaxTypefaceNameLength (24) characters
1.1642 where necessary so that they can be used in the TTypeFace class. The Open
1.1643 Font Framework allows 32 characters as a maximum name length.
1.1644 -
1.1645 +
1.1646 @return The short family name of the typeface.
1.1647 @see FamilyName() */
1.1648 inline TPtrC TOpenFontFaceAttrib::ShortFamilyName() const
1.1649 {
1.1650 return TPtrC(iFamilyName.Ptr(),Min(iFamilyName.Length(),KMaxTypefaceNameLength));
1.1651 }
1.1652 -
1.1653 +
1.1654 /** Gets the short local full name.
1.1655 -
1.1656 +
1.1657 This is the local full name of the typeface, truncated to KMaxTypefaceNameLength,
1.1658 if necessary.
1.1659 -
1.1660 +
1.1661 Note: Short names are names truncated to KMaxTypefaceNameLength (24) characters
1.1662 where necessary so that they can be used in the TTypeFace class. The Open
1.1663 Font Framework allows 32 characters as a maximum name length.
1.1664 -
1.1665 +
1.1666 @return The short local full name of the typeface.
1.1667 @see LocalFullName() */
1.1668 inline TPtrC TOpenFontFaceAttrib::ShortLocalFullName() const
1.1669 {
1.1670 return TPtrC(iLocalFullName.Ptr(),Min(iLocalFullName.Length(),KMaxTypefaceNameLength));
1.1671 }
1.1672 -
1.1673 +
1.1674 /** Gets the short local family name.
1.1675 -
1.1676 +
1.1677 This is the local family name of the typeface, truncated to KMaxTypefaceNameLength,
1.1678 if necessary.
1.1679 -
1.1680 +
1.1681 Note: Short names are names truncated to KMaxTypefaceNameLength (24) characters
1.1682 where necessary so that they can be used in the TTypeFace class. The Open
1.1683 Font Framework allows 32 characters as a maximum name length.
1.1684 -
1.1685 +
1.1686 @return The short local family name of the typeface.
1.1687 @see LocalFamilyName() */
1.1688 inline TPtrC TOpenFontFaceAttrib::ShortLocalFamilyName() const
1.1689 {
1.1690 return TPtrC(iLocalFamilyName.Ptr(),Min(iLocalFamilyName.Length(),KMaxTypefaceNameLength));
1.1691 }
1.1692 -
1.1693 +
1.1694 /** Gets a pointer to the sets of flags that indicate the font's Unicode coverage.
1.1695 -
1.1696 +
1.1697 Each flag that is set represents a supported Unicode range. The mapping is
1.1698 defined in the TrueType documentation under the OS/2 table.
1.1699 -
1.1700 +
1.1701 Note: Some useful subsets are defined as anonymous enumerated constants at the end
1.1702 of this class, see ELatinSet etc.
1.1703 -
1.1704 +
1.1705 @return A pointer to the flags that indicate the font's Unicode coverage.
1.1706 The flags are stored in an array of four 32-bit integers. When no information
1.1707 is available, all four integers are zero.
1.1708 @@ -1979,54 +1903,54 @@
1.1709 {
1.1710 return iCoverage;
1.1711 }
1.1712 -
1.1713 +
1.1714 /** Gets the minimum typeface size.
1.1715 -
1.1716 +
1.1717 This is the smallest size that can be drawn legibly.
1.1718 -
1.1719 +
1.1720 @return The minimum typeface size (in pixels). */
1.1721 inline TInt TOpenFontFaceAttrib::MinSizeInPixels() const
1.1722 {
1.1723 return iMinSizeInPixels;
1.1724 }
1.1725 -
1.1726 +
1.1727 /** Sets the name attribute.
1.1728 -
1.1729 +
1.1730 @param aName Descriptor containing typeface name. */
1.1731 inline void TOpenFontFaceAttribBase::SetName(const TDesC& aName)
1.1732 {
1.1733 iName = TPtrC(aName.Ptr(),Min(aName.Length(),(TInt)ENameLength));
1.1734 }
1.1735 -
1.1736 +
1.1737 /** Sets the full name.
1.1738 -
1.1739 +
1.1740 @param aName The full name of the typeface.
1.1741 @see FullName() */
1.1742 inline void TOpenFontFaceAttrib::SetFullName(const TDesC& aName)
1.1743 {
1.1744 SetName(aName);
1.1745 }
1.1746 -
1.1747 +
1.1748 /** Sets the family name.
1.1749 -
1.1750 +
1.1751 @param aName The family name of the typeface.
1.1752 @see FamilyName() */
1.1753 inline void TOpenFontFaceAttrib::SetFamilyName(const TDesC& aName)
1.1754 {
1.1755 iFamilyName = TPtrC(aName.Ptr(),Min(aName.Length(),(TInt)ENameLength));
1.1756 }
1.1757 -
1.1758 +
1.1759 /** Sets the local full name.
1.1760 -
1.1761 +
1.1762 @param aName The local full name of the typeface.
1.1763 @see LocalFullName() */
1.1764 inline void TOpenFontFaceAttrib::SetLocalFullName(const TDesC& aName)
1.1765 {
1.1766 iLocalFullName = TPtrC(aName.Ptr(),Min(aName.Length(),(TInt)ENameLength));
1.1767 }
1.1768 -
1.1769 +
1.1770 /** Sets the local family name.
1.1771 -
1.1772 +
1.1773 @param aName The local family name of the typeface.
1.1774 @see LocalFamilyName() */
1.1775 inline void TOpenFontFaceAttrib::SetLocalFamilyName(const TDesC& aName)
1.1776 @@ -2055,24 +1979,24 @@
1.1777 iCoverage[2] = aCoverage2;
1.1778 iCoverage[3] = aCoverage3;
1.1779 }
1.1780 -
1.1781 +
1.1782 /** Set the minimum typeface size.
1.1783 -
1.1784 +
1.1785 This is the smallest size that can be drawn legibly.
1.1786 -
1.1787 +
1.1788 @param aSize Sets the minimum typeface size (in pixels).
1.1789 @see MinSizeInPixels() */
1.1790 inline void TOpenFontFaceAttrib::SetMinSizeInPixels(TInt aSize)
1.1791 {
1.1792 iMinSizeInPixels = aSize;
1.1793 }
1.1794 -
1.1795 +
1.1796 /** Equality operator.
1.1797 -
1.1798 +
1.1799 Compares this and another set of font attributes, including the coverage,
1.1800 the family name, the local full name, the local family name, and the minimum
1.1801 size in pixels.
1.1802 -
1.1803 +
1.1804 @param aAttrib Contains the font attributes and names to compare.
1.1805 @return ETrue if all values are equal, EFalse if not. */
1.1806 inline TBool TOpenFontFaceAttrib::operator==(const TOpenFontFaceAttrib& aAttrib) const
1.1807 @@ -2096,7 +2020,7 @@
1.1808 }
1.1809
1.1810 /** Sets the italic attribute.
1.1811 -
1.1812 +
1.1813 @param aItalic The italic attribute takes this value ETrue or EFalse. */
1.1814 inline void TOpenFontFaceAttribBase::SetItalic(TBool aItalic)
1.1815 {
1.1816 @@ -2105,9 +2029,9 @@
1.1817 else
1.1818 iStyle &= ~EItalic;
1.1819 }
1.1820 -
1.1821 +
1.1822 /** Sets the serif attribute.
1.1823 -
1.1824 +
1.1825 @param aSerif The serif attribute takes this value ETrue or EFalse. */
1.1826 inline void TOpenFontFaceAttribBase::SetSerif(TBool aSerif)
1.1827 {
1.1828 @@ -2129,12 +2053,12 @@
1.1829 }
1.1830
1.1831 /** Equality operator.
1.1832 -
1.1833 +
1.1834 Compares this and a specified set of font attributes, including the coverage
1.1835 and the typeface name.
1.1836 -
1.1837 +
1.1838 In version 6.1, and earlier, the return value was TInt.
1.1839 -
1.1840 +
1.1841 @param aAttrib The font attributes to compare. This is an object of TOpenFontFaceAttribBase
1.1842 or of a derived class.
1.1843 @return ETrue if the values are equal. */
1.1844 @@ -2169,34 +2093,34 @@
1.1845 }
1.1846
1.1847 /** Gets the height of the font.
1.1848 -
1.1849 +
1.1850 @return The height of the font, in pixels or twips.
1.1851 @see SetHeight() */
1.1852 inline TInt TOpenFontSpec::Height() const
1.1853 {
1.1854 return iHeight;
1.1855 }
1.1856 -
1.1857 +
1.1858 /** Gets the algorithmic width factor.
1.1859 -
1.1860 +
1.1861 @return The algorithmic width factor as a 16.16 fixed-point number.
1.1862 @see SetWidthFactor() */
1.1863 inline TInt32 TOpenFontSpec::WidthFactor() const
1.1864 {
1.1865 return iWidthFactor;
1.1866 }
1.1867 -
1.1868 +
1.1869 /** Gets the algorithmic slant factor.
1.1870 -
1.1871 +
1.1872 @return The algorithmic slant factor as a 16.16 fixed-point number.
1.1873 @see SetSlantFactor() */
1.1874 inline TInt32 TOpenFontSpec::SlantFactor() const
1.1875 {
1.1876 return iSlantFactor;
1.1877 }
1.1878 -
1.1879 +
1.1880 /** Gets the anti-aliasing setting for the font, as set by SetBitmapType().
1.1881 -
1.1882 +
1.1883 @return Indicates whether or not the font should be drawn using anti-aliasing. */
1.1884 inline TGlyphBitmapType TOpenFontSpec::BitmapType() const
1.1885 {
1.1886 @@ -2217,15 +2141,15 @@
1.1887 }
1.1888
1.1889 /** Gets the print position.
1.1890 -
1.1891 +
1.1892 @return The print position. */
1.1893 inline TFontPrintPosition TOpenFontSpec::PrintPosition() const
1.1894 {
1.1895 return iPrintPosition;
1.1896 }
1.1897 -
1.1898 +
1.1899 /** Sets the font's height.
1.1900 -
1.1901 +
1.1902 @param aHeight The font's height, in pixels or twips.
1.1903 @see Height() */
1.1904 inline void TOpenFontSpec::SetHeight(TInt aHeight)
1.1905 @@ -2234,46 +2158,46 @@
1.1906 }
1.1907
1.1908 /** Sets the algorithmic width factor.
1.1909 -
1.1910 +
1.1911 The width factor is multiplied by the pixel's x position to get the new position,
1.1912 causing characters to become wider or narrower. A width factor of 1 (65536
1.1913 in 16.16 fixed-point number format) should be used if the character width
1.1914 is not to be changed.
1.1915 -
1.1916 +
1.1917 @param aWidthFactor The algorithmic width factor as a 16.16 fixed-point number.
1.1918 @see WidthFactor() */
1.1919 inline void TOpenFontSpec::SetWidthFactor(TInt32 aWidthFactor)
1.1920 {
1.1921 iWidthFactor = aWidthFactor;
1.1922 }
1.1923 -
1.1924 +
1.1925 /** Sets the algorithmic slant factor.
1.1926 -
1.1927 +
1.1928 Note: The slant factor is used to create an italic effect for characters which
1.1929 do not have an italic glyph in the typeface. When slanting is active, pixel x
1.1930 co-ordinates are shifted by a factor relative to the y co-ordinate (i.e. x
1.1931 = x + y x slant factor).
1.1932 -
1.1933 +
1.1934 The slant factor is a 32 bit, 16.16 fixed-point number. This means that the
1.1935 first 16 bits are treated as a whole number, and the second 16 as the fractional
1.1936 part. e.g. if aSlantFactor=0, there is no slant. If aSlantFactor=65536 this
1.1937 is equivalent to an integer slant value of 1, which causes a 45 degree slant
1.1938 on the character.
1.1939 -
1.1940 +
1.1941 @param aSlantFactor The slant factor as a 16.16 fixed-point number.
1.1942 @see SlantFactor() */
1.1943 inline void TOpenFontSpec::SetSlantFactor(TInt32 aSlantFactor)
1.1944 {
1.1945 iSlantFactor = aSlantFactor;
1.1946 }
1.1947 -
1.1948 +
1.1949 /** Sets whether the font should be drawn using anti-aliasing. If set, this value
1.1950 overrides the default setting (set by CFbsTypefaceStore::SetDefaultBitmapType())
1.1951 for this font.
1.1952 -
1.1953 +
1.1954 Anti-aliasing can only be used for scalable fonts. There is currently no anti-aliasing
1.1955 support for bitmapped fonts.
1.1956 -
1.1957 +
1.1958 @param aBitmapType Indicates whether or not the font should be drawn using
1.1959 anti-aliasing. */
1.1960 inline void TOpenFontSpec::SetBitmapType(TGlyphBitmapType aBitmapType)
1.1961 @@ -2295,26 +2219,26 @@
1.1962 }
1.1963
1.1964 /** Gets the font file's UID.
1.1965 -
1.1966 +
1.1967 @return The uid of the file. */
1.1968 inline TUid COpenFontFile::Uid() const
1.1969 {
1.1970 return iUid;
1.1971 }
1.1972 -
1.1973 +
1.1974 /** Gets the full path and filename of the font file
1.1975 -
1.1976 +
1.1977 This is the filename that was passed to the constructor when the object is
1.1978 created.
1.1979 -
1.1980 +
1.1981 @return The filename of the font file. */
1.1982 inline const TDesC& COpenFontFile::FileName() const
1.1983 {
1.1984 return iFileName;
1.1985 }
1.1986 -
1.1987 +
1.1988 /** Gets the typeface at a specified index in the typeface attribute array.
1.1989 -
1.1990 +
1.1991 @param aFaceIndex The index of the typeface for which the attributes are required.
1.1992 @return The attributes of the typeface with the specified index.
1.1993 @see AddFaceL()
1.1994 @@ -2323,7 +2247,7 @@
1.1995 {
1.1996 return iFaceAttrib[aFaceIndex];
1.1997 }
1.1998 -
1.1999 +
1.2000 /** Gets the number of typefaces in the typeface attributes array.
1.2001
1.2002 This is the number of typefaces in the font file: the attributes for each
1.2003 @@ -2336,17 +2260,17 @@
1.2004 {
1.2005 return iFaceAttrib.Count();
1.2006 }
1.2007 -
1.2008 +
1.2009 /** Increments a reference count by one.
1.2010 -
1.2011 +
1.2012 @see DecRefCount() */
1.2013 inline void COpenFontFile::IncRefCount()
1.2014 {
1.2015 iRefCount++;
1.2016 }
1.2017 -
1.2018 +
1.2019 /** Decrement a reference count by one.
1.2020 -
1.2021 +
1.2022 @return ETrue if the reference count has reached zero (i.e. is less than or
1.2023 equal to zero); EFalse if the reference count has not yet reached zero (i.e.
1.2024 is positive).
1.2025 @@ -2356,18 +2280,18 @@
1.2026 iRefCount--;
1.2027 return iRefCount <= 0;
1.2028 }
1.2029 -
1.2030 +
1.2031 /** Default C++ constructor. */
1.2032 inline COpenFontRasterizerContext::COpenFontRasterizerContext():
1.2033 iGlyphData(NULL)
1.2034 {
1.2035 }
1.2036 -
1.2037 +
1.2038 /** Start writing the glyph data.
1.2039 -
1.2040 +
1.2041 Use this function to initialise the buffer to which the glyph bitmap is to
1.2042 be written. Call WriteGlyphBit() to add bits to the buffer.
1.2043 -
1.2044 +
1.2045 @param aGlyphData A pointer to the glyph data. */
1.2046 inline void COpenFontRasterizerContext::StartGlyph(TOpenFontGlyphData* aGlyphData)
1.2047 {
1.2048 @@ -2381,11 +2305,11 @@
1.2049 iBytesNeeded = 1;
1.2050 iOverflow = FALSE;
1.2051 }
1.2052 -
1.2053 +
1.2054 /** Writes a bit to the glyph buffer.
1.2055 -
1.2056 +
1.2057 Before calling this function you should first call StartGlyph().
1.2058 -
1.2059 +
1.2060 @param aBit The bit to be added to the buffer. */
1.2061 inline void COpenFontRasterizerContext::WriteGlyphBit(TInt aBit)
1.2062 {
1.2063 @@ -2416,9 +2340,9 @@
1.2064 iOverflow = TRUE;
1.2065 iBytesNeeded++;
1.2066 }
1.2067 -
1.2068 +
1.2069 /** Completes writing glyph data.
1.2070 -
1.2071 +
1.2072 Use this function to complete writing the glyph bitmap to the buffer. Call
1.2073 it after adding all necessary bits using WriteGlyphBit(). */
1.2074 inline void COpenFontRasterizerContext::EndGlyph()
1.2075 @@ -2427,95 +2351,95 @@
1.2076 iGlyphData->SetBytesNeeded(iBytesNeeded + 4);
1.2077 iGlyphData = NULL;
1.2078 }
1.2079 -
1.2080 +
1.2081 /** Tests whether the bitmap buffer is large enough to hold the bitmap.
1.2082 -
1.2083 +
1.2084 @return ETrue if the bitmap will overflow its buffer, otherwise EFalse. */
1.2085 inline TBool TOpenFontGlyphData::Overflow() const
1.2086 {
1.2087 return iBytesNeeded > iBitmapBufferSize;
1.2088 }
1.2089 -
1.2090 +
1.2091 /** Gets the number of bytes needed to store the glyph bitmap.
1.2092 -
1.2093 +
1.2094 @return The number of bytes needed to store the glyph bitmap.
1.2095 @see SetBytesNeeded() */
1.2096 inline TInt TOpenFontGlyphData::BytesNeeded() const
1.2097 {
1.2098 return iBytesNeeded;
1.2099 }
1.2100 -
1.2101 +
1.2102 /** Gets a constant pointer descriptor containing the bitmap this object
1.2103 represents.
1.2104 -
1.2105 +
1.2106 @return Pointer descriptor for the glyph. */
1.2107 inline TPtrC8 TOpenFontGlyphData::Bitmap() const
1.2108 {
1.2109 return TPtrC8(iBitmap,iBytesNeeded);
1.2110 }
1.2111 -
1.2112 +
1.2113 /** Gets a pointer to the bitmap.
1.2114 -
1.2115 +
1.2116 This points either to the buffer used to write the bitmap when it is first
1.2117 rasterized, or to the cache if the character was already rasterized.
1.2118 -
1.2119 +
1.2120 @return A pointer to the bitmap. */
1.2121 inline const TUint8* TOpenFontGlyphData::BitmapPointer() const
1.2122 {
1.2123 return iBitmap;
1.2124 }
1.2125 -
1.2126 +
1.2127 /** Gets the character's metrics.
1.2128 -
1.2129 +
1.2130 @return The character's open font metrics. */
1.2131 inline const TOpenFontCharMetrics* TOpenFontGlyphData::Metrics() const
1.2132 {
1.2133 return iMetrics;
1.2134 }
1.2135 -
1.2136 +
1.2137 /** Gets a pointer to the start of the bitmap buffer.
1.2138 -
1.2139 +
1.2140 @return A pointer to the start of the bitmap buffer. */
1.2141 inline TUint8* TOpenFontGlyphData::BufferStart()
1.2142 {
1.2143 return iBitmapBuffer;
1.2144 }
1.2145 -
1.2146 +
1.2147 /** Gets a pointer to the end of the bitmap buffer.
1.2148 -
1.2149 +
1.2150 @return A pointer to the end of the bitmap buffer. */
1.2151 inline TUint8* TOpenFontGlyphData::BufferEnd()
1.2152 {
1.2153 return iBitmapBuffer + iBitmapBufferSize;
1.2154 }
1.2155 -
1.2156 +
1.2157 /** Sets the number of bytes needed to store the glyph bitmap.
1.2158 -
1.2159 +
1.2160 @param aBytes The number of bytes needed to store the glyph bitmap.
1.2161 @see BytesNeeded() */
1.2162 inline void TOpenFontGlyphData::SetBytesNeeded(TInt aBytes)
1.2163 {
1.2164 iBytesNeeded = aBytes;
1.2165 }
1.2166 -
1.2167 +
1.2168 /** Sets the pointer to the bitmap buffer.
1.2169 -
1.2170 +
1.2171 @param aBitmap The pointer to the bitmap buffer. */
1.2172 inline void TOpenFontGlyphData::SetBitmapPointer(const TUint8* aBitmap)
1.2173 {
1.2174 iBitmap = aBitmap;
1.2175 }
1.2176 -
1.2177 +
1.2178 /** Sets the character's metrics, passing a pointer to a TOpenFontCharMetrics object.
1.2179 -
1.2180 +
1.2181 @param aMetrics A pointer to the character's open font character metrics. */
1.2182 inline void TOpenFontGlyphData::SetMetricsPointer(const TOpenFontCharMetrics* aMetrics)
1.2183 {
1.2184 iMetrics = aMetrics;
1.2185 }
1.2186 -
1.2187 +
1.2188 /** Sets the bitmap and metrics pointers to point to the internal buffers.
1.2189 -
1.2190 +
1.2191 The alternative is that the pointers point to the cache of metrics and bitmaps
1.2192 that have already been rasterized. */
1.2193 inline void TOpenFontGlyphData::SetPointersToInternalBuffers()
1.2194 @@ -2523,55 +2447,31 @@
1.2195 iBitmap = iBitmapBuffer;
1.2196 iMetrics = &iMetricsBuffer;
1.2197 }
1.2198 -
1.2199 +
1.2200 /** Sets the character's metrics, passing a reference to a TOpenFontCharMetrics
1.2201 object.
1.2202 -
1.2203 -@param aMetrics The character's open font character metrics. */
1.2204 +
1.2205 +@param aMetrics The character's open font character metrics. */
1.2206 inline void TOpenFontGlyphData::SetMetrics(TOpenFontCharMetrics& aMetrics)
1.2207 {
1.2208 iMetricsBuffer = aMetrics;
1.2209 iMetrics = &iMetricsBuffer;
1.2210 }
1.2211 -
1.2212 +
1.2213 /** Sets the glyph index.
1.2214 -
1.2215 -@param aGlyphIndex The glyph index. */
1.2216 +
1.2217 +@param aGlyphIndex The glyph index. */
1.2218 inline void TOpenFontGlyphData::SetGlyphIndex(TInt aGlyphIndex)
1.2219 {
1.2220 iGlyphIndex = aGlyphIndex;
1.2221 }
1.2222 -
1.2223 -/** Uses ECOM plug-in framework to instantiate the Open Font rasterizer interface
1.2224 -implementation given its implementation UID.
1.2225 -
1.2226 -@param "TUid aInterfaceImplUid"
1.2227 - The UID of the interface implementation required
1.2228 -
1.2229 -@return "COpenFontRasterizer*"
1.2230 - A pointer to a COpenFontRasterizer object. */
1.2231 -inline COpenFontRasterizer* COpenFontRasterizer::NewL(TUid aInterfaceImplUid)
1.2232 -{
1.2233 - return reinterpret_cast <COpenFontRasterizer*> (
1.2234 - REComSession::CreateImplementationL(
1.2235 - aInterfaceImplUid,
1.2236 - _FOFF(COpenFontRasterizer, iDtor_ID_Key)));
1.2237 -}
1.2238 -
1.2239 -/** Default destructor */
1.2240 -inline COpenFontRasterizer::~COpenFontRasterizer()
1.2241 -{
1.2242 - REComSession::DestroyedImplementation(iDtor_ID_Key);
1.2243 -}
1.2244
1.2245 /** Uses ECOM plug-in framework to instantiate the shaper factory interface
1.2246 implementation given its implementation UID.
1.2247
1.2248 -@param "TUid aInterfaceImplUid"
1.2249 - The UID of the interface implementation required
1.2250 -
1.2251 -@return "CShaperFactory*"
1.2252 - A pointer to a CShaperFactory object. */
1.2253 +@param aInterfaceImplUid The UID of the interface implementation required
1.2254 +
1.2255 +@return CShaperFactory* A pointer to a CShaperFactory object. */
1.2256 inline CShaperFactory* CShaperFactory::NewL(TUid aInterfaceImplUid)
1.2257 {
1.2258 return reinterpret_cast <CShaperFactory*> (
1.2259 @@ -2586,4 +2486,4 @@
1.2260 REComSession::DestroyedImplementation(iDtor_ID_Key);
1.2261 }
1.2262
1.2263 -#endif // OPENFONT_H__
1.2264 +#endif // __OPENFONT_H__