コード例 #1
0
ファイル: Font.cs プロジェクト: iq110/csharpgameprogramming
 public int GetKerning(char first, char second)
 {
     KernKey key = new KernKey((int)first, (int)second);
     int outValue;
     if(_kernData.TryGetValue(key, out outValue))
     {
         return outValue;
     }
     return 0;
 }
コード例 #2
0
        public int GetKerning(char first, char second)
        {
            KernKey key = new KernKey((int)first, (int)second);
            int     outValue;

            if (_kernData.TryGetValue(key, out outValue))
            {
                return(outValue);
            }
            return(0);
        }
コード例 #3
0
 private static void ParseKernData(int start, string[] lines, Dictionary <KernKey, int> kernDictionary)
 {
     for (int i = start; i < lines.Length; i += 1)
     {
         string   line           = lines[i];
         string[] typesAndValues = line.Split(" ".ToCharArray(),
                                              StringSplitOptions.RemoveEmptyEntries);
         // As before the order of the enteries is used to make the parsing simpler.
         KernKey key = new KernKey(GetValue(typesAndValues[1]), GetValue(typesAndValues[2]));
         kernDictionary.Add(key, GetValue(typesAndValues[3]));
     }
 }
コード例 #4
0
 private static void ParseKernData(int start, string[] lines, Dictionary<KernKey, int> kernDictionary)
 {
     for (int i = start; i < lines.Length; i += 1)
     {
         string line = lines[i];
         string[] typesAndValues = line.Split(" ".ToCharArray(), 
             StringSplitOptions.RemoveEmptyEntries);
         // As before the order of the enteries is used to make the parsing simpler.
         KernKey key = new KernKey(GetValue(typesAndValues[1]), GetValue(typesAndValues[2]));
         kernDictionary.Add(key, GetValue(typesAndValues[3]));
     }
 }