KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > graphics > FontData


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.graphics;
12
13
14 import org.eclipse.swt.internal.*;
15 import org.eclipse.swt.internal.win32.*;
16 import org.eclipse.swt.*;
17
18 /**
19  * Instances of this class describe operating system fonts.
20  * <p>
21  * For platform-independent behaviour, use the get and set methods
22  * corresponding to the following properties:
23  * <dl>
24  * <dt>height</dt><dd>the height of the font in points</dd>
25  * <dt>name</dt><dd>the face name of the font, which may include the foundry</dd>
26  * <dt>style</dt><dd>A bitwise combination of NORMAL, ITALIC and BOLD</dd>
27  * </dl>
28  * If extra, platform-dependent functionality is required:
29  * <ul>
30  * <li>On <em>Windows</em>, the data member of the <code>FontData</code>
31  * corresponds to a Windows <code>LOGFONT</code> structure whose fields
32  * may be retrieved and modified.</li>
33  * <li>On <em>X</em>, the fields of the <code>FontData</code> correspond
34  * to the entries in the font's XLFD name and may be retrieved and modified.
35  * </ul>
36  * Application code does <em>not</em> need to explicitly release the
37  * resources managed by each instance when those instances are no longer
38  * required, and thus no <code>dispose()</code> method is provided.
39  *
40  * @see Font
41  */

42
43 public final class FontData {
44     
45     /**
46      * A Win32 LOGFONT struct
47      * (Warning: This field is platform dependent)
48      * <p>
49      * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
50      * public API. It is marked public only so that it can be shared
51      * within the packages provided by SWT. It is not available on all
52      * platforms and should never be accessed from application code.
53      * </p>
54      */

55     public LOGFONT data;
56     
57     /**
58      * The height of the font data in points
59      * (Warning: This field is platform dependent)
60      * <p>
61      * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
62      * public API. It is marked public only so that it can be shared
63      * within the packages provided by SWT. It is not available on all
64      * platforms and should never be accessed from application code.
65      * </p>
66      */

67     public float height;
68     
69     /**
70      * The locales of the font
71      */

72     String JavaDoc lang, country, variant;
73     
74 /**
75  * Constructs a new uninitialized font data.
76  */

77 public FontData() {
78     data = OS.IsUnicode ? (LOGFONT)new LOGFONTW() : new LOGFONTA();
79     // We set the charset field so that
80
// wildcard searching will work properly
81
// out of the box
82
data.lfCharSet = (byte)OS.DEFAULT_CHARSET;
83     height = 12;
84 }
85
86 /**
87  * Constructs a new font data given the Windows <code>LOGFONT</code>
88  * that it should represent.
89  *
90  * @param data the <code>LOGFONT</code> for the result
91  */

92 FontData(LOGFONT data, float height) {
93     this.data = data;
94     this.height = height;
95 }
96
97 /**
98  * Constructs a new FontData given a string representation
99  * in the form generated by the <code>FontData.toString</code>
100  * method.
101  * <p>
102  * Note that the representation varies between platforms,
103  * and a FontData can only be created from a string that was
104  * generated on the same platform.
105  * </p>
106  *
107  * @param string the string representation of a <code>FontData</code> (must not be null)
108  *
109  * @exception IllegalArgumentException <ul>
110  * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
111  * <li>ERROR_INVALID_ARGUMENT - if the argument does not represent a valid description</li>
112  * </ul>
113  *
114  * @see #toString
115  */

116 public FontData(String JavaDoc string) {
117     if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
118     int start = 0;
119     int end = string.indexOf('|');
120     if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
121     String JavaDoc version1 = string.substring(start, end);
122     try {
123         if (Integer.parseInt(version1) != 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
124     } catch (NumberFormatException JavaDoc e) {
125         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
126     }
127     
128     start = end + 1;
129     end = string.indexOf('|', start);
130     if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
131     String JavaDoc name = string.substring(start, end);
132     
133     start = end + 1;
134     end = string.indexOf('|', start);
135     if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
136     float height = 0;
137     try {
138         height = Float.parseFloat(string.substring(start, end));
139     } catch (NumberFormatException JavaDoc e) {
140         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
141     }
142     
143     start = end + 1;
144     end = string.indexOf('|', start);
145     if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
146     int style = 0;
147     try {
148         style = Integer.parseInt(string.substring(start, end));
149     } catch (NumberFormatException JavaDoc e) {
150         SWT.error(SWT.ERROR_INVALID_ARGUMENT);
151     }
152
153     start = end + 1;
154     end = string.indexOf('|', start);
155     data = OS.IsUnicode ? (LOGFONT)new LOGFONTW() : new LOGFONTA();
156     data.lfCharSet = (byte)OS.DEFAULT_CHARSET;
157     setName(name);
158     setHeight(height);
159     setStyle(style);
160     if (end == -1) return;
161     String JavaDoc platform = string.substring(start, end);
162
163     start = end + 1;
164     end = string.indexOf('|', start);
165     if (end == -1) return;
166     String JavaDoc version2 = string.substring(start, end);
167
168     if (platform.equals("WINDOWS") && version2.equals("1")) { //$NON-NLS-1$//$NON-NLS-2$
169
LOGFONT newData = OS.IsUnicode ? (LOGFONT)new LOGFONTW() : new LOGFONTA();
170         try {
171             start = end + 1;
172             end = string.indexOf('|', start);
173             if (end == -1) return;
174             newData.lfHeight = Integer.parseInt(string.substring(start, end));
175             start = end + 1;
176             end = string.indexOf('|', start);
177             if (end == -1) return;
178             newData.lfWidth = Integer.parseInt(string.substring(start, end));
179             start = end + 1;
180             end = string.indexOf('|', start);
181             if (end == -1) return;
182             newData.lfEscapement = Integer.parseInt(string.substring(start, end));
183             start = end + 1;
184             end = string.indexOf('|', start);
185             if (end == -1) return;
186             newData.lfOrientation = Integer.parseInt(string.substring(start, end));
187             start = end + 1;
188             end = string.indexOf('|', start);
189             if (end == -1) return;
190             newData.lfWeight = Integer.parseInt(string.substring(start, end));
191             start = end + 1;
192             end = string.indexOf('|', start);
193             if (end == -1) return;
194             newData.lfItalic = Byte.parseByte(string.substring(start, end));
195             start = end + 1;
196             end = string.indexOf('|', start);
197             if (end == -1) return;
198             newData.lfUnderline = Byte.parseByte(string.substring(start, end));
199             start = end + 1;
200             end = string.indexOf('|', start);
201             if (end == -1) return;
202             newData.lfStrikeOut = Byte.parseByte(string.substring(start, end));
203             start = end + 1;
204             end = string.indexOf('|', start);
205             if (end == -1) return;
206             newData.lfCharSet = Byte.parseByte(string.substring(start, end));
207             start = end + 1;
208             end = string.indexOf('|', start);
209             if (end == -1) return;
210             newData.lfOutPrecision = Byte.parseByte(string.substring(start, end));
211             start = end + 1;
212             end = string.indexOf('|', start);
213             if (end == -1) return;
214             newData.lfClipPrecision = Byte.parseByte(string.substring(start, end));
215             start = end + 1;
216             end = string.indexOf('|', start);
217             if (end == -1) return;
218             newData.lfQuality = Byte.parseByte(string.substring(start, end));
219             start = end + 1;
220             end = string.indexOf('|', start);
221             if (end == -1) return;
222             newData.lfPitchAndFamily = Byte.parseByte(string.substring(start, end));
223             start = end + 1;
224         } catch (NumberFormatException JavaDoc e) {
225             setName(name);
226             setHeight(height);
227             setStyle(style);
228             return;
229         }
230         TCHAR buffer = new TCHAR(0, string.substring(start), false);
231         int length = Math.min(OS.LF_FACESIZE - 1, buffer.length());
232         if (OS.IsUnicode) {
233             char[] lfFaceName = ((LOGFONTW)newData).lfFaceName;
234             System.arraycopy(buffer.chars, 0, lfFaceName, 0, length);
235         } else {
236             byte[] lfFaceName = ((LOGFONTA)newData).lfFaceName;
237             System.arraycopy(buffer.bytes, 0, lfFaceName, 0, length);
238         }
239         data = newData;
240     }
241 }
242
243 /**
244  * Constructs a new font data given a font name,
245  * the height of the desired font in points,
246  * and a font style.
247  *
248  * @param name the name of the font (must not be null)
249  * @param height the font height in points
250  * @param style a bit or combination of NORMAL, BOLD, ITALIC
251  *
252  * @exception IllegalArgumentException <ul>
253  * <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
254  * <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
255  * </ul>
256  */

257 public FontData(String JavaDoc name, int height, int style) {
258     if (name == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
259     data = OS.IsUnicode ? (LOGFONT)new LOGFONTW() : new LOGFONTA();
260     setName(name);
261     setHeight(height);
262     setStyle(style);
263     // We set the charset field so that
264
// wildcard searching will work properly
265
// out of the box
266
data.lfCharSet = (byte)OS.DEFAULT_CHARSET;
267 }
268
269 /*public*/ FontData(String JavaDoc name, float height, int style) {
270     if (name == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
271     data = OS.IsUnicode ? (LOGFONT)new LOGFONTW() : new LOGFONTA();
272     setName(name);
273     setHeight(height);
274     setStyle(style);
275     // We set the charset field so that
276
// wildcard searching will work properly
277
// out of the box
278
data.lfCharSet = (byte)OS.DEFAULT_CHARSET;
279 }
280
281 /**
282  * Compares the argument to the receiver, and returns true
283  * if they represent the <em>same</em> object using a class
284  * specific comparison.
285  *
286  * @param object the object to compare with this object
287  * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
288  *
289  * @see #hashCode
290  */

291 public boolean equals (Object JavaDoc object) {
292     if (object == this) return true;
293     if (!(object instanceof FontData)) return false;
294     FontData fd = (FontData)object;
295     LOGFONT lf = fd.data;
296     return data.lfCharSet == lf.lfCharSet &&
297         /*
298         * This code is intentionally commented. When creating
299         * a FontData, lfHeight is not necessarily set. Instead
300         * we check the height field which is always set.
301         */

302 // data.lfHeight == lf.lfHeight &&
303
height == fd.height &&
304         data.lfWidth == lf.lfWidth &&
305         data.lfEscapement == lf.lfEscapement &&
306         data.lfOrientation == lf.lfOrientation &&
307         data.lfWeight == lf.lfWeight &&
308         data.lfItalic == lf.lfItalic &&
309         data.lfUnderline == lf.lfUnderline &&
310         data.lfStrikeOut == lf.lfStrikeOut &&
311         data.lfCharSet == lf.lfCharSet &&
312         data.lfOutPrecision == lf.lfOutPrecision &&
313         data.lfClipPrecision == lf.lfClipPrecision &&
314         data.lfQuality == lf.lfQuality &&
315         data.lfPitchAndFamily == lf.lfPitchAndFamily &&
316         getName().equals(fd.getName());
317 }
318
319 int EnumLocalesProc(int lpLocaleString) {
320     
321     /* Get the locale ID */
322     int length = 8;
323     TCHAR buffer = new TCHAR(0, length);
324     int byteCount = length * TCHAR.sizeof;
325     OS.MoveMemory(buffer, lpLocaleString, byteCount);
326     int lcid = Integer.parseInt(buffer.toString(0, buffer.strlen ()), 16);
327
328     /* Check the language */
329     int size = OS.GetLocaleInfo(lcid, OS.LOCALE_SISO639LANGNAME, buffer, length);
330     if (size <= 0 || !lang.equals(buffer.toString(0, size - 1))) return 1;
331
332     /* Check the country */
333     if (country != null) {
334         size = OS.GetLocaleInfo(lcid, OS.LOCALE_SISO3166CTRYNAME, buffer, length);
335         if (size <= 0 || !country.equals(buffer.toString(0, size - 1))) return 1;
336     }
337
338     /* Get the charset */
339     size = OS.GetLocaleInfo(lcid, OS.LOCALE_IDEFAULTANSICODEPAGE, buffer, length);
340     if (size <= 0) return 1;
341     int cp = Integer.parseInt(buffer.toString(0, size - 1));
342     int [] lpCs = new int[8];
343     OS.TranslateCharsetInfo(cp, lpCs, OS.TCI_SRCCODEPAGE);
344     data.lfCharSet = (byte)lpCs[0];
345
346     return 0;
347 }
348
349 /**
350  * Returns the height of the receiver in points.
351  *
352  * @return the height of this FontData
353  *
354  * @see #setHeight(int)
355  */

356 public int getHeight() {
357     return (int)(0.5f + height);
358 }
359
360 /*public*/ float getHeightF() {
361     return height;
362 }
363
364 /**
365  * Returns the locale of the receiver.
366  * <p>
367  * The locale determines which platform character set this
368  * font is going to use. Widgets and graphics operations that
369  * use this font will convert UNICODE strings to the platform
370  * character set of the specified locale.
371  * </p>
372  * <p>
373  * On platforms where there are multiple character sets for a
374  * given language/country locale, the variant portion of the
375  * locale will determine the character set.
376  * </p>
377  *
378  * @return the <code>String</code> representing a Locale object
379  * @since 3.0
380  */

381 public String JavaDoc getLocale () {
382     StringBuffer JavaDoc buffer = new StringBuffer JavaDoc ();
383     char sep = '_';
384     if (lang != null) {
385         buffer.append (lang);
386         buffer.append (sep);
387     }
388     if (country != null) {
389         buffer.append (country);
390         buffer.append (sep);
391     }
392     if (variant != null) {
393         buffer.append (variant);
394     }
395     
396     String JavaDoc result = buffer.toString ();
397     int length = result.length ();
398     if (length > 0) {
399         if (result.charAt (length - 1) == sep) {
400             result = result.substring (0, length - 1);
401         }
402     }
403     return result;
404 }
405
406 /**
407  * Returns the name of the receiver.
408  * On platforms that support font foundries, the return value will
409  * be the foundry followed by a dash ("-") followed by the face name.
410  *
411  * @return the name of this <code>FontData</code>
412  *
413  * @see #setName
414  */

415 public String JavaDoc getName() {
416     char[] chars;
417     if (OS.IsUnicode) {
418         chars = ((LOGFONTW)data).lfFaceName;
419     } else {
420         chars = new char[OS.LF_FACESIZE];
421         byte[] bytes = ((LOGFONTA)data).lfFaceName;
422         OS.MultiByteToWideChar (OS.CP_ACP, OS.MB_PRECOMPOSED, bytes, bytes.length, chars, chars.length);
423     }
424     int index = 0;
425     while (index < chars.length) {
426         if (chars [index] == 0) break;
427         index++;
428     }
429     return new String JavaDoc (chars, 0, index);
430 }
431
432 /**
433  * Returns the style of the receiver which is a bitwise OR of
434  * one or more of the <code>SWT</code> constants NORMAL, BOLD
435  * and ITALIC.
436  *
437  * @return the style of this <code>FontData</code>
438  *
439  * @see #setStyle
440  */

441 public int getStyle() {
442     int style = SWT.NORMAL;
443     if (data.lfWeight == 700) style |= SWT.BOLD;
444     if (data.lfItalic != 0) style |= SWT.ITALIC;
445     return style;
446 }
447
448 /**
449  * Returns an integer hash code for the receiver. Any two
450  * objects that return <code>true</code> when passed to
451  * <code>equals</code> must return the same value for this
452  * method.
453  *
454  * @return the receiver's hash
455  *
456  * @see #equals
457  */

458 public int hashCode () {
459     return data.lfCharSet ^ getHeight() ^ data.lfWidth ^ data.lfEscapement ^
460         data.lfOrientation ^ data.lfWeight ^ data.lfItalic ^data.lfUnderline ^
461         data.lfStrikeOut ^ data.lfCharSet ^ data.lfOutPrecision ^
462         data.lfClipPrecision ^ data.lfQuality ^ data.lfPitchAndFamily ^
463         getName().hashCode();
464 }
465
466 /**
467  * Sets the height of the receiver. The parameter is
468  * specified in terms of points, where a point is one
469  * seventy-second of an inch.
470  *
471  * @param height the height of the <code>FontData</code>
472  *
473  * @exception IllegalArgumentException <ul>
474  * <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
475  * </ul>
476  *
477  * @see #getHeight
478  */

479 public void setHeight(int height) {
480     if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
481     this.height = height;
482 }
483
484 /*public*/ void setHeight(float height) {
485     if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
486     this.height = height;
487 }
488
489 /**
490  * Sets the locale of the receiver.
491  * <p>
492  * The locale determines which platform character set this
493  * font is going to use. Widgets and graphics operations that
494  * use this font will convert UNICODE strings to the platform
495  * character set of the specified locale.
496  * </p>
497  * <p>
498  * On platforms where there are multiple character sets for a
499  * given language/country locale, the variant portion of the
500  * locale will determine the character set.
501  * </p>
502  *
503  * @param locale the <code>String</code> representing a Locale object
504  * @see java.util.Locale#toString
505  */

506 public void setLocale(String JavaDoc locale) {
507     lang = country = variant = null;
508     if (locale != null) {
509         char sep = '_';
510         int length = locale.length();
511         int firstSep, secondSep;
512         
513         firstSep = locale.indexOf(sep);
514         if (firstSep == -1) {
515             firstSep = secondSep = length;
516         } else {
517             secondSep = locale.indexOf(sep, firstSep + 1);
518             if (secondSep == -1) secondSep = length;
519         }
520         if (firstSep > 0) lang = locale.substring(0, firstSep);
521         if (secondSep > firstSep + 1) country = locale.substring(firstSep + 1, secondSep);
522         if (length > secondSep + 1) variant = locale.substring(secondSep + 1);
523     }
524     if (lang == null) {
525         data.lfCharSet = (byte)OS.DEFAULT_CHARSET;
526     } else {
527         Callback callback = new Callback (this, "EnumLocalesProc", 1); //$NON-NLS-1$
528
int lpEnumLocalesProc = callback.getAddress ();
529         if (lpEnumLocalesProc == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
530         OS.EnumSystemLocales(lpEnumLocalesProc, OS.LCID_SUPPORTED);
531         callback.dispose ();
532     }
533 }
534
535 /**
536  * Sets the name of the receiver.
537  * <p>
538  * Some platforms support font foundries. On these platforms, the name
539  * of the font specified in setName() may have one of the following forms:
540  * <ol>
541  * <li>a face name (for example, "courier")</li>
542  * <li>a foundry followed by a dash ("-") followed by a face name (for example, "adobe-courier")</li>
543  * </ol>
544  * In either case, the name returned from getName() will include the
545  * foundry.
546  * </p>
547  * <p>
548  * On platforms that do not support font foundries, only the face name
549  * (for example, "courier") is used in <code>setName()</code> and
550  * <code>getName()</code>.
551  * </p>
552  *
553  * @param name the name of the font data (must not be null)
554  * @exception IllegalArgumentException <ul>
555  * <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
556  * </ul>
557  *
558  * @see #getName
559  */

560 public void setName(String JavaDoc name) {
561     if (name == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
562
563     /* The field lfFaceName must be NULL terminated */
564     TCHAR buffer = new TCHAR(0, name, true);
565     int length = Math.min(OS.LF_FACESIZE - 1, buffer.length());
566     if (OS.IsUnicode) {
567         char[] lfFaceName = ((LOGFONTW)data).lfFaceName;
568         for (int i = 0; i < lfFaceName.length; i++) lfFaceName[i] = 0;
569         System.arraycopy(buffer.chars, 0, lfFaceName, 0, length);
570     } else {
571         byte[] lfFaceName = ((LOGFONTA)data).lfFaceName;
572         for (int i = 0; i < lfFaceName.length; i++) lfFaceName[i] = 0;
573         System.arraycopy(buffer.bytes, 0, lfFaceName, 0, length);
574     }
575 }
576
577 /**
578  * Sets the style of the receiver to the argument which must
579  * be a bitwise OR of one or more of the <code>SWT</code>
580  * constants NORMAL, BOLD and ITALIC. All other style bits are
581  * ignored.
582  *
583  * @param style the new style for this <code>FontData</code>
584  *
585  * @see #getStyle
586  */

587 public void setStyle(int style) {
588     if ((style & SWT.BOLD) == SWT.BOLD) {
589         data.lfWeight = 700;
590     } else {
591         data.lfWeight = 0;
592     }
593     if ((style & SWT.ITALIC) == SWT.ITALIC) {
594         data.lfItalic = 1;
595     } else {
596         data.lfItalic = 0;
597     }
598 }
599
600 /**
601  * Returns a string representation of the receiver which is suitable
602  * for constructing an equivalent instance using the
603  * <code>FontData(String)</code> constructor.
604  *
605  * @return a string representation of the FontData
606  *
607  * @see FontData
608  */

609 public String JavaDoc toString() {
610     StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
611     buffer.append("1|"); //$NON-NLS-1$
612
buffer.append(getName());
613     buffer.append("|"); //$NON-NLS-1$
614
buffer.append(getHeightF());
615     buffer.append("|"); //$NON-NLS-1$
616
buffer.append(getStyle());
617     buffer.append("|"); //$NON-NLS-1$
618
buffer.append("WINDOWS|1|"); //$NON-NLS-1$
619
buffer.append(data.lfHeight);
620     buffer.append("|"); //$NON-NLS-1$
621
buffer.append(data.lfWidth);
622     buffer.append("|"); //$NON-NLS-1$
623
buffer.append(data.lfEscapement);
624     buffer.append("|"); //$NON-NLS-1$
625
buffer.append(data.lfOrientation);
626     buffer.append("|"); //$NON-NLS-1$
627
buffer.append(data.lfWeight);
628     buffer.append("|"); //$NON-NLS-1$
629
buffer.append(data.lfItalic);
630     buffer.append("|"); //$NON-NLS-1$
631
buffer.append(data.lfUnderline);
632     buffer.append("|"); //$NON-NLS-1$
633
buffer.append(data.lfStrikeOut);
634     buffer.append("|"); //$NON-NLS-1$
635
buffer.append(data.lfCharSet);
636     buffer.append("|"); //$NON-NLS-1$
637
buffer.append(data.lfOutPrecision);
638     buffer.append("|"); //$NON-NLS-1$
639
buffer.append(data.lfClipPrecision);
640     buffer.append("|"); //$NON-NLS-1$
641
buffer.append(data.lfQuality);
642     buffer.append("|"); //$NON-NLS-1$
643
buffer.append(data.lfPitchAndFamily);
644     buffer.append("|"); //$NON-NLS-1$
645
buffer.append(getName());
646     return buffer.toString();
647 }
648
649 /**
650  * Invokes platform specific functionality to allocate a new font data.
651  * <p>
652  * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
653  * API for <code>FontData</code>. It is marked public only so that
654  * it can be shared within the packages provided by SWT. It is not
655  * available on all platforms, and should never be called from
656  * application code.
657  * </p>
658  *
659  * @param data the <code>LOGFONT</code> for the font data
660  * @param height the height of the font data
661  * @return a new font data object containing the specified <code>LOGFONT</code> and height
662  */

663 public static FontData win32_new(LOGFONT data, float height) {
664     return new FontData(data, height);
665 }
666
667 }
668
Popular Tags