207 public: |
207 public: |
208 /** The algorithmic font style. */ |
208 /** The algorithmic font style. */ |
209 TAlgStyle iAlgStyle; // must not move this member |
209 TAlgStyle iAlgStyle; // must not move this member |
210 |
210 |
211 private: |
211 private: |
212 // Binary Compatibility warning - data member iOpenFont is referenced by inline methods |
212 // Binary Compatibility warning - data member iOpenFont is referenced by inline methods |
213 RHeap* iHeap; |
213 RHeap* iHeap; |
214 TInt iFontBitmapOffset; |
214 TInt iFontBitmapOffset; |
215 COpenFont* iOpenFont; // if iOpenFont is non-null this is an open font and many functions are forwarded to it |
215 |
216 |
216 // In order to be able to work with the flexible memory model, iOpenFont is |
217 #ifdef FNTSTORE_SUPPORT_FMM |
217 // actually an offset from the address of this class. |
218 // If iOpenFontOffet is non-zero this is an open font |
218 // iOpenFont's type remains unchanged. |
219 TInt iOpenFontOffset; |
219 // As Qt code that uses OpenFont() must be able to run on new and old versions |
220 #else |
220 // of Symbian OS, it must be able to determine whether iOpenFont is a pointer or |
221 TUint32 iReserved; |
221 // an offset at run-time. Therefore an offset will have its lowest significant bit set to 1. |
222 #endif // FNTSTORE_SUPPORT_FMM |
222 // If iOpenFont is null, this object is not an open font. |
223 |
223 // Assumption: a pointer always has least significant bit value of zero. |
224 TUint32 iUniqueFontId; // unique id for this instance of this font |
224 COpenFont* iOpenFont; // if iOpenFont is non-null this is an open font and many functions are forwarded to it |
|
225 |
|
226 TUint32 iReserved; |
|
227 TUint32 iUniqueFontId; // unique id for this instance of this font |
225 }; |
228 }; |
226 |
229 |
227 /** |
230 /** |
228 WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases. |
231 WARNING: Class for internal and partner use ONLY. Compatibility is not guaranteed in future releases. |
229 @publishedAll |
232 @publishedAll |
457 EFalse if it is using a bitmap font (a CFontBitmap). |
460 EFalse if it is using a bitmap font (a CFontBitmap). |
458 @see OpenFont() |
461 @see OpenFont() |
459 */ |
462 */ |
460 inline TBool CBitmapFont::IsOpenFont() const |
463 inline TBool CBitmapFont::IsOpenFont() const |
461 { |
464 { |
462 #ifdef FNTSTORE_SUPPORT_FMM |
|
463 return iOpenFontOffset!=0; |
|
464 #else |
|
465 return iOpenFont != NULL; |
465 return iOpenFont != NULL; |
466 #endif // FNTSTORE_SUPPORT_FMM |
|
467 } |
466 } |
468 |
467 |
469 #ifdef FNTSTORE_SUPPORT_FMM |
468 |
470 /** Returns a pointer to the open font being used by the bitmap font object. |
469 /** Returns a pointer to the open font being used by the bitmap font object. |
471 |
470 |
472 @return A pointer to an open font. |
471 @return A pointer to an open font. |
473 @see IsOpenFont() |
472 @see IsOpenFont() |
474 */ |
473 */ |
475 inline COpenFont* CBitmapFont::OpenFont() const |
474 inline COpenFont* CBitmapFont::OpenFont() const |
476 { |
475 { |
477 if (IsOpenFont()) |
476 if (reinterpret_cast<TInt>(iOpenFont) & 1) |
478 { |
477 { |
479 return reinterpret_cast<COpenFont*>(reinterpret_cast<TInt>(this)+iOpenFontOffset); |
478 return reinterpret_cast<COpenFont*>(const_cast<CBitmapFont*>(PtrAdd(this, reinterpret_cast<TInt>(iOpenFont) & ~1))); |
480 } |
479 } |
481 return NULL; |
480 else |
|
481 { |
|
482 return iOpenFont; |
|
483 } |
482 } |
484 } |
483 #else |
|
484 /** Returns a pointer to the open font being used by the bitmap font object. |
|
485 |
|
486 @return A pointer to an open font. |
|
487 @see IsOpenFont() |
|
488 */ |
|
489 inline COpenFont* CBitmapFont::OpenFont() const |
|
490 { |
|
491 return iOpenFont; |
|
492 } |
|
493 #endif // FNTSTORE_SUPPORT_FMM |
|
494 |
485 |
495 /** Gets the anti-aliasing setting for the font, see TGlyphBitmapType for |
486 /** Gets the anti-aliasing setting for the font, see TGlyphBitmapType for |
496 the range of values. |
487 the range of values. |
497 |
488 |
498 This is only applicable to open fonts (COpenFonts) not bitmap fonts (CBitmapFonts). |
489 This is only applicable to open fonts (COpenFonts) not bitmap fonts (CBitmapFonts). |