File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ private OS() {
72
72
73
73
/**
74
74
* @j2sNative
75
+ window["swt.adjustOSFontSize"] = function (size) {
76
+ if (window["swt.designer.os"] == "osx") {
77
+ return size + "px";
78
+ } else {
79
+ return size + "pt"; // windows
80
+ }
81
+ };
75
82
var os = $wt.internal.browser.OS;
76
83
var dua = navigator.userAgent;
77
84
os.isOpera = dua.indexOf ("Opera") >= 0;
Original file line number Diff line number Diff line change @@ -2437,7 +2437,18 @@ public void setFont (Font font) {
2437
2437
if (font .data .name != null ) {
2438
2438
handle .style .fontFamily = font .data .name ;
2439
2439
}
2440
- handle .style .fontSize = font .data .height + "pt" ;
2440
+ String fontSize = font .data .height + "pt" ;
2441
+ /**
2442
+ * @j2sNative
2443
+ * if (window["swt.adjustOSFontSize"] != null) {
2444
+ * c = window["swt.adjustOSFontSize"](a.data.height);
2445
+ * }
2446
+ * @j2sNativeSrc
2447
+ * if (window["swt.adjustOSFontSize"] != null) {
2448
+ * fontSize = window["swt.adjustOSFontSize"](font.data.height);
2449
+ * }
2450
+ */ {}
2451
+ handle .style .fontSize = fontSize ;
2441
2452
if ((font .data .style & SWT .BOLD ) != 0 ) {
2442
2453
handle .style .fontWeight = "bold" ;
2443
2454
} else {
You can’t perform that action at this time.
0 commit comments