Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 259436 Details for
Bug 486734
[cocoa][10.11] bold/italic system fonts render with baseline too low
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
SnippetBold.java
SnippetBold.java (text/plain), 2.49 KB, created by
Markus Keller
on 2016-01-28 10:44:04 EST
(
hide
)
Description:
SnippetBold.java
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2016-01-28 10:44:04 EST
Size:
2.49 KB
patch
obsolete
>package org.eclipse.swt.snippets; > >import org.eclipse.swt.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class SnippetBold { > >public static void main (String [] args) { > Display display = new Display (); > Shell shell = new Shell (display); > shell.setLayout(new GridLayout(2, false)); > > Font boldFont; > Font customFont = null; // baseline of bold font too low everywhere >// Font customFont = new Font(display, "Helvetica", 16, SWT.NONE); // cuts all descenders in Tree >// Font customFont = new Font(display, "Courier", 11, SWT.NONE); // cuts all descenders in Tree >// Font customFont = new Font(display, "Monaco", 16, SWT.NONE); // OK > if (customFont != null) { > FontData fontData = customFont.getFontData()[0]; > fontData.setStyle(SWT.BOLD); > boldFont = new Font(display, fontData); > } else { > FontData fontData = display.getSystemFont().getFontData()[0]; > fontData.setStyle(SWT.BOLD); > boldFont = new Font(display, fontData); > } > > final Tree tree = new Tree (shell, SWT.BORDER); > tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); > tree.setFont(customFont); > for (int i=0; i<4; i++) { > TreeItem iItem = new TreeItem (tree, 0); > iItem.setText ("g TreeItem (0) - " + i); > if (i % 3 == 0) iItem.setFont(boldFont); > for (int j=0; j<4; j++) { > TreeItem jItem = new TreeItem (iItem, 0); > jItem.setText ("g TreeItem (1) - " + j); > if (j % 3 == 0) jItem.setFont(boldFont); > for (int k=0; k<4; k++) { > TreeItem kItem = new TreeItem (jItem, 0); > kItem.setText ("g TreeItem (2) - " + k); > if (k % 3 == 0) kItem.setFont(boldFont); > for (int l=0; l<4; l++) { > TreeItem lItem = new TreeItem (kItem, 0); > lItem.setText ("g TreeItem (3) - " + l); > if (l % 3 == 0) lItem.setFont(boldFont); > } > } > } > } > > Label label = new Label(shell, SWT.NONE); > label.setText("Borg"); > label.setFont(customFont); > > label = new Label(shell, SWT.NONE); > label.setText("Borg"); > label.setFont(boldFont); > > Text text = new Text(shell, SWT.BORDER); > text.setText("Borg"); > text.setFont(customFont); > > text = new Text(shell, SWT.BORDER); > text.setText("Borg"); > text.setFont(boldFont); > > Button button = new Button(shell, SWT.BORDER); > button.setText("Borg"); > button.setFont(customFont); > > button = new Button(shell, SWT.BORDER); > button.setText("Borg"); > button.setFont(boldFont); > > shell.setSize (200, 300); > shell.open (); > while (!shell.isDisposed()) { > if (!display.readAndDispatch ()) display.sleep (); > } > display.dispose (); >} >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 486734
:
259435
| 259436 |
262118
|
264877