コード例 #1
0
 private static void ParseBasicFontInfo(string[] line, out FontInfo fontInfo)
 {
   fontInfo = new FontInfo {Name = "", Bold = false, Italic = false, Pt = -1};
   for(int i = line.Count() - 1; i >= 0; i--)
   {
     switch(line[i])
     {
       case "italic":
         fontInfo.Italic = true;
         break;
       case "bold":
         fontInfo.Bold = true;
         break;
       default:
         fontInfo.Pt = Int32.Parse(line[i].Substring(0, line[i].Length - 2));
         for(int j = 0; j < i; j++)
         {
           fontInfo.Name += line[j] + "";
         }
         fontInfo.Name = fontInfo.Name.Trim();
         break;
     }
     if(fontInfo.Name != "")
     {
       break;
     }
   }
 }
コード例 #2
0
 internal MyFont(FontInfo fontInfo, Texture texture)
 {
   FontInfo = fontInfo;
   FontTexture = texture;
   Symbols = new Dictionary<char, GlyphData>();
   _kerningPairs = new Dictionary<KeyValuePair<char, char>, float>(new MyCharCharComparer());
 }