graphicsdeviceinterface/gdi/sgdi/FONT.CPP
branchRCL_3
changeset 4 15986eb6c500
parent 0 5d03bc08d59c
child 19 bbf46f59e123
--- a/graphicsdeviceinterface/gdi/sgdi/FONT.CPP	Mon Mar 15 12:45:41 2010 +0200
+++ b/graphicsdeviceinterface/gdi/sgdi/FONT.CPP	Wed Mar 31 23:34:07 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -345,10 +345,13 @@
 The object's font style is set to the default: EPostureUpright, EStrokeWeightNormal, 
 and EPrintPosNormal.
 
-@param aTypefaceName The name of the typeface (e.g. "Roman"). 
-@param aHeight The height of the typeface, in twips. */
+@param aTypefaceName The name of the typeface (e.g. "Roman"). It should be no
+	longer than KMaxTypefaceNameLength characters in length.
+@param aHeight The height of the typeface, in twips. 
+@panic GDI 6, if aTypefaceName is more than KMaxTypefaceNameLength characters long.
+*/
 	{
-	iTypeface.iName=aTypefaceName;
+	iTypeface.SetName(aTypefaceName);
 	}
 
 
@@ -605,6 +608,29 @@
 	return (KTTypefaceMaskScript & iFlags) >> KTTypefaceBitsNumAttrib;
 	}
 
+/**
+Sets the name of the typeface. This method should be used rather than
+directly accessing the iName public member.
+@param aName The name of the typeface (e.g. "Roman"). It should be no 
+	longer than KMaxTypefaceNameLength characters in length.
+@panic GDI 6, if aName is more than KMaxTypefaceNameLength characters
+	long.
+*/
+EXPORT_C void TTypeface::SetName(const TDesC& aName)
+	{
+	GDI_ASSERT_ALWAYS(aName.Length() <= KMaxTypefaceNameLength, EGdiPanic_TypefaceNameOverflow);
+	iName=aName;
+	}
+
+/**
+Returns the name of the typeface.
+@return The name of the typeface.
+*/
+EXPORT_C const TDesC& TTypeface::Name() const
+	{
+	return iName;
+	}
+
 
 //
 // CFont