Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Listing available fonts using Symbian C++

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 6220 Classic, Nokia N95 8GB, Nokia 5800 XpressMusic
Platform(s): S60 3rd Edition, FP1, S60 3rd Edition, FP2, S60 5th Edition
S60 5th Edition
S60 3rd Edition (initial release)
Keywords: FontUtils, CGraphicsDevice, FontUtils::GetAvailableFontsL(), SystemGc().Device()
Created: tapla (22 Apr 2009)
Last edited: lpvalente (23 Sep 2014)



This snippet demonstrates how to list fonts that are available on the device.

This snippet can be self-signed.

MMP file

This snippet requires the following libraries:

LIBRARY bafl.lib  // CDesCArrayFlat
LIBRARY egul.lib // FontUtils

Header file: CSymbianStubAppView.h

class CSymbianStubAppView : public CCoeControl
public: // New methods
* Lists fonts available on the device

void ListAvailableFontsL();

Source file: CSymbianStubAppView.cpp

#include <badesca.h>  // CDesCArrayFlat
#include <gdi.h> // CGraphicsDevice
#include <gulutil.h> // FontUtils
void CSymbianStubAppView::ListAvailableFontsL()
CGraphicsDevice *dev = SystemGc().Device();
CDesCArrayFlat *fontNames = new (ELeave) CDesCArrayFlat(5);
FontUtils::GetAvailableFontsL(*dev, *fontNames, EGulAllFonts);
// Print the font names on the screen
for (TInt i = 0; i < fontNames->Count(); i++)


Fonts that are available on the device are listed on the screen.

Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful for developers. The version of the Symbian stub application used as a template in this snippet is v1.1.

  • The patched, executable application that can be used to test the features described in this snippet is available for download at
  • You can view all the changes that are required to implement the above-mentioned features. The changes are provided in unified diff and colour-coded diff (HTML) formats in
  • For general information on applying the patch, see Using Diffs.
  • For unpatched stub applications, see Example stub.
This page was last modified on 23 September 2014, at 19:58.
97 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.