예제 #1
0
        internal static String CreateRandomFontName()
        {
            StringBuilder s = new StringBuilder("");

            for (int k = 0; k < 7; ++k)
            {
                s.Append((char)(JavaUtil.Random() * 26 + 'A'));
            }
            return(s.ToString());
        }
예제 #2
0
 /// <summary>Adds a unique subset prefix to be added to the font name when the font is embedded and subsetted.
 ///     </summary>
 /// <param name="fontName">the original font name.</param>
 /// <param name="isSubset">denotes whether font in question is subsetted, i.e. only used symbols are kept in it.
 ///     </param>
 /// <param name="isEmbedded">denotes whether font in question is embedded into the PDF document.</param>
 /// <returns>
 /// the font name prefixed with subset if isSubset and isEmbedded are true,
 /// otherwise original font name is returned intact.
 /// </returns>
 protected internal static String UpdateSubsetPrefix(String fontName, bool isSubset, bool isEmbedded)
 {
     if (isSubset && isEmbedded)
     {
         StringBuilder s = new StringBuilder(fontName.Length + 7);
         for (int k = 0; k < 6; ++k)
         {
             s.Append((char)(JavaUtil.Random() * 26 + 'A'));
         }
         return(s.Append('+').Append(fontName).ToString());
     }
     return(fontName);
 }