public static FontMetrics cocoa_new(int ascent, int descent, int averageCharWidth, int leading, int height) { FontMetrics fontMetrics = new FontMetrics(); fontMetrics.ascent = ascent; fontMetrics.descent = descent; fontMetrics.averageCharWidth = averageCharWidth; fontMetrics.leading = leading; fontMetrics.height = height; return fontMetrics; }
/** * Invokes platform specific functionality to allocate a new font metrics. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>FontMetrics</code>. It is marked public only so that * it can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @noreference This method is not intended to be referenced by clients. */ public static FontMetrics gtk_new(int ascentInPoints, int descentInPoints, int averageCharWidthInPoints) { FontMetrics fontMetrics = new FontMetrics(); fontMetrics.ascentInPoints = ascentInPoints; fontMetrics.descentInPoints = descentInPoints; fontMetrics.averageCharWidthInPoints = averageCharWidthInPoints; return fontMetrics; }
/** * Invokes platform specific functionality to allocate a new font metrics. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>FontMetrics</code>. It is marked public only so that * it can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @noreference This method is not intended to be referenced by clients. */ public static FontMetrics gtk_new(int ascentInPoints, int descentInPoints, int averageCharWidthInPoints) { FontMetrics fontMetrics = new FontMetrics(); fontMetrics.ascentInPoints = ascentInPoints; fontMetrics.descentInPoints = descentInPoints; fontMetrics.averageCharWidthInPoints = averageCharWidthInPoints; return fontMetrics; }
/** * Invokes platform specific functionality to allocate a new font metrics. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>FontMetrics</code>. It is marked public only so that * it can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param handle the <code>TEXTMETRIC</code> containing information about a font * @return a new font metrics object containing the specified <code>TEXTMETRIC</code> * * @noreference This method is not intended to be referenced by clients. */ public static FontMetrics win32_new(TEXTMETRIC handle) { FontMetrics fontMetrics = new FontMetrics(); fontMetrics.handle = handle; return fontMetrics; }
/** * Invokes platform specific functionality to allocate a new font metrics. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>FontMetrics</code>. It is marked public only so that * it can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @noreference This method is not intended to be referenced by clients. */ public static FontMetrics gtk_new(int ascentInPoints, int descentInPoints, int averageCharWidthInPoints) { FontMetrics fontMetrics = new FontMetrics(); fontMetrics.ascentInPoints = ascentInPoints; fontMetrics.descentInPoints = descentInPoints; fontMetrics.averageCharWidthInPoints = averageCharWidthInPoints; return fontMetrics; }
/** * Returns a FontMetrics which contains information * about the font currently being used by the receiver * to draw and measure text. * * @return font metrics for the receiver's font * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public FontMetrics getFontMetrics() { checkDisposed(); return new FontMetrics( delegate.getFont() ); }
long /*int*/ lang = OS.pango_context_get_language(context); long /*int*/ metrics = OS.pango_context_get_metrics(context, font.handle, lang); FontMetrics fm = new FontMetrics(); int ascent = OS.pango_font_metrics_get_ascent(metrics); int descent = OS.pango_font_metrics_get_descent(metrics);
int /*long*/ lang = OS.pango_context_get_language(context); int /*long*/ metrics = OS.pango_context_get_metrics(context, font.handle, lang); FontMetrics fm = new FontMetrics(); int ascent = OS.pango_font_metrics_get_ascent(metrics); int descent = OS.pango_font_metrics_get_descent(metrics);
int /*long*/ lang = OS.pango_context_get_language(context); int /*long*/ metrics = OS.pango_context_get_metrics(context, font.handle, lang); FontMetrics fm = new FontMetrics(); int ascent = OS.pango_font_metrics_get_ascent(metrics); int descent = OS.pango_font_metrics_get_descent(metrics);