void ReadKerning(List <BitmapCharKerning> kernings, string[] kerningData) { BitmapCharKerning kerning = new BitmapCharKerning(); foreach (string item in kerningData) { object value = ""; string key = GetKeyValue(item, out value); switch (key) { case "first": kerning.firstChar = Convert.ToInt32(value); break; case "second": kerning.secondChar = Convert.ToInt32(value); break; case "amount": kerning.amount = Convert.ToInt32(value); break; } } }
void ReadKernings(BitmapFont fnt, XmlNodeList kernings) { fnt.kernings = new BitmapCharKerning[kernings.Count]; int index = 0; foreach (XmlNode kerning in kernings) { BitmapCharKerning krn = new BitmapCharKerning(); krn.firstChar = ReadIntAttribute(kerning, "first"); krn.secondChar = ReadIntAttribute(kerning, "second"); krn.amount = ReadFloatAttribute(kerning, "amount"); fnt.kernings[index] = krn; index++; } }