Browse Source

Fixed checkstyle issues: tabs and trailing spaces


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@610337 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_95beta
Vincent Hennebert 16 years ago
parent
commit
5044438b50

+ 3
- 3
src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java View File

@@ -64,7 +64,7 @@ public class CustomFontMetricsMapper extends Typeface implements FontMetricsMapp
* @throws IOException
*/
public CustomFontMetricsMapper(final CustomFont fontMetrics)
throws FontFormatException, IOException {
throws FontFormatException, IOException {
this.typeface = fontMetrics;
initialize(fontMetrics.getEmbedFileSource());
}
@@ -77,13 +77,13 @@ public class CustomFontMetricsMapper extends Typeface implements FontMetricsMapp
* @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

+ 20
- 20
src/java/org/apache/fop/render/java2d/FontSetup.java View File

@@ -50,18 +50,18 @@ public class FontSetup {

/** 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 @@ public class FontSetup {
HARDCODED_FONT_NAMES.add("Times-Roman");
HARDCODED_FONT_NAMES.add("Computer-Modern-Typewriter");
}
/**
* Sets up the font info object.
*
@@ -85,7 +85,7 @@ public class FontSetup {
*/
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 @@ public class FontSetup {
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 @@ public class FontSetup {
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 @@ public class FontSetup {
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 @@ public class FontSetup {

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 @@ public class FontSetup {
}
return style;
}
}


Loading…
Cancel
Save