File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
kernel/src/main/java/com/itextpdf/kernel/font Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -58,11 +58,11 @@ This file is part of the iText (R) project.
58
58
import org .slf4j .Logger ;
59
59
import org .slf4j .LoggerFactory ;
60
60
61
- class DocTrueTypeFont extends TrueTypeFont implements IDocFontProgram {
61
+ public class DocTrueTypeFont extends TrueTypeFont implements IDocFontProgram {
62
62
63
63
private static final long serialVersionUID = 4611535787920619829L ;
64
64
65
- private PdfStream fontFile ;
65
+ private PdfStream fontFile ;
66
66
private PdfName fontFileName ;
67
67
private PdfName subtype ;
68
68
private int missingWidth = 0 ;
Original file line number Diff line number Diff line change @@ -63,10 +63,19 @@ This file is part of the iText (R) project.
63
63
import org .slf4j .Logger ;
64
64
import org .slf4j .LoggerFactory ;
65
65
66
- class FontUtil {
66
+ public class FontUtil {
67
67
68
68
private static final HashMap <String , CMapToUnicode > uniMaps = new HashMap <>();
69
69
70
+ public static String addRandomSubsetPrefixForFontName (final String fontName ) {
71
+ final StringBuilder newFontName = new StringBuilder (fontName .length () + 7 );
72
+ for (int k = 0 ; k < 6 ; ++k ) {
73
+ newFontName .append ((char ) (Math .random () * 26 + 'A' ));
74
+ }
75
+ newFontName .append ('+' ).append (fontName );
76
+ return newFontName .toString ();
77
+ }
78
+
70
79
static CMapToUnicode processToUnicode (PdfObject toUnicode ) {
71
80
CMapToUnicode cMapToUnicode = null ;
72
81
if (toUnicode instanceof PdfStream ) {
Original file line number Diff line number Diff line change @@ -492,11 +492,7 @@ protected boolean isWrappedObjectMustBeIndirect() {
492
492
*/
493
493
protected static String updateSubsetPrefix (String fontName , boolean isSubset , boolean isEmbedded ) {
494
494
if (isSubset && isEmbedded ) {
495
- StringBuilder s = new StringBuilder (fontName .length () + 7 );
496
- for (int k = 0 ; k < 6 ; ++k ) {
497
- s .append ((char ) (Math .random () * 26 + 'A' ));
498
- }
499
- return s .append ('+' ).append (fontName ).toString ();
495
+ return FontUtil .addRandomSubsetPrefixForFontName (fontName );
500
496
}
501
497
return fontName ;
502
498
}
You can’t perform that action at this time.
0 commit comments