Exemplo n.º 1
0
 /// <summary>
 /// Creates a <see cref="TrippyFontFile"/> holding information for multiple fonts with the same size.
 /// </summary>
 /// <remarks>All the fonts have the same character range.</remarks>
 public static TrippyFontFile CreateFontFile(ReadOnlySpan <string> fontFiles, float size, char firstChar = ' ', char lastChar = '~', Color?backgroundColor = null)
 {
     IGlyphSource[] glyphSources = new IGlyphSource[fontFiles.Length];
     for (int i = 0; i < glyphSources.Length; i++)
     {
         glyphSources[i] = new FontGlyphSource(FontInstance.LoadFont(fontFiles[i]), size, firstChar, lastChar);
     }
     return(FontBuilder.CreateFontFile(glyphSources, backgroundColor));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a <see cref="TrippyFontFile"/> holding information for multiple fonts.
 /// </summary>
 /// <remarks>All the fonts have the same character range.</remarks>
 public static TrippyFontFile CreateFontFile(ReadOnlySpan <Font> fonts, char firstChar = ' ', char lastChar = '~', Color?backgroundColor = null)
 {
     IGlyphSource[] glyphSources = new IGlyphSource[fonts.Length];
     for (int i = 0; i < fonts.Length; i++)
     {
         glyphSources[i] = new FontGlyphSource(fonts[i], firstChar, lastChar);
     }
     return(FontBuilder.CreateFontFile(glyphSources, backgroundColor));
 }