/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. _spriteBatch = new SpriteBatch(GraphicsDevice); string fontData; using (var stream = TitleContainer.OpenStream("Fonts/test.fnt")) { using (var reader = new StreamReader(stream)) { fontData = reader.ReadToEnd(); } } _font = BMFontLoader.Load(fontData, name => TitleContainer.OpenStream("Fonts/" + name), GraphicsDevice); GC.Collect(); }
public SpriteFont Load(AssetLoaderContext context, string assetName) { var fontData = context.Load <string>(assetName); return(BMFontLoader.Load(fontData, name => TextureGetter(context, name))); }