Author: tilman
Date: Sun Oct 22 08:33:43 2023
New Revision: 1913192
URL: http://svn.apache.org/viewvc?rev=1913192&view=rev
Log:
PDFBOX-5695: set logging to log4j, as suggested by Axel Howind
Modified:
pdfbox/trunk/fontbox/pom.xml
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharString.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningSubtable.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningTable.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OS2WindowsMetricsTable.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/DefaultGsubWorker.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForBengali.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForLatin.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java
Modified: pdfbox/trunk/fontbox/pom.xml
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/pom.xml?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/pom.xml (original)
+++ pdfbox/trunk/fontbox/pom.xml Sun Oct 22 08:33:43 2023
@@ -1,150 +1,155 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.pdfbox</groupId>
- <artifactId>pdfbox-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
- </parent>
-
- <artifactId>fontbox</artifactId>
- <packaging>bundle</packaging>
-
- <name>Apache FontBox</name>
- <description>
- The Apache FontBox library is an open source Java tool to obtain low level
information
- from font files. FontBox is a subproject of Apache PDFBox.
- </description>
-
- <inceptionYear>2008</inceptionYear>
- <url>http://pdfbox.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.pdfbox</groupId>
- <artifactId>pdfbox-io</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
-
<Automatic-Module-Name>org.apache.fontbox</Automatic-Module-Name>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>src/main/resources/org/apache/fontbox/cmap/*</exclude>
-
<exclude>src/main/resources/org/apache/fontbox/unicode/*</exclude>
- <exclude>src/test/resources/afm/*</exclude>
- </excludes>
- </configuration>
- </plugin>
- <!-- download test files from JIRA and keep them in repository cache -->
- <plugin>
- <groupId>com.googlecode.maven-download-plugin</groupId>
- <artifactId>download-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>PDFBOX-4038</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
-
<url>https://issues.apache.org/jira/secure/attachment/12684264/SourceSansProBold.otf</url>
-
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
-
<sha512>28a044a2685fbc8da7810d9ac7b6b93a95542d504d7d8e671f009b8ebb2f5b70c974be7ea78974b188d8e6ab17d65b08f276c054927857315d5aad26f6fe36fc</sha512>
- </configuration>
- </execution>
- <execution>
- <id>PDFBOX-3997</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
-
<url>https://issues.apache.org/jira/secure/attachment/12896461/NotoEmoji-Regular.ttf</url>
-
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
-
<sha512>51b01ab0794be9f92c59679f6d56d4ce09ed959daeb9ec945bb837eb15a82ab302e83b29aab1972ac9cb648f7196a5f5ff4488a4622b36bedbc9cd0cab6dc3de</sha512>
- </configuration>
- </execution>
- <execution>
- <id>PDFBOX-3379</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
-
<url>https://issues.apache.org/jira/secure/attachment/12809395/DejaVuSansMono.ttf</url>
-
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
-
<sha512>1af1ce3e6d34a0b89c93072d8646e92cceb45b276389d2dd0d84457ec1193394d2bcc49bf3ce99c9c6b2658cd1337fc40ee5c61957f74cd45dbc3d51b6aef417</sha512>
- </configuration>
- </execution>
- <execution>
- <id>PDFBOX-5328</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
-
<url>https://issues.apache.org/jira/secure/attachment/13036376/NotoSansSC-Regular.otf</url>
-
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
-
<sha512>cbdd317d16099d24736457eef631353c7830a1a3c132b01f2cdc1e6a0c21a78e3b1fe8479b3f40179e7630a15cc23a093775bb22d521dba39376bb367d497b21</sha512>
- </configuration>
- </execution>
- <execution>
- <id>PDFBOX-5356</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
-
<url>https://mirror.math.princeton.edu/pub/CTAN/fonts/opensans/type1/OpenSans-Regular.pfb</url>
-
<outputDirectory>${project.build.directory}/fonts</outputDirectory>
-
<sha512>2787fcecc0feb1c9e6ff0d8de6193658413863e44eaab572751ca7e6c3b369c0a9731f4952cb0821f307760f0422f77c5f0d3fe7df6b054643fb39423e8d70ee</sha512>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.pdfbox</groupId>
+ <artifactId>pdfbox-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>fontbox</artifactId>
+ <packaging>bundle</packaging>
+
+ <name>Apache FontBox</name>
+ <description>
+ The Apache FontBox library is an open source Java tool to obtain low level
information
+ from font files. FontBox is a subproject of Apache PDFBox.
+ </description>
+
+ <inceptionYear>2008</inceptionYear>
+ <url>http://pdfbox.apache.org/</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.pdfbox</groupId>
+ <artifactId>pdfbox-io</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+
<Automatic-Module-Name>org.apache.fontbox</Automatic-Module-Name>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>src/main/resources/org/apache/fontbox/cmap/*</exclude>
+
<exclude>src/main/resources/org/apache/fontbox/unicode/*</exclude>
+ <exclude>src/test/resources/afm/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <!-- download test files from JIRA and keep them in repository cache -->
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>PDFBOX-4038</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+
<url>https://issues.apache.org/jira/secure/attachment/12684264/SourceSansProBold.otf</url>
+
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
+
<sha512>28a044a2685fbc8da7810d9ac7b6b93a95542d504d7d8e671f009b8ebb2f5b70c974be7ea78974b188d8e6ab17d65b08f276c054927857315d5aad26f6fe36fc</sha512>
+ </configuration>
+ </execution>
+ <execution>
+ <id>PDFBOX-3997</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+
<url>https://issues.apache.org/jira/secure/attachment/12896461/NotoEmoji-Regular.ttf</url>
+
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
+
<sha512>51b01ab0794be9f92c59679f6d56d4ce09ed959daeb9ec945bb837eb15a82ab302e83b29aab1972ac9cb648f7196a5f5ff4488a4622b36bedbc9cd0cab6dc3de</sha512>
+ </configuration>
+ </execution>
+ <execution>
+ <id>PDFBOX-3379</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+
<url>https://issues.apache.org/jira/secure/attachment/12809395/DejaVuSansMono.ttf</url>
+
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
+
<sha512>1af1ce3e6d34a0b89c93072d8646e92cceb45b276389d2dd0d84457ec1193394d2bcc49bf3ce99c9c6b2658cd1337fc40ee5c61957f74cd45dbc3d51b6aef417</sha512>
+ </configuration>
+ </execution>
+ <execution>
+ <id>PDFBOX-5328</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+
<url>https://issues.apache.org/jira/secure/attachment/13036376/NotoSansSC-Regular.otf</url>
+
<outputDirectory>${project.build.directory}/pdfs</outputDirectory>
+
<sha512>cbdd317d16099d24736457eef631353c7830a1a3c132b01f2cdc1e6a0c21a78e3b1fe8479b3f40179e7630a15cc23a093775bb22d521dba39376bb367d497b21</sha512>
+ </configuration>
+ </execution>
+ <execution>
+ <id>PDFBOX-5356</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ <configuration>
+
<url>https://mirror.math.princeton.edu/pub/CTAN/fonts/opensans/type1/OpenSans-Regular.pfb</url>
+
<outputDirectory>${project.build.directory}/fonts</outputDirectory>
+
<sha512>2787fcecc0feb1c9e6ff0d8de6193658413863e44eaab572751ca7e6c3b369c0a9731f4952cb0821f307760f0422f77c5f0d3fe7df6b054643fb39423e8d70ee</sha512>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFParser.java
Sun Oct 22 08:33:43 2023
@@ -26,8 +26,9 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
import org.apache.pdfbox.io.RandomAccessRead;
@@ -40,7 +41,7 @@ public class CFFParser
/**
* Log instance.
*/
- private static final Log LOG = LogFactory.getLog(CFFParser.class);
+ private static final Logger LOG = LogManager.getLogger(CFFParser.class);
private static final String TAG_OTTO = "OTTO";
private static final String TAG_TTCF = "ttcf";
@@ -411,7 +412,7 @@ public class CFFParser
case 0xb:
if (hasExponent)
{
- LOG.warn("duplicate 'E' ignored after " + sb);
+ LOG.warn("duplicate 'E' ignored after {}", sb);
break;
}
sb.append('E');
@@ -421,7 +422,7 @@ public class CFFParser
case 0xc:
if (hasExponent)
{
- LOG.warn("duplicate 'E-' ignored after " + sb);
+ LOG.warn("duplicate 'E-' ignored after {}", sb);
break;
}
sb.append("E-");
@@ -1302,7 +1303,7 @@ public class CFFParser
break;
}
}
- LOG.warn("Expected boolean, got " + operand + ", returning
default " + defaultValue);
+ LOG.warn("Expected boolean, got {}, returning default {}",
operand, defaultValue);
return defaultValue;
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharString.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharString.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharString.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharString.java
Sun Oct 22 08:33:43 2023
@@ -25,8 +25,9 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
import org.apache.fontbox.cff.CharStringCommand.Type1KeyWord;
import org.apache.fontbox.encoding.StandardEncoding;
import org.apache.fontbox.type1.Type1CharStringReader;
@@ -39,7 +40,7 @@ import org.apache.fontbox.type1.Type1Cha
*/
public class Type1CharString
{
- private static final Log LOG = LogFactory.getLog(Type1CharString.class);
+ private static final Logger LOG =
LogManager.getLogger(Type1CharString.class);
private final Type1CharStringReader font;
private final String fontName;
@@ -167,7 +168,7 @@ public class Type1CharString
if (type1KeyWord == null)
{
// indicates an invalid charstring
- LOG.warn("Unknown charstring command in glyph " + glyphName + " of
font " + fontName);
+ LOG.warn("Unknown charstring command in glyph {} of font {}",
glyphName, fontName);
return Collections.emptyList();
}
switch(type1KeyWord)
@@ -317,8 +318,8 @@ public class Type1CharString
case RET:
case CALLSUBR:
// indicates an invalid charstring
- LOG.warn("Unexpected charstring command: " + type1KeyWord + " in
glyph " + glyphName + " of font "
- + fontName);
+ LOG.warn("Unexpected charstring command: {} in glyph {} of font
{}", type1KeyWord,
+ glyphName, fontName);
break;
default:
// indicates a PDFBox bug
@@ -349,8 +350,8 @@ public class Type1CharString
if (flexPoints.size() < 7)
{
- LOG.warn("flex without moveTo in font " + fontName + ", glyph
" + glyphName +
- ", command " + commandCount);
+ LOG.warn("flex without moveTo in font {}, glyph {}, command
{}", fontName,
+ glyphName, commandCount);
return;
}
@@ -385,7 +386,7 @@ public class Type1CharString
}
else
{
- LOG.warn("Invalid callothersubr parameter: " + num);
+ LOG.warn("Invalid callothersubr parameter: {}", num);
}
}
@@ -409,7 +410,7 @@ public class Type1CharString
float y = (float)current.getY() + dy.floatValue();
if (path.getCurrentPoint() == null)
{
- LOG.warn("rlineTo without initial moveTo in font " + fontName + ",
glyph " + glyphName);
+ LOG.warn("rlineTo without initial moveTo in font {}, glyph {}",
fontName, glyphName);
path.moveTo(x, y);
}
else
@@ -433,7 +434,7 @@ public class Type1CharString
float y3 = y2 + dy3.floatValue();
if (path.getCurrentPoint() == null)
{
- LOG.warn("rrcurveTo without initial moveTo in font " + fontName +
", glyph " + glyphName);
+ LOG.warn("rrcurveTo without initial moveTo in font {}, glyph {}",
fontName, glyphName);
path.moveTo(x3, y3);
}
else
@@ -450,7 +451,7 @@ public class Type1CharString
{
if (path.getCurrentPoint() == null)
{
- LOG.warn("closepath without initial moveTo in font " + fontName +
", glyph " + glyphName);
+ LOG.warn("closepath without initial moveTo in font {}, glyph {}",
fontName, glyphName);
}
else
{
@@ -476,7 +477,7 @@ public class Type1CharString
}
catch (IOException e)
{
- LOG.warn("invalid seac character in glyph " + glyphName + " of
font " + fontName, e);
+ LOG.warn("invalid seac character in glyph {} of font {}",
glyphName, fontName, e);
}
// accent character
String accentName =
StandardEncoding.INSTANCE.getName(achar.intValue());
@@ -488,7 +489,7 @@ public class Type1CharString
{
// PDFBOX-5339: avoid ArrayIndexOutOfBoundsException
// reproducable with poc file
crash-4698e0dc7833a3f959d06707e01d03cda52a83f4
- LOG.warn("Path for " + baseName + " and for accent " +
accentName + " are same, ignored");
+ LOG.warn("Path for {} and for accent {} are same, ignored",
baseName, accentName);
return;
}
AffineTransform at = AffineTransform.getTranslateInstance(
@@ -498,7 +499,7 @@ public class Type1CharString
}
catch (IOException e)
{
- LOG.warn("invalid seac character in glyph " + glyphName + " of
font " + fontName, e);
+ LOG.warn("invalid seac character in glyph {} of font {}",
glyphName, fontName, e);
}
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type1CharStringParser.java
Sun Oct 22 08:33:43 2023
@@ -22,8 +22,9 @@ import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
import org.apache.fontbox.cff.CharStringCommand.Type1KeyWord;
/**
@@ -36,7 +37,7 @@ import org.apache.fontbox.cff.CharString
*/
public class Type1CharStringParser
{
- private static final Log LOG =
LogFactory.getLog(Type1CharStringParser.class);
+ private static final Logger LOG =
LogManager.getLogger(Type1CharStringParser.class);
// 1-byte commands
private static final int CALLSUBR = 10;
@@ -111,8 +112,9 @@ public class Type1CharStringParser
Object obj = sequence.remove(sequence.size() - 1);
if (!(obj instanceof Integer))
{
- LOG.warn("Parameter " + obj + " for CALLSUBR is ignored, integer
expected in glyph '"
- + currentGlyph + "' of font " + fontName);
+ LOG.warn(
+ "Parameter {} for CALLSUBR is ignored, integer expected in
glyph '{}' of font {}",
+ obj, currentGlyph, fontName);
return;
}
Integer operand = (Integer) obj;
@@ -130,8 +132,8 @@ public class Type1CharStringParser
}
else
{
- LOG.warn("CALLSUBR is ignored, operand: " + operand + ",
subrs.size(): " + subrs.size()
- + " in glyph '" + currentGlyph + "' of font " + fontName);
+ LOG.warn("CALLSUBR is ignored, operand: {}, subrs.size(): {} in
glyph '{}' of font {}",
+ operand, subrs.size(), currentGlyph, fontName);
// remove all parameters (there can be more than one)
while (sequence.get(sequence.size() - 1) instanceof Integer)
{
@@ -188,8 +190,8 @@ public class Type1CharStringParser
if (!results.isEmpty())
{
- LOG.warn("Value left on the PostScript stack in glyph " +
currentGlyph + " of font "
- + fontName);
+ LOG.warn("Value left on the PostScript stack in glyph {} of font
{}", currentGlyph,
+ fontName);
}
}
Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cmap/CMap.java Sun
Oct 22 08:33:43 2023
@@ -23,9 +23,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* This class represents a CMap file.
*
@@ -33,7 +32,7 @@ import org.apache.commons.logging.LogFac
*/
public class CMap
{
- private static final Log LOG = LogFactory.getLog(CMap.class);
+ private static final Logger LOG = LogManager.getLogger(CMap.class);
private int wmode = 0;
private String cmapName = null;
@@ -184,7 +183,7 @@ public class CMap
{
sb.append(String.format("0x%02X (%04o) ", bytes[i], bytes[i]));
}
- LOG.warn("Invalid character code sequence " + sb + "in CMap " +
cmapName);
+ LOG.warn("Invalid character code sequence {} in CMap {}", sb,
cmapName);
}
// PDFBOX-4811 reposition to where we were after initial read
if (in.markSupported())
@@ -193,8 +192,8 @@ public class CMap
}
else
{
- LOG.warn("mark() and reset() not supported, " + (maxCodeLength -
1) +
- " bytes have been skipped");
+ LOG.warn("mark() and reset() not supported, {} bytes have been
skipped",
+ maxCodeLength - 1);
}
return toInt(bytes, minCodeLength); // Adobe Reader behavior
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
Sun Oct 22 08:33:43 2023
@@ -24,9 +24,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* A "cmap" subtable.
*
@@ -34,7 +33,7 @@ import org.apache.commons.logging.LogFac
*/
public class CmapSubtable implements CmapLookup
{
- private static final Log LOG = LogFactory.getLog(CmapSubtable.class);
+ private static final Logger LOG = LogManager.getLogger(CmapSubtable.class);
private static final long LEAD_OFFSET = 0xD800l - (0x10000 >> 10);
private static final long SURROGATE_OFFSET = 0x10000l - (0xD800 << 10) -
0xDC00;
@@ -548,7 +547,8 @@ public class CmapSubtable implements Cma
if (p >= numGlyphs)
{
- LOG.warn("glyphId " + p + " for charcode " + charCode + "
ignored, numGlyphs is " + numGlyphs);
+ LOG.warn("glyphId {} for charcode {} ignored, numGlyphs is
{}", p, charCode,
+ numGlyphs);
continue;
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfCompositeDescript.java
Sun Oct 22 08:33:43 2023
@@ -25,9 +25,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* Glyph description for composite glyphs. Composite glyphs are made up of one
* or more simple glyphs, usually with some sort of transformation applied to
@@ -41,7 +40,7 @@ public class GlyfCompositeDescript exten
/**
* Log instance.
*/
- private static final Log LOG =
LogFactory.getLog(GlyfCompositeDescript.class);
+ private static final Logger LOG =
LogManager.getLogger(GlyfCompositeDescript.class);
private final List<GlyfCompositeComp> components = new ArrayList<>();
private final Map<Integer,GlyphDescription> descriptions = new HashMap<>();
@@ -209,7 +208,7 @@ public class GlyfCompositeDescript exten
GlyphDescription gd = descriptions.get(c.getGlyphIndex());
if (gd == null)
{
- LOG.error("GlyphDescription for index " + c.getGlyphIndex() +
" is null, returning 0");
+ LOG.error("GlyphDescription for index {} is null, returning
0", c.getGlyphIndex());
pointCount = 0;
}
else
@@ -236,7 +235,7 @@ public class GlyfCompositeDescript exten
GlyphDescription gd = descriptions.get(c.getGlyphIndex());
if (gd == null)
{
- LOG.error("missing glyph description for index " +
c.getGlyphIndex());
+ LOG.error("missing glyph description for index {}",
c.getGlyphIndex());
contourCount = 0;
}
else
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyfSimpleDescript.java
Sun Oct 22 08:33:43 2023
@@ -19,9 +19,8 @@
package org.apache.fontbox.ttf;
import java.io.IOException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* This class is based on code from Apache Batik a subproject of Apache
XMLGraphics. see
* http://xmlgraphics.apache.org/batik/ for further details.
@@ -32,7 +31,7 @@ public class GlyfSimpleDescript extends
/**
* Log instance.
*/
- private static final Log LOG = LogFactory.getLog(GlyfSimpleDescript.class);
+ private static final Logger LOG =
LogManager.getLogger(GlyfSimpleDescript.class);
private int[] endPtsOfContours;
private byte[] flags;
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
Sun Oct 22 08:33:43 2023
@@ -16,9 +16,8 @@
*/
package org.apache.fontbox.ttf;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import java.awt.geom.GeneralPath;
import java.util.ArrayList;
import java.util.List;
@@ -39,7 +38,7 @@ import java.util.Locale;
*/
class GlyphRenderer
{
- private static final Log LOG = LogFactory.getLog(GlyphRenderer.class);
+ private static final Logger LOG =
LogManager.getLogger(GlyphRenderer.class);
private final GlyphDescription glyphDescription;
@@ -151,29 +150,21 @@ class GlyphRenderer
private void moveTo(GeneralPath path, Point point)
{
path.moveTo(point.x, point.y);
- if (LOG.isTraceEnabled())
- {
- LOG.trace("moveTo: " + String.format(Locale.US, "%d,%d", point.x,
point.y));
- }
+ LOG.trace("moveTo: {}", () -> String.format(Locale.US, "%d,%d",
point.x, point.y));
}
private void lineTo(GeneralPath path, Point point)
{
path.lineTo(point.x, point.y);
- if (LOG.isTraceEnabled())
- {
- LOG.trace("lineTo: " + String.format(Locale.US, "%d,%d", point.x,
point.y));
- }
+ LOG.trace("lineTo: {}", () -> String.format(Locale.US, "%d,%d",
point.x, point.y));
}
private void quadTo(GeneralPath path, Point ctrlPoint, Point point)
{
path.quadTo(ctrlPoint.x, ctrlPoint.y, point.x, point.y);
- if (LOG.isTraceEnabled())
- {
- LOG.trace("quadTo: " + String.format(Locale.US, "%d,%d %d,%d",
ctrlPoint.x, ctrlPoint.y,
- point.x, point.y));
- }
+ LOG.trace("quadTo: {}",
+ () -> String.format(Locale.US, "%d,%d %d,%d", ctrlPoint.x,
ctrlPoint.y, point.x,
+ point.y));
}
private int midValue(int a, int b)
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphSubstitutionTable.java
Sun Oct 22 08:33:43 2023
@@ -28,8 +28,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.apache.fontbox.ttf.gsub.GlyphSubstitutionDataExtractor;
import org.apache.fontbox.ttf.model.GsubData;
import org.apache.fontbox.ttf.table.common.CoverageTable;
@@ -59,7 +59,7 @@ import org.apache.fontbox.ttf.table.gsub
*/
public class GlyphSubstitutionTable extends TTFTable
{
- private static final Log LOG =
LogFactory.getLog(GlyphSubstitutionTable.class);
+ private static final Logger LOG =
LogManager.getLogger(GlyphSubstitutionTable.class);
public static final String TAG = "GSUB";
@@ -144,8 +144,8 @@ public class GlyphSubstitutionTable exte
{
// PDFBOX-4489: catch corrupt file
//
https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#slTbl_sRec
- LOG.error("LangSysRecords not alphabetically sorted by LangSys
tag: " +
- langSysTags[i] + " <= " + langSysTags[i - 1]);
+ LOG.error("LangSysRecords not alphabetically sorted by LangSys
tag: {} <= {}",
+ langSysTags[i], langSysTags[i - 1]);
return new ScriptTable(null, new LinkedHashMap<>());
}
langSysOffsets[i] = data.readUnsignedShort();
@@ -199,13 +199,14 @@ public class GlyphSubstitutionTable exte
{
// ArialUni.ttf has many warnings but isn't corrupt, so we
assume that only
// strings with trash characters indicate real corruption
- LOG.debug("FeatureRecord array not alphabetically sorted
by FeatureTag: " +
- featureTags[i] + " < " + featureTags[i - 1]);
+ LOG.debug(
+ "FeatureRecord array not alphabetically sorted by
FeatureTag: {} < {}",
+ featureTags[i], featureTags[i - 1]);
}
else
{
- LOG.warn("FeatureRecord array not alphabetically sorted by
FeatureTag: " +
- featureTags[i] + " < " + featureTags[i - 1]);
+ LOG.warn("FeatureRecord array not alphabetically sorted by
FeatureTag: {} < {}",
+ featureTags[i], featureTags[i - 1]);
return new FeatureListTable(0, new FeatureRecord[0]);
}
}
@@ -271,8 +272,8 @@ public class GlyphSubstitutionTable exte
default:
// Other lookup types are not supported
- LOG.debug("Type " + lookupType
- + " GSUB lookup table is not supported and will be
ignored");
+ LOG.debug("Type {} GSUB lookup table is not supported and will
be ignored",
+ lookupType);
return null;
//TODO next: implement type 6
//
https://learn.microsoft.com/en-us/typography/opentype/spec/gsub#lookuptype-6-chained-contexts-substitution-subtable
@@ -322,8 +323,9 @@ public class GlyphSubstitutionTable exte
int substFormat = data.readUnsignedShort(); // always 1
if (substFormat != 1)
{
- LOG.error("The expected SubstFormat for
ExtensionSubstFormat1 subtable is " +
- substFormat + " but should be 1");
+ LOG.error(
+ "The expected SubstFormat for
ExtensionSubstFormat1 subtable is {} but should be 1",
+ substFormat);
continue;
}
int extensionLookupType = data.readUnsignedShort();
@@ -333,8 +335,7 @@ public class GlyphSubstitutionTable exte
break;
default:
// Other lookup types are not supported
- LOG.debug("Type " + lookupType
- + " GSUB lookup table is not supported and will be
ignored");
+ LOG.debug("Type {} GSUB lookup table is not supported and will be
ignored", lookupType);
}
return new LookupTable(lookupType, lookupFlag, markFilteringSet,
subTables);
}
@@ -369,7 +370,7 @@ public class GlyphSubstitutionTable exte
return new LookupTypeSingleSubstFormat2(substFormat,
coverageTable, substituteGlyphIDs);
}
default:
- LOG.warn("Unknown substFormat: " + substFormat);
+ LOG.warn("Unknown substFormat: {}", substFormat);
return null;
}
}
@@ -679,9 +680,9 @@ public class GlyphSubstitutionTable exte
LookupTable lookupTable =
lookupListTable.getLookups()[lookupListIndex];
if (lookupTable.getLookupType() != 1)
{
- LOG.warn("Skipping GSUB feature '" +
featureRecord.getFeatureTag()
- + "' because it requires unsupported lookup table type
"
- + lookupTable.getLookupType());
+ LOG.warn(
+ "Skipping GSUB feature '{}' because it requires
unsupported lookup table type {}",
+ featureRecord.getFeatureTag(),
lookupTable.getLookupType());
continue;
}
lookupResult = doLookup(lookupTable, lookupResult);
@@ -757,7 +758,7 @@ public class GlyphSubstitutionTable exte
Integer gid = reverseLookup.get(sgid);
if (gid == null)
{
- LOG.warn("Trying to un-substitute a never-before-seen gid: " +
sgid);
+ LOG.warn("Trying to un-substitute a never-before-seen gid: {}",
sgid);
return sgid;
}
return gid;
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningSubtable.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningSubtable.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningSubtable.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningSubtable.java
Sun Oct 22 08:33:43 2023
@@ -20,8 +20,8 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* A 'kern' table in a true type font.
@@ -30,7 +30,7 @@ import org.apache.commons.logging.LogFac
*/
public class KerningSubtable
{
- private static final Log LOG = LogFactory.getLog(KerningSubtable.class);
+ private static final Logger LOG =
LogManager.getLogger(KerningSubtable.class);
// coverage field bit masks and values
private static final int COVERAGE_HORIZONTAL = 0x0001;
@@ -182,13 +182,13 @@ public class KerningSubtable
int version = data.readUnsignedShort();
if (version != 0)
{
- LOG.info("Unsupported kerning sub-table version: " + version);
+ LOG.info("Unsupported kerning sub-table version: {}", version);
return;
}
int length = data.readUnsignedShort();
if (length < 6)
{
- LOG.warn("Kerning sub-table too short, got " + length + " bytes,
expect 6 or more.");
+ LOG.warn("Kerning sub-table too short, got {} bytes, expect 6 or
more.", length);
return;
}
int coverage = data.readUnsignedShort();
@@ -205,17 +205,18 @@ public class KerningSubtable
this.crossStream = true;
}
int format = getBits(coverage, COVERAGE_FORMAT, COVERAGE_FORMAT_SHIFT);
- if (format == 0)
+ switch (format)
{
- readSubtable0Format0(data);
- }
- else if (format == 2)
- {
- readSubtable0Format2(data);
- }
- else
- {
- LOG.debug("Skipped kerning subtable due to an unsupported kerning
subtable version: " + format);
+ case 0:
+ readSubtable0Format0(data);
+ break;
+ case 2:
+ readSubtable0Format2(data);
+ break;
+ default:
+ LOG.debug("Skipped kerning subtable due to an unsupported
kerning subtable version: {}",
+ format);
+ break;
}
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningTable.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningTable.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningTable.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/KerningTable.java
Sun Oct 22 08:33:43 2023
@@ -18,8 +18,8 @@ package org.apache.fontbox.ttf;
import java.io.IOException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* A 'kern' table in a true type font.
@@ -28,8 +28,7 @@ import org.apache.commons.logging.LogFac
*/
public class KerningTable extends TTFTable
{
-
- private static final Log LOG = LogFactory.getLog(KerningTable.class);
+ private static final Logger LOG = LogManager.getLogger(KerningTable.class);
/**
* Tag to identify this table.
@@ -40,7 +39,6 @@ public class KerningTable extends TTFTab
KerningTable()
{
- super();
}
/**
@@ -59,17 +57,18 @@ public class KerningTable extends TTFTab
version = (version << 16) | data.readUnsignedShort();
}
int numSubtables = 0;
- if (version == 0)
- {
- numSubtables = data.readUnsignedShort();
- }
- else if (version == 1)
- {
- numSubtables = (int) data.readUnsignedInt();
- }
- else
+ switch (version)
{
- LOG.debug("Skipped kerning table due to an unsupported kerning
table version: " + version);
+ case 0:
+ numSubtables = data.readUnsignedShort();
+ break;
+ case 1:
+ numSubtables = (int) data.readUnsignedInt();
+ break;
+ default:
+ LOG.debug("Skipped kerning table due to an unsupported kerning
table version: {}",
+ version);
+ break;
}
if (numSubtables > 0)
{
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OS2WindowsMetricsTable.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OS2WindowsMetricsTable.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OS2WindowsMetricsTable.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OS2WindowsMetricsTable.java
Sun Oct 22 08:33:43 2023
@@ -19,9 +19,8 @@ package org.apache.fontbox.ttf;
import java.io.EOFException;
import java.io.IOException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* The OS/2 and Windows Metrics Table in a TrueType font, see
* <a
href="https://docs.microsoft.com/en-us/typography/opentype/spec/os2">here</a>.
@@ -34,7 +33,7 @@ public class OS2WindowsMetricsTable exte
/**
* Log instance.
*/
- private static final Log LOG =
LogFactory.getLog(OS2WindowsMetricsTable.class);
+ private static final Logger LOG =
LogManager.getLogger(OS2WindowsMetricsTable.class);
/**
* Weight class constant.
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/OpenTypeScript.java
Sun Oct 22 08:33:43 2023
@@ -29,8 +29,8 @@ import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* A class for mapping Unicode codepoints to OpenType script tags
@@ -43,7 +43,7 @@ import org.apache.commons.logging.LogFac
*/
public final class OpenTypeScript
{
- private static final Log LOG = LogFactory.getLog(OpenTypeScript.class);
+ private static final Logger LOG =
LogManager.getLogger(OpenTypeScript.class);
public static final String INHERITED = "Inherited";
public static final String UNKNOWN = "Unknown";
@@ -227,8 +227,8 @@ public final class OpenTypeScript
}
catch (IOException e)
{
- LOG.warn("Could not parse Scripts.txt, mirroring char map will be
empty: "
- + e.getMessage(), e);
+ LOG.warn("Could not parse Scripts.txt, mirroring char map will be
empty: {}",
+ e.getMessage(), e);
}
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java
Sun Oct 22 08:33:43 2023
@@ -17,8 +17,9 @@
package org.apache.fontbox.ttf;
import java.io.IOException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* A table in a true type font.
@@ -27,7 +28,8 @@ import org.apache.commons.logging.LogFac
*/
public class PostScriptTable extends TTFTable
{
- private static final Log LOG = LogFactory.getLog(PostScriptTable.class);
+ private static final Logger LOG =
LogManager.getLogger(PostScriptTable.class);
+
private float formatType;
private float italicAngle;
private short underlinePosition;
@@ -46,7 +48,6 @@ public class PostScriptTable extends TTF
PostScriptTable()
{
- super();
}
/**
@@ -105,8 +106,9 @@ public class PostScriptTable extends TTF
catch (IOException ex)
{
// PDFBOX-4851: EOF
- LOG.warn("Error reading names in PostScript table at
entry " + i + " of " +
- nameArray.length + ", setting remaining
entries to .notdef", ex);
+ LOG.warn(
+ "Error reading names in PostScript table at
entry {} of {}, setting remaining entries to .notdef",
+ i, nameArray.length, ex);
for (int j = i; j < nameArray.length; ++j)
{
nameArray[j] = ".notdef";
@@ -156,15 +158,15 @@ public class PostScriptTable extends TTF
}
else
{
- LOG.debug("incorrect glyph name index " + index +
- ", valid numbers 0.." +
WGL4Names.NUMBER_OF_MAC_GLYPHS);
+ LOG.debug("incorrect glyph name index {}, valid numbers
0..{}",
+ index, WGL4Names.NUMBER_OF_MAC_GLYPHS);
}
}
}
else if (Float.compare(formatType, 3.0f) == 0)
{
// no postscript information is provided.
- LOG.debug("No PostScript name information is provided for the font
" + ttf.getName());
+ LOG.debug("No PostScript name information is provided for the font
{}", ttf.getName());
}
initialized = true;
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
Sun Oct 22 08:33:43 2023
@@ -18,8 +18,10 @@ package org.apache.fontbox.ttf;
import java.io.IOException;
import java.io.InputStream;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
import org.apache.pdfbox.io.RandomAccessRead;
/**
@@ -29,7 +31,7 @@ import org.apache.pdfbox.io.RandomAccess
*/
public class TTFParser
{
- private static final Log LOG = LogFactory.getLog(TTFParser.class);
+ private static final Logger LOG = LogManager.getLogger(TTFParser.class);
private boolean isEmbedded = false;
@@ -129,10 +131,10 @@ public class TTFParser
if (table.getOffset() + table.getLength() >
font.getOriginalDataSize())
{
// PDFBOX-5285 if we're lucky, this is an "unimportant"
table, e.g. vmtx
- LOG.warn("Skip table '" + table.getTag() +
- "' which goes past the file size; offset: " +
table.getOffset() +
- ", size: " + table.getLength() +
- ", font size: " + font.getOriginalDataSize());
+ LOG.warn(
+ "Skip table '{}' which goes past the file size;
offset: {}, size: {}, font size: {}",
+ table.getTag(), table.getOffset(),
table.getLength(),
+ font.getOriginalDataSize());
}
else
{
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
Sun Oct 22 08:33:43 2023
@@ -37,8 +37,8 @@ import java.util.SortedSet;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.TreeSet;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* Subsetter for TrueType (TTF) fonts.
@@ -50,7 +50,7 @@ import org.apache.commons.logging.LogFac
*/
public final class TTFSubsetter
{
- private static final Log LOG = LogFactory.getLog(TTFSubsetter.class);
+ private static final Logger LOG = LogManager.getLogger(TTFSubsetter.class);
private static final byte[] PAD_BUF = { 0, 0, 0 };
@@ -491,7 +491,8 @@ public final class TTFSubsetter
if (Long.compare(isResult, g.getOffset()) != 0)
{
- LOG.debug("Tried skipping " + g.getOffset() + " bytes but
skipped only " + isResult + " bytes");
+ LOG.debug("Tried skipping {} bytes but skipped only {}
bytes", g.getOffset(),
+ isResult);
}
long lastOff = 0L;
@@ -503,7 +504,8 @@ public final class TTFSubsetter
if (Long.compare(isResult, offset - lastOff) != 0)
{
- LOG.debug("Tried skipping " + (offset - lastOff) + "
bytes but skipped only " + isResult + " bytes");
+ LOG.debug("Tried skipping {} bytes but skipped only {}
bytes",
+ offset - lastOff, isResult);
}
byte[] buf = new byte[(int)len];
@@ -511,7 +513,7 @@ public final class TTFSubsetter
if (Long.compare(isResult, len) != 0)
{
- LOG.debug("Tried reading " + len + " bytes but only "
+ isResult + " bytes read");
+ LOG.debug("Tried reading {} bytes but only {} bytes
read", len, isResult);
}
// rewrite glyphIds for compound glyphs
@@ -586,7 +588,8 @@ public final class TTFSubsetter
if (Long.compare(isResult, g.getOffset()) != 0)
{
- LOG.debug("Tried skipping " + g.getOffset() + " bytes but
skipped only " + isResult + " bytes");
+ LOG.debug("Tried skipping {} bytes but skipped only {} bytes",
g.getOffset(),
+ isResult);
}
long prevEnd = 0; // previously read glyph offset
@@ -604,7 +607,8 @@ public final class TTFSubsetter
if (Long.compare(isResult, offset - prevEnd) != 0)
{
- LOG.debug("Tried skipping " + (offset - prevEnd) + " bytes
but skipped only " + isResult + " bytes");
+ LOG.debug("Tried skipping {} bytes but skipped only {}
bytes", offset - prevEnd,
+ isResult);
}
byte[] buf = new byte[(int)length];
@@ -612,7 +616,7 @@ public final class TTFSubsetter
if (Long.compare(isResult, length) != 0)
{
- LOG.debug("Tried reading " + length + " bytes but only " +
isResult + " bytes read");
+ LOG.debug("Tried reading {} bytes but only {} bytes read",
length, isResult);
}
// detect glyph type
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
Sun Oct 22 08:33:43 2023
@@ -27,8 +27,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
import org.apache.fontbox.FontBoxFont;
import org.apache.fontbox.ttf.model.GsubData;
import org.apache.fontbox.util.BoundingBox;
@@ -41,7 +42,7 @@ import org.apache.fontbox.util.BoundingB
public class TrueTypeFont implements FontBoxFont, Closeable
{
- private static final Log LOG = LogFactory.getLog(TrueTypeFont.class);
+ private static final Logger LOG = LogManager.getLogger(TrueTypeFont.class);
private float version;
private int numberOfGlyphs = -1;
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/DefaultGsubWorker.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/DefaultGsubWorker.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/DefaultGsubWorker.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/DefaultGsubWorker.java
Sun Oct 22 08:33:43 2023
@@ -19,8 +19,9 @@ package org.apache.fontbox.ttf.gsub;
import java.util.Collections;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+
import org.apache.fontbox.ttf.GlyphSubstitutionTable;
/**
@@ -32,13 +33,14 @@ import org.apache.fontbox.ttf.GlyphSubst
*/
class DefaultGsubWorker implements GsubWorker
{
- private static final Log LOG = LogFactory.getLog(DefaultGsubWorker.class);
+ private static final Logger LOG =
LogManager.getLogger(DefaultGsubWorker.class);
@Override
public List<Integer> applyTransforms(List<Integer> originalGlyphIds)
{
- LOG.warn(getClass().getSimpleName() + " class does not perform actual
GSUB substitutions. "
- + "Perhaps the selected language is not yet supported by the
FontBox library.");
+ LOG.warn(
+ "{} class does not perform actual GSUB substitutions. Perhaps
the selected language is not yet supported by the FontBox library.",
+ getClass().getSimpleName());
// Make the result read-only to prevent accidental modifications of
the source list
return Collections.unmodifiableList(originalGlyphIds);
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GlyphSubstitutionDataExtractor.java
Sun Oct 22 08:33:43 2023
@@ -23,8 +23,6 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.fontbox.ttf.model.GsubData;
import org.apache.fontbox.ttf.model.Language;
import org.apache.fontbox.ttf.model.MapBackedGsubData;
@@ -44,6 +42,9 @@ import org.apache.fontbox.ttf.table.gsub
import org.apache.fontbox.ttf.table.gsub.LookupTypeSingleSubstFormat2;
import org.apache.fontbox.ttf.table.gsub.SequenceTable;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
/**
* This class has utility methods to extract meaningful GsubData from the
highly obfuscated GSUB
* Tables. This GsubData is then used to determine which combination of glyphs
or words have to be
@@ -54,8 +55,7 @@ import org.apache.fontbox.ttf.table.gsub
*/
public class GlyphSubstitutionDataExtractor
{
-
- private static final Log LOG =
LogFactory.getLog(GlyphSubstitutionDataExtractor.class);
+ private static final Logger LOG =
LogManager.getLogger(GlyphSubstitutionDataExtractor.class);
public GsubData getGsubData(Map<String, ScriptTable> scriptList,
FeatureListTable featureListTable, LookupListTable lookupListTable)
@@ -154,9 +154,8 @@ public class GlyphSubstitutionDataExtrac
}
}
- LOG.debug("*********** extracting GSUB data for the feature: "
- + featureRecord.getFeatureTag() + ", glyphSubstitutionMap: "
- + glyphSubstitutionMap);
+ LOG.debug("*********** extracting GSUB data for the feature: {},
glyphSubstitutionMap: {}",
+ featureRecord.getFeatureTag(), glyphSubstitutionMap);
gsubData.put(featureRecord.getFeatureTag(),
Collections.unmodifiableMap(glyphSubstitutionMap));
@@ -191,7 +190,7 @@ public class GlyphSubstitutionDataExtrac
else
{
// usually null, due to being skipped in
GlyphSubstitutionTable.readLookupTable()
- LOG.debug("The type " + lookupSubTable + " is not yet
supported, will be ignored");
+ LOG.debug("The type {} is not yet supported, will be ignored",
lookupSubTable);
}
}
@@ -220,9 +219,10 @@ public class GlyphSubstitutionDataExtrac
if (coverageTable.getSize() !=
singleSubstTableFormat2.getSubstituteGlyphIDs().length)
{
- LOG.warn("The coverage table size (" + coverageTable.getSize() +
- ") should be the same as the count of the
substituteGlyphIDs tables (" +
- singleSubstTableFormat2.getSubstituteGlyphIDs().length +
")");
+ LOG.warn(
+ "The coverage table size ({}) should be the same as the
count of the substituteGlyphIDs tables ({})",
+ coverageTable.getSize(),
+ singleSubstTableFormat2.getSubstituteGlyphIDs().length);
return;
}
@@ -244,9 +244,10 @@ public class GlyphSubstitutionDataExtrac
if (coverageTable.getSize() !=
multipleSubstFormat1Subtable.getSequenceTables().length)
{
- LOG.warn("The coverage table size (" + coverageTable.getSize() +
- ") should be the same as the count of the sequence tables
(" +
- multipleSubstFormat1Subtable.getSequenceTables().length +
")");
+ LOG.warn(
+ "The coverage table size ({}) should be the same as the
count of the sequence tables ({})",
+ coverageTable.getSize(),
+ multipleSubstFormat1Subtable.getSequenceTables().length);
return;
}
@@ -287,7 +288,7 @@ public class GlyphSubstitutionDataExtrac
glyphsToBeSubstituted.add(componentGlyphID);
}
- LOG.debug("glyphsToBeSubstituted: " + glyphsToBeSubstituted);
+ LOG.debug("glyphsToBeSubstituted: {}", glyphsToBeSubstituted);
putNewSubstitutionEntry(glyphSubstitutionMap,
ligatureTable.getLigatureGlyph(),
glyphsToBeSubstituted);
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForBengali.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForBengali.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForBengali.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForBengali.java
Sun Oct 22 08:33:43 2023
@@ -25,12 +25,13 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.fontbox.ttf.CmapLookup;
import org.apache.fontbox.ttf.model.GsubData;
import org.apache.fontbox.ttf.model.ScriptFeature;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
/**
*
* Bengali-specific implementation of GSUB system
@@ -40,8 +41,7 @@ import org.apache.fontbox.ttf.model.Scri
*/
public class GsubWorkerForBengali implements GsubWorker
{
-
- private static final Log LOG =
LogFactory.getLog(GsubWorkerForBengali.class);
+ private static final Logger LOG =
LogManager.getLogger(GsubWorkerForBengali.class);
private static final String INIT_FEATURE = "init";
@@ -82,11 +82,11 @@ public class GsubWorkerForBengali implem
{
if (!gsubData.isFeatureSupported(feature))
{
- LOG.debug("the feature " + feature + " was not found");
+ LOG.debug("the feature {} was not found", feature);
continue;
}
- LOG.debug("applying the feature " + feature);
+ LOG.debug("applying the feature {}", feature);
ScriptFeature scriptFeature = gsubData.getFeature(feature);
@@ -150,7 +150,8 @@ public class GsubWorkerForBengali implem
if (allGlyphIdsForSubstitution.isEmpty())
{
// not stopping here results in really weird output, the regex
goes wild
- LOG.debug("getAllGlyphIdsForSubstitution() for " +
scriptFeature.getName() + " is empty");
+ LOG.debug("getAllGlyphIdsForSubstitution() for {} is empty",
+ scriptFeature.getName());
return originalGlyphs;
}
@@ -175,8 +176,8 @@ public class GsubWorkerForBengali implem
}
});
- LOG.debug("originalGlyphs: " + originalGlyphs + ",
gsubProcessedGlyphs: "
- + gsubProcessedGlyphs);
+ LOG.debug("originalGlyphs: {}, gsubProcessedGlyphs: {}",
+ originalGlyphs, gsubProcessedGlyphs);
return gsubProcessedGlyphs;
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForLatin.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForLatin.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForLatin.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForLatin.java
Sun Oct 22 08:33:43 2023
@@ -22,12 +22,13 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.fontbox.ttf.CmapLookup;
import org.apache.fontbox.ttf.model.GsubData;
import org.apache.fontbox.ttf.model.ScriptFeature;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
/**
*
* Latin-specific implementation of GSUB system
@@ -38,7 +39,7 @@ import org.apache.fontbox.ttf.model.Scri
*/
public class GsubWorkerForLatin implements GsubWorker
{
- private static final Log LOG = LogFactory.getLog(GsubWorkerForLatin.class);
+ private static final Logger LOG =
LogManager.getLogger(GsubWorkerForLatin.class);
/**
* This sequence is very important. This has been taken from <a href=
@@ -64,11 +65,11 @@ public class GsubWorkerForLatin implemen
{
if (!gsubData.isFeatureSupported(feature))
{
- LOG.debug("the feature " + feature + " was not found");
+ LOG.debug("the feature {} was not found", feature);
continue;
}
- LOG.debug("applying the feature " + feature);
+ LOG.debug("applying the feature {}", feature);
ScriptFeature scriptFeature = gsubData.getFeature(feature);
@@ -84,7 +85,8 @@ public class GsubWorkerForLatin implemen
{
if (scriptFeature.getAllGlyphIdsForSubstitution().isEmpty())
{
- LOG.debug("getAllGlyphIdsForSubstitution() for " +
scriptFeature.getName() + " is empty");
+ LOG.debug("getAllGlyphIdsForSubstitution() for {} is empty",
+ scriptFeature.getName());
return originalGlyphs;
}
@@ -108,8 +110,7 @@ public class GsubWorkerForLatin implemen
}
}
- LOG.debug("originalGlyphs: " + originalGlyphs + ",
gsubProcessedGlyphs: "
- + gsubProcessedGlyphs);
+ LOG.debug("originalGlyphs: {}, gsubProcessedGlyphs: {}",
originalGlyphs, gsubProcessedGlyphs);
return gsubProcessedGlyphs;
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java
(original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java
Sun Oct 22 08:33:43 2023
@@ -22,9 +22,8 @@ package org.apache.fontbox.type1;
import java.io.IOException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* Lexer for the ASCII portions of an Adobe Type 1 font.
*
@@ -48,7 +47,7 @@ class Type1Lexer
/**
* Log instance.
*/
- private static final Log LOG = LogFactory.getLog(Type1Lexer.class);
+ private static final Logger LOG = LogManager.getLogger(Type1Lexer.class);
private final ByteBuffer buffer;
private Token aheadToken;
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java
Sun Oct 22 08:33:43 2023
@@ -22,16 +22,15 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* Helps to autodetect/locate available operating system fonts. This class is
based on a class provided by Apache FOP.
* see org.apache.fop.fonts.autodetect.FontFileFinder
*/
public class FontFileFinder
{
- private static final Log LOG = LogFactory.getLog(FontFileFinder.class);
+ private static final Logger LOG =
LogManager.getLogger(FontFileFinder.class);
private FontDirFinder fontDirFinder = null;
@@ -122,26 +121,17 @@ public class FontFileFinder
// skip hidden directories
if (file.isHidden())
{
- if (LOG.isDebugEnabled())
- {
- LOG.debug("skip hidden directory " + file);
- }
+ LOG.debug("skip hidden directory {}", file);
continue;
}
walk(file, results);
}
else
{
- if (LOG.isDebugEnabled())
- {
- LOG.debug("checkFontfile check " + file);
- }
+ LOG.debug("checkFontfile check {}", file);
if (checkFontfile(file))
{
- if (LOG.isDebugEnabled())
- {
- LOG.debug("checkFontfile found " + file);
- }
+ LOG.debug("checkFontfile found {}", file);
results.add(file.toURI());
}
}
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/NativeFontDirFinder.java
Sun Oct 22 08:33:43 2023
@@ -20,9 +20,8 @@ package org.apache.fontbox.util.autodete
import java.io.File;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* Native font finder base class. This class is based on a class provided by
Apache FOP. see
* org.apache.fop.fonts.autodetect.NativeFontDirFinder
@@ -30,7 +29,7 @@ import org.apache.commons.logging.LogFac
public abstract class NativeFontDirFinder implements FontDirFinder
{
- private static final Log LOG =
LogFactory.getLog(NativeFontDirFinder.class);
+ private static final Logger LOG =
LogManager.getLogger(NativeFontDirFinder.class);
/**
* Generic method used by Mac and Unix font finders.
Modified:
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java
URL:
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java?rev=1913192&r1=1913191&r2=1913192&view=diff
==============================================================================
---
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java
(original)
+++
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/WindowsFontDirFinder.java
Sun Oct 22 08:33:43 2023
@@ -24,9 +24,8 @@ import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
/**
* FontFinder for native Windows platforms. This class is based on a class
provided by Apache FOP. see
@@ -35,7 +34,7 @@ import org.apache.commons.logging.LogFac
public class WindowsFontDirFinder implements FontDirFinder
{
- private static final Log LOG =
LogFactory.getLog(WindowsFontDirFinder.class);
+ private static final Logger LOG =
LogManager.getLogger(WindowsFontDirFinder.class);
/**
* Attempts to read windir environment variable on windows (disclaimer:
This is a bit dirty but seems to work