Symbian3/SDK/Source/GUID-6DF52DDC-B03C-5971-94C8-0E9BAAB949FD.dita
changeset 13 48780e181b38
parent 8 ae94777fff8f
--- a/Symbian3/SDK/Source/GUID-6DF52DDC-B03C-5971-94C8-0E9BAAB949FD.dita	Fri Jul 16 17:23:46 2010 +0100
+++ b/Symbian3/SDK/Source/GUID-6DF52DDC-B03C-5971-94C8-0E9BAAB949FD.dita	Tue Jul 20 12:00:49 2010 +0100
@@ -9,7 +9,7 @@
 -->
 <!DOCTYPE concept
   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
-<concept xml:lang="en" id="GUID-6DF52DDC-B03C-5971-94C8-0E9BAAB949FD"><title>Drawing Text</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This topic provides examples that demonstrate how to draw a line of text and text in a colored box. </p> <section><title>Text</title> <p>The basic way to draw text is to call <codeph>CGraphicsContext::DrawText()</codeph> with a point specifying the bottom left position, as shown below: </p> <fig id="GUID-0FE5E011-9C1D-5F36-AAC2-5F05B023CF84"><image href="GUID-E24F15B4-D767-5B79-B0EB-88294B9BC16A_d0e202076_href.png" placement="inline"/></fig> <p>Before calling, you must use the graphics context to: </p> <ol id="GUID-EA1605BB-1FD6-5E08-9D24-C8DEAB625A96"><li id="GUID-5CB9A7BD-ABFE-550A-BF43-E12BAF72BB27"><p>Set the font to use </p> </li> <li id="GUID-BB8A0DF7-AD80-5718-8646-2B4E8836FFC7"><p>Set the pen color for the text </p> </li> </ol> <codeblock id="GUID-C3E7D82E-CBE6-5131-B6BA-14F341DB331E" xml:space="preserve">// In this example, we use one of the standard font styles
+<concept xml:lang="en" id="GUID-6DF52DDC-B03C-5971-94C8-0E9BAAB949FD"><title>Drawing Text</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This topic provides examples that demonstrate how to draw a line of text and text in a colored box. </p> <section><title>Text</title> <p>The basic way to draw text is to call <codeph>CGraphicsContext::DrawText()</codeph> with a point specifying the bottom left position, as shown below: </p> <fig id="GUID-0FE5E011-9C1D-5F36-AAC2-5F05B023CF84"><image href="GUID-E24F15B4-D767-5B79-B0EB-88294B9BC16A_d0e207083_href.png" placement="inline"/></fig> <p>Before calling, you must use the graphics context to: </p> <ol id="GUID-EA1605BB-1FD6-5E08-9D24-C8DEAB625A96"><li id="GUID-5CB9A7BD-ABFE-550A-BF43-E12BAF72BB27"><p>Set the font to use </p> </li> <li id="GUID-BB8A0DF7-AD80-5718-8646-2B4E8836FFC7"><p>Set the pen color for the text </p> </li> </ol> <codeblock id="GUID-C3E7D82E-CBE6-5131-B6BA-14F341DB331E" xml:space="preserve">// In this example, we use one of the standard font styles
 CFont* fontUsed = iEikonEnv-&gt;TitleFont();
 gc.UseFont(fontUsed);
     
@@ -17,7 +17,7 @@
     
 TPoint pos(50,50);
 _LIT(KExampleText,"blacktext");
-gc.DrawText(KExampleText,pos);</codeblock> </section> <section><title>Text in a box</title> <p>To draw text in a box, you must specify: </p> <ul><li id="GUID-77C31EC3-67D6-5DFD-954D-E4008990E97D"><p>a rectangle to draw the text in </p> </li> <li id="GUID-9F13BCA1-D087-51CE-80D9-9DD908933BDD"><p>an offset from the top of the rectangle to the text baseline: to center the text, add half the height of the rectangle to half the height of the font's ascent </p> </li> <li id="GUID-DCAF0EFD-FD6B-56DA-89FA-05CEB6684F2D"><p>the text alignment mode: in the example, left alignment is used </p> </li> <li id="GUID-431998D7-53E6-5899-B072-89B1DF5C01E8"><p>a margin: the left margin for left-aligned text, or the right margin for right-aligned text </p> </li> </ul> <p>The following figure show how these fit together: </p> <fig id="GUID-2C7ED0E6-3667-56E4-B776-9EF9C085D746"><image href="GUID-F82675C4-C2FD-50E2-BEDA-EB454FF1C57E_d0e202130_href.png" placement="inline"/></fig> <p>In addition to the font and pen color, you can also set the brush for filling the box. </p> <codeblock id="GUID-21B1E44E-AA77-5489-9C57-AEE33519F958" xml:space="preserve">...
+gc.DrawText(KExampleText,pos);</codeblock> </section> <section><title>Text in a box</title> <p>To draw text in a box, you must specify: </p> <ul><li id="GUID-77C31EC3-67D6-5DFD-954D-E4008990E97D"><p>a rectangle to draw the text in </p> </li> <li id="GUID-9F13BCA1-D087-51CE-80D9-9DD908933BDD"><p>an offset from the top of the rectangle to the text baseline: to center the text, add half the height of the rectangle to half the height of the font's ascent </p> </li> <li id="GUID-DCAF0EFD-FD6B-56DA-89FA-05CEB6684F2D"><p>the text alignment mode: in the example, left alignment is used </p> </li> <li id="GUID-431998D7-53E6-5899-B072-89B1DF5C01E8"><p>a margin: the left margin for left-aligned text, or the right margin for right-aligned text </p> </li> </ul> <p>The following figure show how these fit together: </p> <fig id="GUID-2C7ED0E6-3667-56E4-B776-9EF9C085D746"><image href="GUID-F82675C4-C2FD-50E2-BEDA-EB454FF1C57E_d0e207137_href.png" placement="inline"/></fig> <p>In addition to the font and pen color, you can also set the brush for filling the box. </p> <codeblock id="GUID-21B1E44E-AA77-5489-9C57-AEE33519F958" xml:space="preserve">...
 // Draw some text left justified in a box,
 // Offset so text is just inside top of box