org.eclipse.swt.widgets.Label.setFontDescription()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.eclipse.swt.widgets.Label.setFontDescription()方法的一些代码示例,展示了Label.setFontDescription()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setFontDescription()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:setFontDescription

Label.setFontDescription介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setFontDescription (int /*long*/ font) {
  super.setFontDescription (font);
  if (labelHandle != 0) setFontDescription (labelHandle, font);
  if (imageHandle != 0) setFontDescription (imageHandle, font);

  // Bug 445801: Work around for computeSize not returning a different value after
  // changing font, see https://bugzilla.gnome.org/show_bug.cgi?id=753116
  if (OS.GTK3) {
    // This updates the pango context and also clears the size request cache on the GTK side.
    int originalDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_RTL : OS.GTK_TEXT_DIR_LTR;
    int tempDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_LTR : OS.GTK_TEXT_DIR_RTL;
    OS.gtk_widget_set_direction (labelHandle, tempDirection);
    OS.gtk_widget_set_direction (labelHandle, originalDirection);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setFontDescription (long /*int*/ font) {
  super.setFontDescription (font);
  if (labelHandle != 0) setFontDescription (labelHandle, font);
  if (imageHandle != 0) setFontDescription (imageHandle, font);

  // Bug 445801: Work around for computeSize not returning a different value after
  // changing font, see https://bugzilla.gnome.org/show_bug.cgi?id=753116
  if (OS.GTK3) {
    // This updates the pango context and also clears the size request cache on the GTK side.
    int originalDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_RTL : OS.GTK_TEXT_DIR_LTR;
    int tempDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_LTR : OS.GTK_TEXT_DIR_RTL;
    OS.gtk_widget_set_direction (labelHandle, tempDirection);
    OS.gtk_widget_set_direction (labelHandle, originalDirection);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setFontDescription (int /*long*/ font) {
  super.setFontDescription (font);
  if (labelHandle != 0) setFontDescription (labelHandle, font);
  if (imageHandle != 0) setFontDescription (imageHandle, font);

  // Bug 445801: Work around for computeSize not returning a different value after
  // changing font, see https://bugzilla.gnome.org/show_bug.cgi?id=753116
  if (OS.GTK3) {
    // This updates the pango context and also clears the size request cache on the GTK side.
    int originalDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_RTL : OS.GTK_TEXT_DIR_LTR;
    int tempDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_LTR : OS.GTK_TEXT_DIR_RTL;
    OS.gtk_widget_set_direction (labelHandle, tempDirection);
    OS.gtk_widget_set_direction (labelHandle, originalDirection);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

setFontDescription(defaultFont ().handle);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

setFontDescription(defaultFont ().handle);

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

setFontDescription(defaultFont ().handle);

相关文章