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.
5050using iText . Kernel . Pdf ;
5151
5252namespace iText . Kernel . Font {
53- internal class DocTrueTypeFont : TrueTypeFont , IDocFontProgram {
53+ public class DocTrueTypeFont : TrueTypeFont , IDocFontProgram {
5454 private PdfStream fontFile ;
5555
5656 private PdfName fontFileName ;
Original file line number Diff line number Diff line change @@ -51,10 +51,19 @@ source product.
5151using iText . Kernel . Pdf ;
5252
5353namespace iText . Kernel . Font {
54- internal class FontUtil {
54+ public class FontUtil {
5555 private static readonly Dictionary < String , CMapToUnicode > uniMaps = new Dictionary < String , CMapToUnicode > (
5656 ) ;
5757
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+
5867 internal static CMapToUnicode ProcessToUnicode ( PdfObject toUnicode ) {
5968 CMapToUnicode cMapToUnicode = null ;
6069 if ( toUnicode is PdfStream ) {
Original file line number Diff line number Diff line change @@ -43,10 +43,8 @@ source product.
4343*/
4444using System ;
4545using System . Collections . Generic ;
46- using System . Text ;
4746using iText . IO . Font ;
4847using iText . IO . Font . Otf ;
49- using iText . IO . Util ;
5048using iText . Kernel ;
5149using iText . Kernel . Pdf ;
5250
@@ -533,11 +531,7 @@ protected internal override bool IsWrappedObjectMustBeIndirect() {
533531 /// </returns>
534532 protected internal static String UpdateSubsetPrefix ( String fontName , bool isSubset , bool isEmbedded ) {
535533 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 ) ;
541535 }
542536 return fontName ;
543537 }
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