@@ -2137,8 +2137,9 @@ public FontMetrics getLineMetrics (int lineIndex) {
21372137 OS .DeleteDC (srcHdc );
21382138 device .internal_dispose_GC (hDC , null );
21392139
2140- int ascentInPoints = this .ascent ;
2141- int descentInPoints = this .descent ;
2140+ final int zoom = getZoom ();
2141+ int ascentInPoints = Math .max (DPIUtil .scaleDown (getDevice (), lptm .tmAscent , zoom ), this .ascent );
2142+ int descentInPoints = Math .max (DPIUtil .scaleDown (getDevice (), lptm .tmDescent , zoom ), this .descent );
21422143 int leadingInPoints = DPIUtil .scaleDown (getDevice (), lptm .tmInternalLeading , availableFont .zoom );
21432144 if (text .length () != 0 ) {
21442145 for (StyleItem run : runs [lineIndex ]) {
@@ -2149,10 +2150,10 @@ public FontMetrics getLineMetrics (int lineIndex) {
21492150 descentInPoints = Math .max (descentInPoints , run .descentInPoints );
21502151 }
21512152 }
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 () );
2153+ lptm .tmAscent = DPIUtil .scaleUp (getDevice (), ascentInPoints , zoom );
2154+ lptm .tmDescent = DPIUtil .scaleUp (getDevice (), descentInPoints , zoom );
2155+ lptm .tmHeight = DPIUtil .scaleUp (getDevice (), ascentInPoints + descentInPoints , zoom );
2156+ lptm .tmInternalLeading = DPIUtil .scaleUp (getDevice (), leadingInPoints , zoom );
21562157 lptm .tmAveCharWidth = 0 ;
21572158 return FontMetrics .win32_new (lptm , nativeZoom );
21582159}
0 commit comments