×
Namespaces

Variants
Actions
Revision as of 07:13, 18 September 2009 by Forum Nokia KB (Talk | contribs)

Archived:Custom font files don't work properly on S60 3rd Edition (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search


Template:KBKI

Article Metadata
Tested with
Devices(s): Tested on Nokia N73
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Keywords: CWsScreenDevice::AddFile
Created: (18 Sep 2014)
Last edited: Forum Nokia KB (18 Sep 2009)

Description

Custom (TTF of GDR) fonts can be used in an application by loading the font file using the CWsScreenDevice::AddFile() function. In S60 3rd Edition devices, adding a new font file works only the first time. Once the application is restarted, adding the custom font fails (a system font is selected instead).

How to reproduce

The issue can be reproduced using the following code snippet.

 CFont* font;
TInt fontId;<br>
CWsScreenDevice* dev = CEikonEnv::Static()->ScreenDevice();<br>
 
dev->AddFile( _L("c:\\data\\sample.ttf"), fontId );<br>
const CFont* logicalFont = AknLayoutUtils::FontFromId( EAknLogicalFontSecondaryFont );<br>
TFontSpec fontSpec = logicalFont->FontSpecInTwips();
TFontSpec myFontSpec( _L("MyTypeface"), fontSpec.iHeight );<br>
dev->GetNearestFontToDesignHeightInTwips( font, myFontSpec );<br>

Solution

This issue is fixed in S60 3rd Edition, Feature Pack 1 devices (and onwards).

Workaround for affected devices:

As a workaround, implement a check at application startup for whether the font file is already added to the typeface store; ie. only call AddFile() once.

See also

TSS001192 - Using application-specific custom fonts
TSS001193 - Removing font file lock during uninstallation

49 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×