@@ -2136,10 +2136,10 @@ public FontMetrics getLineMetrics (int lineIndex) {
2136
2136
metricsAdapter .GetTextMetrics (srcHdc , lptm );
2137
2137
OS .DeleteDC (srcHdc );
2138
2138
device .internal_dispose_GC (hDC , null );
2139
-
2140
- int ascentInPoints = this .ascent ;
2141
- int descentInPoints = this .descent ;
2142
- int leadingInPoints = DPIUtil .scaleDown (getDevice () , lptm .tmInternalLeading , availableFont .zoom );
2139
+ final int zoom = getZoom ();
2140
+ int ascentInPoints = Math . max ( DPIUtil . scaleDown ( this .device , lptm . tmAscent , zoom ), this . ascent ) ;
2141
+ int descentInPoints = Math . max ( DPIUtil . scaleDown ( this .device , lptm . tmDescent , zoom ), this . descent ) ;
2142
+ int leadingInPoints = DPIUtil .scaleDown (this . device , lptm .tmInternalLeading , availableFont .zoom );
2143
2143
if (text .length () != 0 ) {
2144
2144
for (StyleItem run : runs [lineIndex ]) {
2145
2145
if (run .ascentInPoints > ascentInPoints ) {
@@ -2149,10 +2149,10 @@ public FontMetrics getLineMetrics (int lineIndex) {
2149
2149
descentInPoints = Math .max (descentInPoints , run .descentInPoints );
2150
2150
}
2151
2151
}
2152
- lptm .tmAscent = DPIUtil .scaleUp (getDevice () , ascentInPoints , getZoom () );
2153
- lptm .tmDescent = DPIUtil .scaleUp (getDevice () , descentInPoints , getZoom () );
2154
- lptm .tmHeight = DPIUtil .scaleUp (getDevice () , ascentInPoints + descentInPoints , getZoom () );
2155
- lptm .tmInternalLeading = DPIUtil .scaleUp (getDevice () , leadingInPoints , getZoom () );
2152
+ lptm .tmAscent = DPIUtil .scaleUp (this . device , ascentInPoints , zoom );
2153
+ lptm .tmDescent = DPIUtil .scaleUp (this . device , descentInPoints , zoom );
2154
+ lptm .tmHeight = DPIUtil .scaleUp (this . device , ascentInPoints + descentInPoints , zoom );
2155
+ lptm .tmInternalLeading = DPIUtil .scaleUp (this . device , leadingInPoints , zoom );
2156
2156
lptm .tmAveCharWidth = 0 ;
2157
2157
return FontMetrics .win32_new (lptm , nativeZoom );
2158
2158
}
0 commit comments