-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#251 add debug logs for resolved/unresolved fonts
- Loading branch information
Showing
14 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
flying-saucer-pdf/src/test/java/org/xhtmlrenderer/pdf/ITextFontResolverTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.xhtmlrenderer.pdf; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class ITextFontResolverTest { | ||
private final ITextFontResolver resolver = new ITextFontResolver(); | ||
|
||
@Test | ||
void normalizeFontFamily() { | ||
assertThat(resolver.normalizeFontFamily("ArialUnicodeMS")).isEqualTo("ArialUnicodeMS"); | ||
assertThat(resolver.normalizeFontFamily("\"ArialUnicodeMS")).isEqualTo("ArialUnicodeMS"); | ||
assertThat(resolver.normalizeFontFamily("ArialUnicodeMS\"")).isEqualTo("ArialUnicodeMS"); | ||
assertThat(resolver.normalizeFontFamily("\"ArialUnicodeMS\"")).isEqualTo("ArialUnicodeMS"); | ||
} | ||
|
||
@Test | ||
void normalizeFontFamily_serif() { | ||
assertThat(resolver.normalizeFontFamily("serif")).isEqualTo("Serif"); | ||
assertThat(resolver.normalizeFontFamily("SERIF")).isEqualTo("Serif"); | ||
assertThat(resolver.normalizeFontFamily("sErIf")).isEqualTo("Serif"); | ||
} | ||
|
||
@Test | ||
void normalizeFontFamily_sans_serif() { | ||
assertThat(resolver.normalizeFontFamily("sans-serif")).isEqualTo("SansSerif"); | ||
assertThat(resolver.normalizeFontFamily("SANS-serif")).isEqualTo("SansSerif"); | ||
assertThat(resolver.normalizeFontFamily("sans-SERIF")).isEqualTo("SansSerif"); | ||
assertThat(resolver.normalizeFontFamily("\"sans-serif")).isEqualTo("SansSerif"); | ||
assertThat(resolver.normalizeFontFamily("sans-serif\"")).isEqualTo("SansSerif"); | ||
assertThat(resolver.normalizeFontFamily("\"sans-serif\"")).isEqualTo("SansSerif"); | ||
} | ||
|
||
@Test | ||
void normalizeFontFamily_monospace() { | ||
assertThat(resolver.normalizeFontFamily("monospace")).isEqualTo("Monospaced"); | ||
assertThat(resolver.normalizeFontFamily("MONOSPACE")).isEqualTo("Monospaced"); | ||
assertThat(resolver.normalizeFontFamily("\"monospace\"")).isEqualTo("Monospaced"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters