Changeset 238:380bad9f6852 for dwt/graphics/FontData.d
- Timestamp:
- 05/04/08 18:42:55 (4 years ago)
- Files:
-
- dwt/graphics/FontData.d (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/graphics/FontData.d
r200 r238 20 20 import tango.util.Convert; 21 21 import dwt.dwthelper.utils; 22 import tango.util.log.Trace; 22 23 23 24 /** … … 56 57 * </p> 57 58 */ 58 public char[]name;59 public String name; 59 60 60 61 /** … … 92 93 * </p> 93 94 */ 94 public char[]str;95 public String str; 95 96 96 97 /** 97 98 * The locales of the font 98 99 */ 99 char[]lang, country, variant;100 String lang, country, variant; 100 101 101 102 /** … … 125 126 * @see #toString 126 127 */ 127 public this( char[]str) {128 public this(String str) { 128 129 if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 129 130 int start = 0; 130 131 int end = locate( str, '|' ); 131 132 if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 132 char[]version1 = str[ start .. end ];133 String version1 = str[ start .. end ]; 133 134 try { 134 135 if (to!(int)(version1) !is 1) DWT.error(DWT.ERROR_INVALID_ARGUMENT); … … 140 141 end = locate( str, '|', start ); 141 142 if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 142 char[]name = str[start .. end ];143 String name = str[start .. end ]; 143 144 144 145 start = end + 1; … … 168 169 setStyle(style); 169 170 if (end is str.length) return; 170 char[]platform = str[ start .. end ];171 String platform = str[ start .. end ]; 171 172 172 173 start = end + 1; 173 174 end = locate( str, '|', start ); 174 175 if (end is str.length) return; 175 char[]version2 = str[ start .. end ];176 String version2 = str[ start .. end ]; 176 177 177 178 if (platform.equals("GTK") && version2.equals("1")) { … … 194 195 * </ul> 195 196 */ 196 public this( char[]name, int height, int style) {197 public this(String name, int height, int style) { 197 198 setName(name); 198 199 setHeight(height); … … 200 201 } 201 202 202 /*public*/ this( char[]name, float height, int style) {203 /*public*/ this(String name, float height, int style) { 203 204 setName(name); 204 205 setHeight(height); … … 256 257 * @since 3.0 257 258 */ 258 public char[]getLocale () {259 char[]result;259 public String getLocale () { 260 String result; 260 261 const char sep = '_'; 261 262 if (lang !is null) { … … 276 277 } 277 278 } 279 Trace.formatln( "getLocal {}", result ); 278 280 return result; 279 281 } … … 288 290 * @see #setName 289 291 */ 290 public char[]getName() {292 public String getName() { 291 293 return name; 292 294 } … … 316 318 */ 317 319 public override hash_t toHash () { 318 return typeid( char[]).getHash(&name) ^ getHeight() ^ style;320 return typeid(String).getHash(&name) ^ getHeight() ^ style; 319 321 } 320 322 … … 361 363 * @see java.util.Locale#toString 362 364 */ 363 public void setLocale(char[] locale) { 365 public void setLocale(String locale) { 366 Trace.formatln( "setLocal {}", locale ); 364 367 lang = country = variant = null; 365 368 if (locale !is null) { … … 406 409 * @see #getName 407 410 */ 408 public void setName( char[]name) {411 public void setName(String name) { 409 412 if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 410 413 this.name = name; … … 436 439 * @see FontData 437 440 */ 438 public override char[]toString() {441 public override String toString() { 439 442 return Format( "1|{}|{}|{}|GTK|1|", getName, getHeightF, getStyle ); 440 443 }
