public void LoadFontFile(BFFNT fontFile) { FileFormat = fontFile; ActiveFile = fontFile.bffnt; fontTypeCB.Bind(typeof(FINF.FontType), ActiveFile.FontSection, "Type"); fontTypeCB.SelectedItem = ActiveFile.FontSection.Type; encodingTypeCB.Bind(typeof(FINF.CharacterCode), ActiveFile.FontSection, "CharEncoding"); encodingTypeCB.SelectedItem = ActiveFile.FontSection.CharEncoding; lineFeedUD.Bind(ActiveFile.FontSection, "LineFeed"); leftSpacingUD.Bind(ActiveFile.FontSection, "DefaultLeftWidth"); charWidthUD.Bind(ActiveFile.FontSection, "DefaultCharWidth"); glyphWidthCB.Bind(ActiveFile.FontSection, "DefaultGlyphWidth"); ascentUD.Bind(ActiveFile.FontSection, "Ascent"); fontWidthUD.Bind(ActiveFile.FontSection, "Width"); fontHeightUD.Bind(ActiveFile.FontSection, "Height"); ReloadCharacterCodes(); ReloadTextures(); }
public void LoadFontFile(BXFNT fontFile) { FileFormat = fontFile; ActiveFile = fontFile.bffnt; fontTypeCB.Bind(typeof(FINF.FontType), ActiveFile.FontSection, "Type"); fontTypeCB.SelectedItem = ActiveFile.FontSection.Type; encodingTypeCB.Bind(typeof(FINF.CharacterCode), ActiveFile.FontSection, "CharEncoding"); encodingTypeCB.SelectedItem = ActiveFile.FontSection.CharEncoding; lineFeedUD.Bind(ActiveFile.FontSection, "LineFeed"); leftSpacingUD.Bind(ActiveFile.FontSection, "DefaultLeftWidth"); charWidthUD.Bind(ActiveFile.FontSection, "DefaultCharWidth"); glyphWidthCB.Bind(ActiveFile.FontSection, "DefaultGlyphWidth"); ascentUD.Bind(ActiveFile.FontSection, "Ascent"); fontWidthUD.Bind(ActiveFile.FontSection, "Width"); fontHeightUD.Bind(ActiveFile.FontSection, "Height"); ReloadCharacterCodes(); ReloadTextures(); try { bitmapFont = fontFile.bffnt.GetBitmapFont(); } catch { } textPreviewTB.Text = "This is a preview!"; if (bitmapFont != null) { pictureBoxCustom1.Image = bitmapFont.PrintToBitmap(textPreviewTB.Text, new BitmapFont.FontRenderSettings()); } }