/// <summary>
 /// Creates an array of <see cref="TextureFont"/>-s by loading them from a trippy font file.
 /// </summary>
 /// <param name="graphicsDevice">The <see cref="GraphicsDevice"/> the <see cref="TextureFont"/>-s will use.</param>
 /// <param name="file">The file on disk where the trippy font file is located.</param>
 /// <param name="generateMipmaps">Whether to generate mipmaps for the texture's font.</param>
 public static TextureFont[] FromFile(GraphicsDevice graphicsDevice, string file, bool generateMipmaps = false)
 {
     using TrippyFontFile fontFile = TrippyFontFile.FromFile(file);
     return(fontFile.CreateFonts(graphicsDevice, generateMipmaps));
 }
 /// <summary>
 /// Creates an array of <see cref="TextureFont"/>-s by loading them from a trippy font file.
 /// </summary>
 /// <param name="graphicsDevice">The <see cref="GraphicsDevice"/> the <see cref="TextureFont"/>-s will use.</param>
 /// <param name="streamReader">The stream where the trippy font file is located.</param>
 /// <param name="generateMipmaps">Whether to generate mipmaps for the texture's font.</param>
 public static TextureFont[] FromStream(GraphicsDevice graphicsDevice, BinaryReader streamReader, bool generateMipmaps = false)
 {
     using TrippyFontFile fontFile = TrippyFontFile.FromStream(streamReader);
     return(fontFile.CreateFonts(graphicsDevice, generateMipmaps));
 }
예제 #3
0
 /// <summary>
 /// Creates a single <see cref="TextureFont"/> from the <see cref="TrippyFontFile"/>.
 /// </summary>
 /// <param name="font">The <see cref="TrippyFontFile"/> to create fonts from.</param>
 /// <param name="graphicsDevice">The <see cref="GraphicsDevice"/> the <see cref="TextureFont"/> will use.</param>
 /// <param name="generateMipmaps">Whether to generate mipmaps for the texture's font.</param>
 public static TextureFont CreateFont(this TrippyFontFile font, GraphicsDevice graphicsDevice, bool generateMipmaps = false)
 {
     return(font.CreateFonts(graphicsDevice, generateMipmaps)[0]);
 }