You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2008/01/09 12:02:09 UTC

svn commit: r610337 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d: CustomFontMetricsMapper.java FontSetup.java

Author: vhennebert
Date: Wed Jan  9 03:02:08 2008
New Revision: 610337

URL: http://svn.apache.org/viewvc?rev=610337&view=rev
Log:
Fixed checkstyle issues: tabs and trailing spaces

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/FontSetup.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java?rev=610337&r1=610336&r2=610337&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java Wed Jan  9 03:02:08 2008
@@ -64,7 +64,7 @@
      * @throws IOException
      */
     public CustomFontMetricsMapper(final CustomFont fontMetrics)
-    	throws FontFormatException, IOException {
+            throws FontFormatException, IOException {
         this.typeface = fontMetrics;
         initialize(fontMetrics.getEmbedFileSource());
     }
@@ -77,13 +77,13 @@
      * @throws IOException
      */
     public CustomFontMetricsMapper(final LazyFont fontMetrics, final Source fontSource)
-    		throws FontFormatException, IOException {
+            throws FontFormatException, IOException {
         this.typeface = fontMetrics;
         initialize(fontSource);
     }
 
     private static final int TYPE1_FONT = 1; //Defined in Java 1.5
-    
+
     /**
      * Loads the java.awt.Font
      * @param source

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/FontSetup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/FontSetup.java?rev=610337&r1=610336&r2=610337&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/FontSetup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/FontSetup.java Wed Jan  9 03:02:08 2008
@@ -50,18 +50,18 @@
 
     /** logging instance */
     protected static Log log = LogFactory.getLog(FontSetup.class);
-    
+
     private static final int LAST_PREDEFINED_FONT_NUMBER = 14;
 
     private static final Set HARDCODED_FONT_NAMES;
-    
+
     static {
         HARDCODED_FONT_NAMES = new java.util.HashSet();
         HARDCODED_FONT_NAMES.add("any");
         HARDCODED_FONT_NAMES.add("sans-serif");
         HARDCODED_FONT_NAMES.add("serif");
         HARDCODED_FONT_NAMES.add("monospace");
-        
+
         HARDCODED_FONT_NAMES.add("Helvetica");
         HARDCODED_FONT_NAMES.add("Times");
         HARDCODED_FONT_NAMES.add("Courier");
@@ -71,7 +71,7 @@
         HARDCODED_FONT_NAMES.add("Times-Roman");
         HARDCODED_FONT_NAMES.add("Computer-Modern-Typewriter");
     }
-    
+
     /**
      * Sets up the font info object.
      *
@@ -85,7 +85,7 @@
      */
     public static void setup(FontInfo fontInfo, List configuredFontList,
             FontResolver resolver, Graphics2D graphics) {
-	FontMetricsMapper metric;
+        FontMetricsMapper metric;
         int normal, bold, bolditalic, italic;
 
         /*
@@ -218,32 +218,32 @@
         fontInfo.addFontProperties("F8", "Times Roman", "italic", Font.WEIGHT_BOLD);
         fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
                                    "normal", Font.WEIGHT_NORMAL);
-        
-	int lastNum = configureInstalledAWTFonts(fontInfo, graphics, LAST_PREDEFINED_FONT_NUMBER + 1);
-	addConfiguredFonts(fontInfo, configuredFontList, resolver, lastNum++);
+
+        int lastNum = configureInstalledAWTFonts(fontInfo, graphics, LAST_PREDEFINED_FONT_NUMBER + 1);
+        addConfiguredFonts(fontInfo, configuredFontList, resolver, lastNum++);
     }
 
-    private static int configureInstalledAWTFonts(FontInfo fontInfo, Graphics2D graphics, 
+    private static int configureInstalledAWTFonts(FontInfo fontInfo, Graphics2D graphics,
             int startNumber) {
         int num = startNumber;
         GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        
+
         java.awt.Font[] fonts = env.getAllFonts();
         for (int i = 0; i < fonts.length; i++) {
             java.awt.Font f = fonts[i];
             if (HARDCODED_FONT_NAMES.contains(f.getName())) {
                 continue; //skip
             }
-            
+
             if (log.isTraceEnabled()) {
-                log.trace("AWT Font: " + f.getFontName() 
-                        + ", family: " + f.getFamily() 
-                        + ", PS: " + f.getPSName() 
+                log.trace("AWT Font: " + f.getFontName()
+                        + ", family: " + f.getFamily()
+                        + ", PS: " + f.getPSName()
                         + ", Name: " + f.getName()
                         + ", Angle: " + f.getItalicAngle()
                         + ", Style: " + f.getStyle());
             }
-            
+
             String searchName = FontUtil.stripWhiteSpace(f.getName()).toLowerCase();
             String guessedStyle = FontUtil.guessStyle(searchName);
             int guessedWeight = FontUtil.guessWeight(searchName);
@@ -252,7 +252,7 @@
             String fontKey = "F" + num;
             int style = convertToAWTFontStyle(guessedStyle, guessedWeight);
             addFontMetricsMapper(fontInfo, f.getName(), fontKey, graphics, style);
-            
+
             //Register appropriate font triplets matching the font. Two different strategies:
             //Example: "Arial Bold", normal, normal
             addFontTriplet(fontInfo, f.getName(),
@@ -320,12 +320,12 @@
                     fontInfo.addFontProperties(internalName, triplet);
                 }
             } catch (Exception e) {
-        	 log.warn("Unable to load custom font from file '" + fontFile + "'", e);
+                log.warn("Unable to load custom font from file '" + fontFile + "'", e);
             }
         }
     }
 
-    
+
     private static void addFontTriplet(FontInfo fontInfo, String fontName, String fontStyle,
             int fontWeight, String fontKey) {
         FontTriplet triplet = FontInfo.createFontKey(fontName, fontStyle, fontWeight);
@@ -334,7 +334,7 @@
 
     private static void addFontMetricsMapper(FontInfo fontInfo, String family, String fontKey,
             Graphics2D graphics, int style) {
-	FontMetricsMapper metric = new SystemFontMetricsMapper(family, style, graphics);
+        FontMetricsMapper metric = new SystemFontMetricsMapper(family, style, graphics);
         fontInfo.addMetrics(fontKey, metric);
     }
 
@@ -348,6 +348,6 @@
         }
         return style;
     }
-    
+
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org