File tree Expand file tree Collapse file tree 4 files changed +13
-10
lines changed
itext/itext.kernel/itext/kernel/font Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ source product.
50
50
using iText . Kernel . Pdf ;
51
51
52
52
namespace iText . Kernel . Font {
53
- internal class DocTrueTypeFont : TrueTypeFont , IDocFontProgram {
53
+ public class DocTrueTypeFont : TrueTypeFont , IDocFontProgram {
54
54
private PdfStream fontFile ;
55
55
56
56
private PdfName fontFileName ;
Original file line number Diff line number Diff line change @@ -51,10 +51,19 @@ source product.
51
51
using iText . Kernel . Pdf ;
52
52
53
53
namespace iText . Kernel . Font {
54
- internal class FontUtil {
54
+ public class FontUtil {
55
55
private static readonly Dictionary < String , CMapToUnicode > uniMaps = new Dictionary < String , CMapToUnicode > (
56
56
) ;
57
57
58
+ public static String AddRandomSubsetPrefixForFontName ( String fontName ) {
59
+ StringBuilder newFontName = new StringBuilder ( fontName . Length + 7 ) ;
60
+ for ( int k = 0 ; k < 6 ; ++ k ) {
61
+ newFontName . Append ( ( char ) ( JavaUtil . Random ( ) * 26 + 'A' ) ) ;
62
+ }
63
+ newFontName . Append ( '+' ) . Append ( fontName ) ;
64
+ return newFontName . ToString ( ) ;
65
+ }
66
+
58
67
internal static CMapToUnicode ProcessToUnicode ( PdfObject toUnicode ) {
59
68
CMapToUnicode cMapToUnicode = null ;
60
69
if ( toUnicode is PdfStream ) {
Original file line number Diff line number Diff line change @@ -43,10 +43,8 @@ source product.
43
43
*/
44
44
using System ;
45
45
using System . Collections . Generic ;
46
- using System . Text ;
47
46
using iText . IO . Font ;
48
47
using iText . IO . Font . Otf ;
49
- using iText . IO . Util ;
50
48
using iText . Kernel ;
51
49
using iText . Kernel . Pdf ;
52
50
@@ -533,11 +531,7 @@ protected internal override bool IsWrappedObjectMustBeIndirect() {
533
531
/// </returns>
534
532
protected internal static String UpdateSubsetPrefix ( String fontName , bool isSubset , bool isEmbedded ) {
535
533
if ( isSubset && isEmbedded ) {
536
- StringBuilder s = new StringBuilder ( fontName . Length + 7 ) ;
537
- for ( int k = 0 ; k < 6 ; ++ k ) {
538
- s . Append ( ( char ) ( JavaUtil . Random ( ) * 26 + 'A' ) ) ;
539
- }
540
- return s . Append ( '+' ) . Append ( fontName ) . ToString ( ) ;
534
+ return FontUtil . AddRandomSubsetPrefixForFontName ( fontName ) ;
541
535
}
542
536
return fontName ;
543
537
}
Original file line number Diff line number Diff line change 1
- 21c9b38db565d1815041438f2c8b6e1d6b1a2e7e
1
+ 9fadebfb114a7ee9ef9058a8b0c9deec71262210
You can’t perform that action at this time.
0 commit comments