Cromon

GdiFontProvider.cs

Oct 16th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1.         {
  2.             mGdiFont = new System.Drawing.Font(family, fontSize, FontStyle.Regular, GraphicsUnit.Pixel);
  3.             var maxTextureSize = target.GetMaximumTextureSize();
  4.             mTextureSize = Math.Min(Math.Min(maxTextureSize.Height, maxTextureSize.Width), 1024);
  5.             byte[] letters = new byte[223];
  6.             for (int i = 33; i < letters.Length; ++i)
  7.             {
  8.                 letters[i - 33] = (byte)i;
  9.             }
  10.  
  11.             var encoding = Encoding.GetEncoding(1256);
  12.             string str = encoding.GetString(letters);
  13.             str = new string(str.Except(new char[] { '\0' }).ToArray());
  14.         }
  15.  
  16.         private List<Texture> mFontTextures = new List<Texture>();
  17.         private int mTextureSize;
  18.         private System.Drawing.Font mGdiFont;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment