@@ -333,10 +333,10 @@ void checkGC(int mask) {
333
333
}
334
334
}
335
335
if ((state & FONT ) != 0 ) {
336
- Font font = data .font ;
337
- OS .SelectObject (handle , font . handle );
336
+ long fontHandle = SWTFontProvider . getFontHandle ( data .font , data . nativeZoom ) ;
337
+ OS .SelectObject (handle , fontHandle );
338
338
long [] hFont = new long [1 ];
339
- long gdipFont = createGdipFont (handle , font . handle , gdipGraphics , device .fontCollection , null , hFont );
339
+ long gdipFont = createGdipFont (handle , fontHandle , gdipGraphics , device .fontCollection , null , hFont );
340
340
if (hFont [0 ] != 0 ) OS .SelectObject (handle , hFont [0 ]);
341
341
if (data .hGDIFont != 0 ) OS .DeleteObject (data .hGDIFont );
342
342
data .hGDIFont = hFont [0 ];
@@ -454,8 +454,8 @@ void checkGC(int mask) {
454
454
OS .SetTextColor (handle , data .foreground );
455
455
}
456
456
if ((state & FONT ) != 0 ) {
457
- Font font = data .font ;
458
- OS .SelectObject (handle , font . handle );
457
+ long fontHandle = SWTFontProvider . getFontHandle ( data .font , data . nativeZoom ) ;
458
+ OS .SelectObject (handle , fontHandle );
459
459
}
460
460
}
461
461
@@ -2388,7 +2388,7 @@ void drawText(long gdipGraphics, String string, int x, int y, int flags, Point s
2388
2388
char [] chars = string .toCharArray ();
2389
2389
long hdc = Gdip .Graphics_GetHDC (gdipGraphics );
2390
2390
long hFont = data .hGDIFont ;
2391
- if (hFont == 0 && data .font != null ) hFont = data .font . handle ;
2391
+ if (hFont == 0 && data .font != null ) hFont = SWTFontProvider . getFontHandle ( data .font , data . nativeZoom ) ;
2392
2392
long oldFont = 0 ;
2393
2393
if (hFont != 0 ) oldFont = OS .SelectObject (hdc , hFont );
2394
2394
TEXTMETRIC lptm = new TEXTMETRIC ();
@@ -2478,7 +2478,7 @@ RectF drawText(long gdipGraphics, char[] buffer, int start, int length, int x, i
2478
2478
}
2479
2479
long hdc = Gdip .Graphics_GetHDC (gdipGraphics );
2480
2480
long hFont = data .hGDIFont ;
2481
- if (hFont == 0 && data .font != null ) hFont = data .font . handle ;
2481
+ if (hFont == 0 && data .font != null ) hFont = SWTFontProvider . getFontHandle ( data .font , data . nativeZoom ) ;
2482
2482
long oldFont = 0 ;
2483
2483
if (hFont != 0 ) oldFont = OS .SelectObject (hdc , hFont );
2484
2484
if (start != 0 ) {
0 commit comments