OSDN Git Service

Normalise whitespace in GNU Classpath.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / gnu / java / awt / peer / gtk / GdkFontPeer.java
index 826cfbe..6b09906 100644 (file)
@@ -78,7 +78,7 @@ public class GdkFontPeer extends ClasspathFontPeer
   {
 
     public GdkFontMetrics (Font font)
   {
 
     public GdkFontMetrics (Font font)
-    {    
+    {
       super(initFont(font));
     }
 
       super(initFont(font));
     }
 
@@ -167,7 +167,7 @@ public class GdkFontPeer extends ClasspathFontPeer
 
   GdkFontMetrics metrics;
 
 
   GdkFontMetrics metrics;
 
-  static 
+  static
   {
     if (true) // GCJ LOCAL
       {
   {
     if (true) // GCJ LOCAL
       {
@@ -204,7 +204,7 @@ public class GdkFontPeer extends ClasspathFontPeer
     dispose ();
   }
 
     dispose ();
   }
 
-  /* 
+  /*
    * Helpers for the 3-way overloading that this class seems to suffer
    * from. Remove them if you feel like they're a performance bottleneck,
    * for the time being I prefer my code not be written and debugged in
    * Helpers for the 3-way overloading that this class seems to suffer
    * from. Remove them if you feel like they're a performance bottleneck,
    * for the time being I prefer my code not be written and debugged in
@@ -214,7 +214,7 @@ public class GdkFontPeer extends ClasspathFontPeer
   private String buildString(CharacterIterator iter)
   {
     CPStringBuilder sb = new CPStringBuilder();
   private String buildString(CharacterIterator iter)
   {
     CPStringBuilder sb = new CPStringBuilder();
-    for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) 
+    for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next())
       sb.append(c);
     return sb.toString();
   }
       sb.append(c);
     return sb.toString();
   }
@@ -223,7 +223,7 @@ public class GdkFontPeer extends ClasspathFontPeer
   {
     CPStringBuilder sb = new CPStringBuilder();
     int i = 0;
   {
     CPStringBuilder sb = new CPStringBuilder();
     int i = 0;
-    for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next(), i++) 
+    for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next(), i++)
       {
         if (begin <= i)
           sb.append(c);
       {
         if (begin <= i)
           sb.append(c);
@@ -232,7 +232,7 @@ public class GdkFontPeer extends ClasspathFontPeer
       }
     return sb.toString();
   }
       }
     return sb.toString();
   }
-  
+
   private String buildString(char[] chars, int begin, int limit)
   {
     return new String(chars, begin, limit - begin);
   private String buildString(char[] chars, int begin, int limit)
   {
     return new String(chars, begin, limit - begin);
@@ -247,8 +247,8 @@ public class GdkFontPeer extends ClasspathFontPeer
   }
 
   public GdkFontPeer (String name, int style, int size)
   }
 
   public GdkFontPeer (String name, int style, int size)
-  {  
-    super(name, style, size);    
+  {
+    super(name, style, size);
     initState ();
     setFont (this.familyName, this.style, (int)this.size);
     metricsCache = new HashMap<Integer,GlyphMetrics>();
     initState ();
     setFont (this.familyName, this.style, (int)this.size);
     metricsCache = new HashMap<Integer,GlyphMetrics>();
@@ -299,14 +299,14 @@ public class GdkFontPeer extends ClasspathFontPeer
 
   /**
    * Unneeded, but implemented anyway.
 
   /**
    * Unneeded, but implemented anyway.
-   */  
+   */
   public String getSubFamilyName(Font font, Locale locale)
   {
     String name;
   public String getSubFamilyName(Font font, Locale locale)
   {
     String name;
-    
+
     if (locale == null)
       locale = Locale.getDefault();
     if (locale == null)
       locale = Locale.getDefault();
-    
+
     name = getName(NameDecoder.NAME_SUBFAMILY, locale);
     if (name == null)
       {
     name = getName(NameDecoder.NAME_SUBFAMILY, locale);
     if (name == null)
       {
@@ -322,20 +322,20 @@ public class GdkFontPeer extends ClasspathFontPeer
    * Returns the bytes belonging to a TrueType/OpenType table,
    * Parameters n,a,m,e identify the 4-byte ASCII tag of the table.
    *
    * Returns the bytes belonging to a TrueType/OpenType table,
    * Parameters n,a,m,e identify the 4-byte ASCII tag of the table.
    *
-   * Returns null if the font is not TT, the table is nonexistant, 
+   * Returns null if the font is not TT, the table is nonexistant,
    * or if some other unexpected error occured.
    *
    */
   private native byte[] getTrueTypeTable(byte n, byte a, byte m, byte e);
 
   /**
    * or if some other unexpected error occured.
    *
    */
   private native byte[] getTrueTypeTable(byte n, byte a, byte m, byte e);
 
   /**
-   * Returns the PostScript name of the font, defaults to the familyName if 
+   * Returns the PostScript name of the font, defaults to the familyName if
    * a PS name could not be retrieved.
    */
   public String getPostScriptName(Font font)
   {
    * a PS name could not be retrieved.
    */
   public String getPostScriptName(Font font)
   {
-    String name = getName(NameDecoder.NAME_POSTSCRIPT, 
-                         /* any language */ null);
+    String name = getName(NameDecoder.NAME_POSTSCRIPT,
+                          /* any language */ null);
     if( name == null )
       return this.familyName;
 
     if( name == null )
       return this.familyName;
 
@@ -356,7 +356,7 @@ public class GdkFontPeer extends ClasspathFontPeer
   {
     if (nameTable == null)
       {
   {
     if (nameTable == null)
       {
-        byte[] data = getTrueTypeTable((byte)'n', (byte) 'a', 
+        byte[] data = getTrueTypeTable((byte)'n', (byte) 'a',
                                        (byte) 'm', (byte) 'e');
         if( data == null )
           return null;
                                        (byte) 'm', (byte) 'e');
         if( data == null )
           return null;
@@ -378,16 +378,16 @@ public class GdkFontPeer extends ClasspathFontPeer
     // FIXME: inquire with pango
     return -1;
   }
     // FIXME: inquire with pango
     return -1;
   }
-  
-  public GlyphVector createGlyphVector (Font font, 
-                                        FontRenderContext ctx, 
+
+  public GlyphVector createGlyphVector (Font font,
+                                        FontRenderContext ctx,
                                         CharacterIterator i)
   {
     return new FreetypeGlyphVector(font, buildString (i), ctx);
   }
 
                                         CharacterIterator i)
   {
     return new FreetypeGlyphVector(font, buildString (i), ctx);
   }
 
-  public GlyphVector createGlyphVector (Font font, 
-                                        FontRenderContext ctx, 
+  public GlyphVector createGlyphVector (Font font,
+                                        FontRenderContext ctx,
                                         int[] glyphCodes)
   {
     return new FreetypeGlyphVector(font, glyphCodes, ctx);
                                         int[] glyphCodes)
   {
     return new FreetypeGlyphVector(font, glyphCodes, ctx);
@@ -411,32 +411,32 @@ public class GdkFontPeer extends ClasspathFontPeer
     {
       return ascent;
     }
     {
       return ascent;
     }
-  
+
     public int getBaselineIndex()
     public int getBaselineIndex()
-    {      
+    {
       // FIXME
       return Font.ROMAN_BASELINE;
     }
       // FIXME
       return Font.ROMAN_BASELINE;
     }
-    
+
     public float[] getBaselineOffsets()
     {
       return new float[3];
     }
     public float[] getBaselineOffsets()
     {
       return new float[3];
     }
-    
+
     public float getDescent()
     {
       return descent;
     }
     public float getDescent()
     {
       return descent;
     }
-    
+
     public float getHeight()
     {
       return height;
     }
     public float getHeight()
     {
       return height;
     }
-    
+
     public float getLeading()
     {
       return height - (ascent + descent);
     public float getLeading()
     {
       return height - (ascent + descent);
-    }    
+    }
 
     public int getNumChars()
     {
 
     public int getNumChars()
     {
@@ -447,13 +447,13 @@ public class GdkFontPeer extends ClasspathFontPeer
     {
       // FreeType doesn't seem to provide a value here.
       return ascent / 2;
     {
       // FreeType doesn't seem to provide a value here.
       return ascent / 2;
-    }    
+    }
 
     public float getStrikethroughThickness()
     {
       // FreeType doesn't seem to provide a value here.
       return 1.f;
 
     public float getStrikethroughThickness()
     {
       // FreeType doesn't seem to provide a value here.
       return 1.f;
-    }  
+    }
 
     public float getUnderlineOffset()
     {
 
     public float getUnderlineOffset()
     {
@@ -467,7 +467,7 @@ public class GdkFontPeer extends ClasspathFontPeer
 
   }
 
 
   }
 
-  public LineMetrics getLineMetrics (Font font, CharacterIterator ci, 
+  public LineMetrics getLineMetrics (Font font, CharacterIterator ci,
                                      int begin, int limit, FontRenderContext rc)
   {
     return new GdkFontLineMetrics (this, limit - begin);
                                      int begin, int limit, FontRenderContext rc)
   {
     return new GdkFontLineMetrics (this, limit - begin);
@@ -490,12 +490,12 @@ public class GdkFontPeer extends ClasspathFontPeer
 
   public int getNumGlyphs (Font font)
   {
 
   public int getNumGlyphs (Font font)
   {
-    byte[] data = getTrueTypeTable((byte)'m', (byte) 'a', 
-                                  (byte)'x', (byte) 'p');
+    byte[] data = getTrueTypeTable((byte)'m', (byte) 'a',
+                                   (byte)'x', (byte) 'p');
     if( data == null )
       return -1;
 
     if( data == null )
       return -1;
 
-    ByteBuffer buf = ByteBuffer.wrap( data );       
+    ByteBuffer buf = ByteBuffer.wrap( data );
     return buf.getShort(4);
   }
 
     return buf.getShort(4);
   }
 
@@ -504,15 +504,15 @@ public class GdkFontPeer extends ClasspathFontPeer
     return true;
   }
 
     return true;
   }
 
-  public GlyphVector layoutGlyphVector (Font font, FontRenderContext frc, 
-                                        char[] chars, int start, int limit, 
+  public GlyphVector layoutGlyphVector (Font font, FontRenderContext frc,
+                                        char[] chars, int start, int limit,
                                         int flags)
   {
     return new FreetypeGlyphVector(font, chars, start, limit - start,
                                    frc, flags);
   }
 
                                         int flags)
   {
     return new FreetypeGlyphVector(font, chars, start, limit - start,
                                    frc, flags);
   }
 
-  public LineMetrics getLineMetrics (Font font, String str, 
+  public LineMetrics getLineMetrics (Font font, String str,
                                      FontRenderContext frc)
   {
     return new GdkFontLineMetrics (this, str.length ());
                                      FontRenderContext frc)
   {
     return new GdkFontLineMetrics (this, str.length ());
@@ -536,7 +536,7 @@ public class GdkFontPeer extends ClasspathFontPeer
 
   /**
    * Put a GlyphMetrics object in the cache.
 
   /**
    * Put a GlyphMetrics object in the cache.
-   */ 
+   */
   void putGlyphMetrics( int glyphCode, GlyphMetrics metrics )
   {
     metricsCache.put( new Integer( glyphCode ), metrics );
   void putGlyphMetrics( int glyphCode, GlyphMetrics metrics )
   {
     metricsCache.put( new Integer( glyphCode ), metrics );