Font.st
changeset 6163 f5e0de280f35
parent 6158 17d06f1e4ca6
child 6204 56abbbb55591
--- a/Font.st	Mon Nov 25 16:24:54 2013 +0100
+++ b/Font.st	Mon Nov 25 17:44:37 2013 +0100
@@ -667,11 +667,35 @@
 getFontMetrics
     "ask the device about all of my actual attributes"
 
+    |metrics|
+
     replacementFont notNil ifTrue:[
         ^ replacementFont getFontMetrics
     ].
 
-    ^ device fontMetricsOf:fontId.
+    metrics := device fontMetricsOf:fontId.
+
+    "the MS TrueType unicode core fonts in Linux have way to large ascent
+     and descent values, so the line spacing is too wide.
+     Take them from the latin-1 equivalent"
+    (device platformName == #X11
+     and:[encoding = #'iso10646-1'
+     and:[metrics ascent = metrics maxAscent 
+     and:[metrics descent == metrics maxDescent]]]) ifTrue:[
+        |latinFont latinMetrics|
+
+        latinFont := self asEncoding:'iso8859-1'.
+        latinFont notNil ifTrue:[
+            latinMetrics := latinFont getFontMetrics.
+            metrics ascent:latinMetrics ascent descent:latinMetrics descent.
+        ].
+    ].
+
+    ^ metrics.
+
+    "
+         (View defaultFont onDevice:Screen current) getFontMetrics
+     "
 !
 
 getFontResolution
@@ -1288,11 +1312,11 @@
 !Font class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.134 2013-11-22 11:02:32 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.135 2013-11-25 16:44:37 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.134 2013-11-22 11:02:32 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Font.st,v 1.135 2013-11-25 16:44:37 stefan Exp $'
 ! !