Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using SlimDX.Direct3D9;
- using System.Drawing;
- namespace Gype.UI.D3D9
- {
- internal class GdiFontProvider
- {
- public GdiFontProvider(Rendertarget target, string family, int fontSize)
- {
- mGdiFont = new System.Drawing.Font(family, fontSize, FontStyle.Regular, GraphicsUnit.Pixel);
- var maxTextureSize = target.GetMaximumTextureSize();
- mTextureSize = Math.Min(Math.Min(maxTextureSize.Height, maxTextureSize.Width), 1024);
- byte[] letters = new byte[256];
- for (int i = 0; i < letters.Length; ++i)
- {
- letters[i] = (byte)i;
- }
- var encoding = Encoding.GetEncoding(1256);
- string str = encoding.GetString(letters);
- }
- private List<Texture> mFontTextures = new List<Texture>();
- private int mTextureSize;
- private System.Drawing.Font mGdiFont;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment