fontservices/fontstore/src/FNTSTORE.CPP
branchRCL_3
changeset 1 e96e8a131979
parent 0 1fb32624e06b
child 2 6971d1c87c9a
equal deleted inserted replaced
0:1fb32624e06b 1:e96e8a131979
    72 We can't return 2^32 - 1 sizes, or something that reflect the fact
    72 We can't return 2^32 - 1 sizes, or something that reflect the fact
    73 that any size is okay, because a UI will probably try to create a listbox containing all the sizes.
    73 that any size is okay, because a UI will probably try to create a listbox containing all the sizes.
    74 
    74 
    75 Array stored in Twips as that is the only form of the value currently used.
    75 Array stored in Twips as that is the only form of the value currently used.
    76 @internalComponent
    76 @internalComponent
    77 */
    77 */ 
    78 #define POINTSIZE_IN_TWIPS(p)	((p) * 20)
    78 #define POINTSIZE_IN_TWIPS(p)	((p) * 20)
    79 const TInt gOpenFontSizeInTwipsArray[] =
    79 const TInt gOpenFontSizeInTwipsArray[] =
    80 	{
    80 	{
    81 	// 4pt-18pt in steps of 1pt (15 sizes)
    81 	// 4pt-18pt in steps of 1pt (15 sizes)
    82 	POINTSIZE_IN_TWIPS(4), POINTSIZE_IN_TWIPS(5), POINTSIZE_IN_TWIPS(6),
    82 	POINTSIZE_IN_TWIPS(4), POINTSIZE_IN_TWIPS(5), POINTSIZE_IN_TWIPS(6),
   536 	const TFontSpec&	aFontSpecInTwips,
   536 	const TFontSpec&	aFontSpecInTwips,
   537 	const TAlgStyle&	aAlgStyle,
   537 	const TAlgStyle&	aAlgStyle,
   538 	COpenFont*			aOpenFont):
   538 	COpenFont*			aOpenFont):
   539 	iFontSpecInTwips(aFontSpecInTwips),
   539 	iFontSpecInTwips(aFontSpecInTwips),
   540 	iAlgStyle(aAlgStyle),
   540 	iAlgStyle(aAlgStyle),
   541 	iHeap(aHeap),
   541 	iHeap(aHeap)
   542 	iOpenFont(aOpenFont)
   542 	{
   543 	{
   543     // Set iOpenFont to be the offset of aOpenFont from the address of CBitmapFont.
   544 #ifdef FNTSTORE_SUPPORT_FMM
   544     // In order to be able to identify iOpenFont as an offset instead of a pointer,
   545 	iOpenFontOffset=reinterpret_cast<TInt>(aOpenFont)-reinterpret_cast<TInt>(this);
   545     // bitwise or the offset with 1.  Pointers will always be byte aligned (and therefore even).
   546 #endif // FNTSTORE_SUPPORT_FMM
   546     if (aOpenFont)
       
   547         {
       
   548         iOpenFont = reinterpret_cast<COpenFont*>((reinterpret_cast<TInt>(aOpenFont) - reinterpret_cast<TInt>(this)) | 1);
       
   549         __ASSERT_DEBUG((reinterpret_cast<TInt>(iOpenFont) & 1),Panic(EFntPointerNotByteAligned));
       
   550         }
       
   551     else
       
   552         {
       
   553         iOpenFont = NULL;
       
   554         }
   547 	}
   555 	}
   548 
   556 
   549 /** This member is private and not intended for use. */
   557 /** This member is private and not intended for use. */
   550 void CBitmapFont::ConstructL()
   558 void CBitmapFont::ConstructL()
   551 	{
   559 	{
   552 #ifdef FNTSTORE_SUPPORT_FMM
       
   553 	if (!IsOpenFont())
   560 	if (!IsOpenFont())
   554 		FontBitmap()->UseL();
   561 		FontBitmap()->UseL();
   555 #else
       
   556 	if (!iOpenFont)
       
   557 		FontBitmap()->UseL();	
       
   558 #endif // FNTSTORE_SUPPORT_FMM
       
   559 	}
   562 	}
   560 
   563 
   561 /** This member is private and not intended for use. */
   564 /** This member is private and not intended for use. */
   562 CBitmapFont::~CBitmapFont()
   565 CBitmapFont::~CBitmapFont()
   563 	{	
   566 	{	
   564 #ifdef FNTSTORE_SUPPORT_FMM
       
   565 	if (!IsOpenFont() && iFontBitmapOffset)
   567 	if (!IsOpenFont() && iFontBitmapOffset)
   566 		FontBitmap()->Release();
   568 		FontBitmap()->Release();
   567 	else if (IsOpenFont())
   569 	else if (IsOpenFont())
   568 		delete OpenFont();
   570 		delete OpenFont();
   569 #else
       
   570 	if (!iOpenFont)
       
   571 		FontBitmap()->Release();
       
   572 	delete iOpenFont;
       
   573 #endif // FNTSTORE_SUPPORT_FMM
       
   574 	}	
   571 	}	
   575 
   572 
   576 CBitmapFont* CBitmapFont::NewL(
   573 CBitmapFont* CBitmapFont::NewL(
   577 	RHeap*				aHeap,
   574 	RHeap*				aHeap,
   578 	const TFontSpec&	aFontSpecInTwips,
   575 	const TFontSpec&	aFontSpecInTwips,
   614 has the UID value of the CFontBitmap it uses.
   611 has the UID value of the CFontBitmap it uses.
   615 
   612 
   616 @return A font identifier. */
   613 @return A font identifier. */
   617 TUid CBitmapFont::Uid() const
   614 TUid CBitmapFont::Uid() const
   618 	{
   615 	{
   619 #ifdef FNTSTORE_SUPPORT_FMM
       
   620 	if (IsOpenFont())
   616 	if (IsOpenFont())
   621 		return TUid::Uid(0);	
   617 		return TUid::Uid(0);	
   622 #else
       
   623 	if (iOpenFont)
       
   624 		return TUid::Uid(0);	
       
   625 #endif // FNTSTORE_SUPPORT_FMM
       
   626 	else
   618 	else
   627 		return FontBitmap()->iUid;
   619 		return FontBitmap()->iUid;
   628 	}
   620 	}
   629 
   621 
   630 /** Returns the font height in pixels.
   622 /** Returns the font height in pixels.
   633 @return Font height in pixels.
   625 @return Font height in pixels.
   634 @see FontMaxHeight()
   626 @see FontMaxHeight()
   635 */
   627 */
   636 EXPORT_C TInt CBitmapFont::DoHeightInPixels() const
   628 EXPORT_C TInt CBitmapFont::DoHeightInPixels() const
   637 	{
   629 	{
   638 #ifdef FNTSTORE_SUPPORT_FMM
       
   639 	if (IsOpenFont())
   630 	if (IsOpenFont())
   640 		return Height(OpenFont()->Metrics().Size());	
   631 		return Height(OpenFont()->Metrics().Size());	
   641 #else
       
   642 	if (iOpenFont)
       
   643 		return Height(iOpenFont->Metrics().Size());	
       
   644 #endif // FNTSTORE_SUPPORT_FMM
       
   645 	else
   632 	else
   646 		return Height(FontBitmap()->iCellHeightInPixels);
   633 		return Height(FontBitmap()->iCellHeightInPixels);
   647 	}
   634 	}
   648 
   635 
   649 /** Returns the font ascent in pixels.
   636 /** Returns the font ascent in pixels.
   656 @see FontCapitalAscent()
   643 @see FontCapitalAscent()
   657 @see FontMaxAscent()
   644 @see FontMaxAscent()
   658 */
   645 */
   659 EXPORT_C TInt CBitmapFont::DoAscentInPixels() const
   646 EXPORT_C TInt CBitmapFont::DoAscentInPixels() const
   660 	{
   647 	{
   661 #ifdef FNTSTORE_SUPPORT_FMM
       
   662 	if (IsOpenFont())
   648 	if (IsOpenFont())
   663 		return Height(OpenFont()->Metrics().Ascent());	
   649 		return Height(OpenFont()->Metrics().Ascent());	
   664 #else
       
   665 	if (iOpenFont)
       
   666 		return Height(iOpenFont->Metrics().Ascent());	
       
   667 #endif // FNTSTORE_SUPPORT_FMM
       
   668 	else
   650 	else
   669 		return Height(FontBitmap()->iAscentInPixels);
   651 		return Height(FontBitmap()->iAscentInPixels);
   670 	}
   652 	}
   671 
   653 
   672 /** Returns the width, in pixels, of the given character.
   654 /** Returns the width, in pixels, of the given character.
   764 /** Returns the font's maximum character width in pixels.
   746 /** Returns the font's maximum character width in pixels.
   765 
   747 
   766 @return The maximum character width in pixels. */
   748 @return The maximum character width in pixels. */
   767 EXPORT_C TInt CBitmapFont::DoMaxCharWidthInPixels() const
   749 EXPORT_C TInt CBitmapFont::DoMaxCharWidthInPixels() const
   768 	{
   750 	{
   769 #ifdef FNTSTORE_SUPPORT_FMM
       
   770 	if (IsOpenFont())
   751 	if (IsOpenFont())
   771 		return Width(OpenFont()->Metrics().MaxWidth());	
   752 		return Width(OpenFont()->Metrics().MaxWidth());	
   772 #else
       
   773 	if (iOpenFont)
       
   774 		return Width(iOpenFont->Metrics().MaxWidth());	
       
   775 #endif // FNTSTORE_SUPPORT_FMM
       
   776 	else
   753 	else
   777 		return Width(FontBitmap()->iMaxCharWidthInPixels);
   754 		return Width(FontBitmap()->iMaxCharWidthInPixels);
   778 	}
   755 	}
   779 
   756 
   780 /** Returns the font's normal maximum character width in pixels.
   757 /** Returns the font's normal maximum character width in pixels.
   784 is used the value may be different.
   761 is used the value may be different.
   785 
   762 
   786 @return The normal maximum character width in pixels. */
   763 @return The normal maximum character width in pixels. */
   787 EXPORT_C TInt CBitmapFont::DoMaxNormalCharWidthInPixels() const
   764 EXPORT_C TInt CBitmapFont::DoMaxNormalCharWidthInPixels() const
   788 	{
   765 	{
   789 #ifdef FNTSTORE_SUPPORT_FMM
       
   790 	if (IsOpenFont())
   766 	if (IsOpenFont())
   791 		return Width(OpenFont()->Metrics().MaxWidth());
   767 		return Width(OpenFont()->Metrics().MaxWidth());
   792 #else
       
   793 	if (iOpenFont)
       
   794 		return Width(iOpenFont->Metrics().MaxWidth());
       
   795 #endif // FNTSTORE_SUPPORT_FMM
       
   796 	else
   768 	else
   797 		return Width(FontBitmap()->iMaxNormalCharWidthInPixels);
   769 		return Width(FontBitmap()->iMaxNormalCharWidthInPixels);
   798 	}
   770 	}
   799 
   771 
   800 /** Returns the device-independent font specification for the font.
   772 /** Returns the device-independent font specification for the font.
   825 @param aGlyphData A data area in shared memory.
   797 @param aGlyphData A data area in shared memory.
   826 @return ETrue if the character was successfully rasterized or was already in 
   798 @return ETrue if the character was successfully rasterized or was already in 
   827 the cache; otherwise EFalse. */
   799 the cache; otherwise EFalse. */
   828 EXPORT_C TBool CBitmapFont::Rasterize(TInt aSessionHandle, TInt aCode, TOpenFontGlyphData* aGlyphData) const
   800 EXPORT_C TBool CBitmapFont::Rasterize(TInt aSessionHandle, TInt aCode, TOpenFontGlyphData* aGlyphData) const
   829 	{
   801 	{
   830 #ifdef FNTSTORE_SUPPORT_FMM
       
   831 	if (IsOpenFont())
   802 	if (IsOpenFont())
   832 		return OpenFont()->Rasterize(aSessionHandle, aCode, aGlyphData);
   803 		return OpenFont()->Rasterize(aSessionHandle, aCode, aGlyphData);
   833 #else
       
   834 	if (iOpenFont)
       
   835 		return iOpenFont->Rasterize(aSessionHandle, aCode, aGlyphData);
       
   836 #endif // FNTSTORE_SUPPORT_FMM
       
   837 	else
   804 	else
   838 		return EFalse;
   805 		return EFalse;
   839 	}
   806 	}
   840 
   807 
   841 /** Gets a pointer to a bitmap and the metrics for a specified character, but only 
   808 /** Gets a pointer to a bitmap and the metrics for a specified character, but only 
   854 	{
   821 	{
   855 	/*
   822 	/*
   856 	This function does not work for Open Fonts because the character data need not be
   823 	This function does not work for Open Fonts because the character data need not be
   857 	shared between sessions and a session handle is needed; GetCharacterData should be used instead.
   824 	shared between sessions and a session handle is needed; GetCharacterData should be used instead.
   858 	*/
   825 	*/
   859 #ifdef FNTSTORE_SUPPORT_FMM
       
   860 	if (IsOpenFont())
   826 	if (IsOpenFont())
   861 #else
       
   862 	if (iOpenFont)
       
   863 #endif // FNTSTORE_SUPPORT_FMM
       
   864 		{
   827 		{
   865 		aBytes = NULL;
   828 		aBytes = NULL;
   866 		return TCharacterMetrics();
   829 		return TCharacterMetrics();
   867 		}
   830 		}
   868 
   831 
   906 @param aBitmap On return, a pointer to the bitmap for the specified character.
   869 @param aBitmap On return, a pointer to the bitmap for the specified character.
   907 @return ETrue if successful, otherwise EFalse. */
   870 @return ETrue if successful, otherwise EFalse. */
   908 EXPORT_C TBool CBitmapFont::GetCharacterData(TInt aSessionHandle,TInt aCode,
   871 EXPORT_C TBool CBitmapFont::GetCharacterData(TInt aSessionHandle,TInt aCode,
   909 											 TOpenFontCharMetrics& aMetrics,const TUint8*& aBitmap) const
   872 											 TOpenFontCharMetrics& aMetrics,const TUint8*& aBitmap) const
   910 	{
   873 	{
   911 #ifdef FNTSTORE_SUPPORT_FMM
       
   912 	if (IsOpenFont())
   874 	if (IsOpenFont())
   913 #else
       
   914 	if (iOpenFont)
       
   915 #endif // FNTSTORE_SUPPORT_FMM
       
   916 		{
   875 		{
   917 		const TOpenFontCharMetrics* nm;
   876 		const TOpenFontCharMetrics* nm;
   918 #ifdef FNTSTORE_SUPPORT_FMM
       
   919 		if (OpenFont()->GetCharacterData(aSessionHandle,aCode,nm,aBitmap))
   877 		if (OpenFont()->GetCharacterData(aSessionHandle,aCode,nm,aBitmap))
   920 #else
       
   921 		if (iOpenFont->GetCharacterData(aSessionHandle,aCode,nm,aBitmap))
       
   922 #endif // FNTSTORE_SUPPORT_FMM
       
   923 			{
   878 			{
   924 			aMetrics = *nm;
   879 			aMetrics = *nm;
   925 			return ETrue;
   880 			return ETrue;
   926 			}
   881 			}
   927 		else
   882 		else
   943 
   898 
   944 @param aMetrics Open font metrics. */
   899 @param aMetrics Open font metrics. */
   945  
   900  
   946 EXPORT_C void CBitmapFont::GetFontMetrics(TOpenFontMetrics& aMetrics) const
   901 EXPORT_C void CBitmapFont::GetFontMetrics(TOpenFontMetrics& aMetrics) const
   947 	{
   902 	{
   948 #ifdef FNTSTORE_SUPPORT_FMM
       
   949 	if (IsOpenFont())
   903 	if (IsOpenFont())
   950 		aMetrics = OpenFont()->Metrics();
   904 		aMetrics = OpenFont()->Metrics();
   951 #else
       
   952 	if (iOpenFont)
       
   953 		aMetrics = iOpenFont->Metrics();
       
   954 #endif // FNTSTORE_SUPPORT_FMM
       
   955 	else
   905 	else
   956 		{
   906 		{
   957 		new(&aMetrics) TOpenFontMetrics;
   907 		new(&aMetrics) TOpenFontMetrics;
   958 		aMetrics.SetSize(CBitmapFont::DoHeightInPixels());
   908 		aMetrics.SetSize(CBitmapFont::DoHeightInPixels());
   959 		aMetrics.SetAscent(CBitmapFont::DoAscentInPixels());
   909 		aMetrics.SetAscent(CBitmapFont::DoAscentInPixels());
   973 @param aAttrib On return, the open font typeface attributes.
   923 @param aAttrib On return, the open font typeface attributes.
   974 @return ETrue if successful; EFalse if not possible to get the open font typeface 
   924 @return ETrue if successful; EFalse if not possible to get the open font typeface 
   975 attributes. */
   925 attributes. */
   976 EXPORT_C TBool CBitmapFont::GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const
   926 EXPORT_C TBool CBitmapFont::GetFaceAttrib(TOpenFontFaceAttrib& aAttrib) const
   977 	{
   927 	{
   978 #ifdef FNTSTORE_SUPPORT_FMM
       
   979 	if (IsOpenFont())
   928 	if (IsOpenFont())
   980 #else
   929 		{
   981 	if (iOpenFont)
       
   982 #endif // FNTSTORE_SUPPORT_FMM
       
   983 		{
       
   984 #ifdef FNTSTORE_SUPPORT_FMM
       
   985 		const TOpenFontFaceAttrib* a = OpenFont()->FaceAttrib();
   930 		const TOpenFontFaceAttrib* a = OpenFont()->FaceAttrib();
   986 #else
       
   987 		const TOpenFontFaceAttrib* a = iOpenFont->FaceAttrib();
       
   988 #endif // FNTSTORE_SUPPORT_FMM
       
   989 		if (a)
   931 		if (a)
   990 			{
   932 			{
   991 			aAttrib = *a;
   933 			aAttrib = *a;
   992 			return ETrue;
   934 			return ETrue;
   993 			}
   935 			}
   998 /** Gets encoding if a bitmap font (a CFontBitmap) is used.
   940 /** Gets encoding if a bitmap font (a CFontBitmap) is used.
   999 
   941 
  1000 @return Bitmap encoding value. */
   942 @return Bitmap encoding value. */
  1001 EXPORT_C TInt CBitmapFont::BitmapEncoding() const
   943 EXPORT_C TInt CBitmapFont::BitmapEncoding() const
  1002 	{
   944 	{
  1003 #ifdef FNTSTORE_SUPPORT_FMM
       
  1004 	if (IsOpenFont())
   945 	if (IsOpenFont())
  1005 		return 0;
   946 		return 0;
  1006 #else
       
  1007 	if (iOpenFont)
       
  1008 		return 0;
       
  1009 #endif // FNTSTORE_SUPPORT_FMM
       
  1010 	else
   947 	else
  1011 		return FontBitmap()->iBitmapEncoding;
   948 		return FontBitmap()->iBitmapEncoding;
  1012 	}
   949 	}
  1013 
   950 
  1014 /** Gets whether the open or bitmap font has the specified character.
   951 /** Gets whether the open or bitmap font has the specified character.
  1015 
   952 
  1016 @param aCode A character code.
   953 @param aCode A character code.
  1017 @return ETrue if the font has the specified character; otherwise EFalse. */
   954 @return ETrue if the font has the specified character; otherwise EFalse. */
  1018 EXPORT_C TBool CBitmapFont::HasCharacterL(TInt aCode) const
   955 EXPORT_C TBool CBitmapFont::HasCharacterL(TInt aCode) const
  1019 	{
   956 	{
  1020 #ifdef FNTSTORE_SUPPORT_FMM
       
  1021 	if (IsOpenFont())
   957 	if (IsOpenFont())
  1022 		return OpenFont()->HasCharacterL(aCode);
   958 		return OpenFont()->HasCharacterL(aCode);
  1023 #else
       
  1024 	if (iOpenFont)
       
  1025 		return iOpenFont->HasCharacterL(aCode);
       
  1026 #endif // FNTSTORE_SUPPORT_FMM
       
  1027 	else
   959 	else
  1028 		{
   960 		{
  1029 		const TUint8* bytes;
   961 		const TUint8* bytes;
  1030 		FontBitmap()->CharacterMetrics(aCode,bytes);
   962 		FontBitmap()->CharacterMetrics(aCode,bytes);
  1031 		return (bytes != NULL);
   963 		return (bytes != NULL);
  1041 @param aSessionHandle A session handle for the open font system.
   973 @param aSessionHandle A session handle for the open font system.
  1042 @param aCode A character code.
   974 @param aCode A character code.
  1043 @return ETrue if the character needs to be rasterized; otherwise EFalse. */
   975 @return ETrue if the character needs to be rasterized; otherwise EFalse. */
  1044 EXPORT_C TBool CBitmapFont::CharacterNeedsToBeRasterized(TInt aSessionHandle,TInt aCode) const
   976 EXPORT_C TBool CBitmapFont::CharacterNeedsToBeRasterized(TInt aSessionHandle,TInt aCode) const
  1045 	{
   977 	{
  1046 #ifdef FNTSTORE_SUPPORT_FMM
       
  1047 	if (IsOpenFont())
   978 	if (IsOpenFont())
  1048 		return OpenFont()->CharacterNeedsToBeRasterized(aSessionHandle,aCode);
   979 		return OpenFont()->CharacterNeedsToBeRasterized(aSessionHandle,aCode);
  1049 #else
       
  1050 	if (iOpenFont)
       
  1051 		return iOpenFont->CharacterNeedsToBeRasterized(aSessionHandle,aCode);
       
  1052 #endif // FNTSTORE_SUPPORT_FMM
       
  1053 	else
   980 	else
  1054 		return FALSE;	// characters in bitmap fonts do not need to be rasterized	
   981 		return FALSE;	// characters in bitmap fonts do not need to be rasterized	
  1055 	}
   982 	}
  1056 
   983 
  1057 /** Turns text into glyph codes and positions.
   984 /** Turns text into glyph codes and positions.
  1175 	}
  1102 	}
  1176 
  1103 
  1177 CFontBitmap* CBitmapFont::FontBitmap() const
  1104 CFontBitmap* CBitmapFont::FontBitmap() const
  1178 /** This member is private and not intended for use. */
  1105 /** This member is private and not intended for use. */
  1179 	{
  1106 	{
  1180 #ifdef FNTSTORE_SUPPORT_FMM
  1107     __ASSERT_ALWAYS(!IsOpenFont(),Panic(EFntTypefaceHasNoFontBitmaps));
  1181 	__ASSERT_ALWAYS(!IsOpenFont(),Panic(EFntTypefaceHasNoFontBitmaps));
  1108     if(iFontBitmapOffset)
  1182 	if(iFontBitmapOffset)
  1109         return reinterpret_cast<CFontBitmap*>(reinterpret_cast<TInt>(this)+iFontBitmapOffset);
  1183 		return reinterpret_cast<CFontBitmap*>(reinterpret_cast<TInt>(this)+iFontBitmapOffset);
  1110     else
  1184 	else
  1111         return NULL;
  1185 		return NULL;
       
  1186 #else
       
  1187 	__ASSERT_ALWAYS(!iOpenFont,Panic(EFntTypefaceHasNoFontBitmaps));
       
  1188 	TInt fontbitmap=TInt(this)+iFontBitmapOffset;
       
  1189 	return((CFontBitmap*)fontbitmap);
       
  1190 #endif // FNTSTORE_SUPPORT_FMM
       
  1191 	}
  1112 	}
  1192 
  1113 
  1193 /** Gets a font table.
  1114 /** Gets a font table.
  1194 @param aTag: Input. The name of the font table.
  1115 @param aTag: Input. The name of the font table.
  1195 @param aTableContent: Output. To return the address of the table content.
  1116 @param aTableContent: Output. To return the address of the table content.
  1196 @param aLength: Output. To return the length (in bytes) of the table.
  1117 @param aLength: Output. To return the length (in bytes) of the table.
  1197 @param aSessionHandle: Input. A handle to the session requesting this table.
  1118 @param aSessionHandle: Input. A handle to the session requesting this table.
  1198 @return KErrNone on success, specific error code on failure.
  1119 @return KErrNone on success, specific error code on failure.
  1199 @internalTechnology
  1120 @internalTechnology
  1200 */
  1121 */
  1201 EXPORT_C
  1122 EXPORT_C TInt CBitmapFont::GetFontTable(TUint32 aTag, TAny *&aTableContent, 
  1202 TInt CBitmapFont::GetFontTable(TUint32 aTag, TAny *&aTableContent, 
       
  1203         TInt &aLength, TInt aSessionHandle) 
  1123         TInt &aLength, TInt aSessionHandle) 
  1204     {
  1124     {
  1205     COpenFont *fontPtr = NULL;
  1125     COpenFont *fontPtr = NULL;
  1206 #ifdef FNTSTORE_SUPPORT_FMM
       
  1207     if (IsOpenFont())
  1126     if (IsOpenFont())
  1208         fontPtr = OpenFont();
  1127         fontPtr = OpenFont();
  1209 #else
       
  1210     if (iOpenFont)
       
  1211         fontPtr = iOpenFont;
       
  1212 #endif // FNTSTORE_SUPPORT_FMM
       
  1213     else
  1128     else
  1214         return KErrNotSupported;
  1129         return KErrNotSupported;
  1215     
  1130     
  1216     // try to find it in cache.
  1131     // try to find it in cache.
  1217     CFontStore *fntStore = fontPtr->File()->GetFontStore();
  1132     CFontStore *fntStore = fontPtr->File()->GetFontStore();
  1250 */
  1165 */
  1251 EXPORT_C void CBitmapFont::ReleaseFontTable(TUint32 aTag, 
  1166 EXPORT_C void CBitmapFont::ReleaseFontTable(TUint32 aTag, 
  1252         TInt aSessionHandle)
  1167         TInt aSessionHandle)
  1253     {
  1168     {
  1254     COpenFont *fontPtr = NULL;
  1169     COpenFont *fontPtr = NULL;
  1255 #ifdef FNTSTORE_SUPPORT_FMM
       
  1256     if (IsOpenFont())
  1170     if (IsOpenFont())
  1257         fontPtr = OpenFont();
  1171         fontPtr = OpenFont();
  1258 #else
       
  1259     if (iOpenFont)
       
  1260         fontPtr = iOpenFont;
       
  1261 #endif // FNTSTORE_SUPPORT_FMM
       
  1262     else
  1172     else
  1263         return;
  1173         return;
  1264     
  1174     
  1265     CFontStore *fntStore = fontPtr->File()->GetFontStore();
  1175     CFontStore *fntStore = fontPtr->File()->GetFontStore();
  1266     TUid fileUid = fontPtr->File()->Uid();
  1176     TUid fileUid = fontPtr->File()->Uid();
  1282 */
  1192 */
  1283 EXPORT_C void CBitmapFont::ReleaseGlyphOutlines(TInt aCount, const TUint *aCodes, 
  1193 EXPORT_C void CBitmapFont::ReleaseGlyphOutlines(TInt aCount, const TUint *aCodes, 
  1284         TBool aHinted, TInt aSessionHandle)
  1194         TBool aHinted, TInt aSessionHandle)
  1285     {
  1195     {
  1286     COpenFont *fontPtr = NULL;
  1196     COpenFont *fontPtr = NULL;
  1287     #ifdef FNTSTORE_SUPPORT_FMM
       
  1288         if (IsOpenFont())
  1197         if (IsOpenFont())
  1289             fontPtr = OpenFont();
  1198             fontPtr = OpenFont();
  1290     #else
       
  1291         if (iOpenFont)
       
  1292             fontPtr = iOpenFont;
       
  1293     #endif // FNTSTORE_SUPPORT_FMM
       
  1294         else
  1199         else
  1295             return;
  1200             return;
  1296     
  1201     
  1297     CFontStore *fontStore = fontPtr->File()->GetFontStore();
  1202     CFontStore *fontStore = fontPtr->File()->GetFontStore();
  1298     
  1203     
  1326 */
  1231 */
  1327 EXPORT_C TInt CBitmapFont::GetGlyphOutline(TUint aCode, 
  1232 EXPORT_C TInt CBitmapFont::GetGlyphOutline(TUint aCode, 
  1328         TBool aHinted, TAny *&aOutline, TInt &aLength, TInt aSessionHandle)
  1233         TBool aHinted, TAny *&aOutline, TInt &aLength, TInt aSessionHandle)
  1329     {
  1234     {
  1330     COpenFont *fontPtr = NULL;
  1235     COpenFont *fontPtr = NULL;
  1331     #ifdef FNTSTORE_SUPPORT_FMM
       
  1332         if (IsOpenFont())
  1236         if (IsOpenFont())
  1333             fontPtr = OpenFont();
  1237             fontPtr = OpenFont();
  1334     #else
       
  1335         if (iOpenFont)
       
  1336             fontPtr = iOpenFont;
       
  1337     #endif // FNTSTORE_SUPPORT_FMM
       
  1338         else
  1238         else
  1339             return KErrNotSupported;
  1239             return KErrNotSupported;
  1340     
  1240     
  1341     CFontStore *fontStore = fontPtr->File()->GetFontStore();
  1241     CFontStore *fontStore = fontPtr->File()->GetFontStore();
  1342     TAny *outlineData = NULL; 
  1242     TAny *outlineData = NULL;