comparison dwt/graphics/TextStyle.d @ 238:380bad9f6852

reverted char[] to String
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:42:55 +0200
parents cd8dc3f19679
children ce446666f5a2
comparison
equal deleted inserted replaced
237:98b80b00af79 238:380bad9f6852
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language: 10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de> 11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/ 12 *******************************************************************************/
13 module dwt.graphics.TextStyle; 13 module dwt.graphics.TextStyle;
14
15 import dwt.dwthelper.utils;
14 16
15 import dwt.DWT; 17 import dwt.DWT;
16 import dwt.graphics.Font; 18 import dwt.graphics.Font;
17 import dwt.graphics.Color; 19 import dwt.graphics.Color;
18 import dwt.graphics.GlyphMetrics; 20 import dwt.graphics.GlyphMetrics;
171 * Returns a string containing a concise, human-readable 173 * Returns a string containing a concise, human-readable
172 * description of the receiver. 174 * description of the receiver.
173 * 175 *
174 * @return a string representation of the <code>TextStyle</code> 176 * @return a string representation of the <code>TextStyle</code>
175 */ 177 */
176 override public char[] toString () { 178 override public String toString () {
177 char[] buffer = "TextStyle {"; 179 String buffer = "TextStyle {";
178 int startLength = buffer.length; 180 int startLength = buffer.length;
179 if (font !is null) { 181 if (font !is null) {
180 if (buffer.length > startLength) buffer ~= ", "; 182 if (buffer.length > startLength) buffer ~= ", ";
181 buffer ~= "font="; 183 buffer ~= "font=";
182 buffer ~= font.toString; 184 buffer ~= font.toString;
200 buffer ~= "striked out"; 202 buffer ~= "striked out";
201 } 203 }
202 if (rise !is 0) { 204 if (rise !is 0) {
203 if (buffer.length > startLength) buffer ~= ", "; 205 if (buffer.length > startLength) buffer ~= ", ";
204 buffer ~= "rise="; 206 buffer ~= "rise=";
205 buffer ~= to!(char[])(rise); 207 buffer ~= to!(String)(rise);
206 } 208 }
207 if (metrics !is null) { 209 if (metrics !is null) {
208 if (buffer.length > startLength) buffer ~= ", "; 210 if (buffer.length > startLength) buffer ~= ", ";
209 buffer ~= "metrics="; 211 buffer ~= "metrics=";
210 buffer ~= metrics.toString; 212 buffer ~= metrics.toString;