2002/04/29 00:39:43
[org.ibex.core.git] / src / org / xwt / Platform.java
index 6c97cae..0de6cc0 100644 (file)
@@ -178,8 +178,8 @@ public class Platform {
     /** returns the maximum ascent of all glyphs in a given platform-specific font */
     public static int getMaxAscent(String font) { return platform._getMaxAscent(font); }
 
-    /** returns the maximum descent of all glyphs in a given platform-specific font */
-    public static int getMaxDescent(String font) { return platform._getMaxDescent(font); }
+    /** returns the maximum descent of all glyphs in a given platform-specific font. Three pixel minimum ensures space for underline. */
+    public static int getMaxDescent(String font) { return Math.max(3, platform._getMaxDescent(font)); }
 
     /** returns the maximum number of threads that the XWT engine can create without adversely affecting the host OS */
     public static int maxThreads() { return platform._maxThreads(); }
@@ -307,10 +307,10 @@ public class Platform {
                 i = j;
                 while(i < font.length()) {
                     switch (font.charAt(i)) {
-                    case 'b': bold = true;
-                    case 'i': italic = true;
-                    case 'd': dotted_underline = true;
-                    case 'u': underline = true;
+                    case 'b': bold = true; break;
+                    case 'i': italic = true; break;
+                    case 'd': dotted_underline = true; break;
+                    case 'u': underline = true; break;
                     }
                     i++;
                 }