4 using System.Collections.Generic;
15 internal int FrameCount {
get;
private set; }
16 internal FontManager FontManager {
get;
private set; }
18 internal FontCacheManager FontCacheManager {
get;
private set; }
19 internal readonly HashSet<SpriteFont> AllocatedSpriteFonts =
new HashSet<SpriteFont>();
28 if (graphicsDevice == null)
29 throw new ArgumentNullException(
"graphicsDevice");
32 FontManager =
new FontManager();
33 FontCacheManager =
new FontCacheManager(
this);
54 foreach (var allocatedSpriteFont
in AllocatedSpriteFonts.ToArray())
55 allocatedSpriteFont.Dispose();
60 return new StaticSpriteFont(
this, data);
65 return new DynamicSpriteFont(
this, data);
FontSystem(GraphicsDevice graphicsDevice)
Create a new instance of FontSystem base on the provided GraphicsDevice.
The interface to create and manage fonts.
void Load()
Load the fonts.
Data for a dynamic SpriteFont object.
The system managing the fonts.
SharpDX.DirectWrite.Font Font
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
SpriteFont NewDynamic(DynamicSpriteFontData data)
Create a new instance of a dynamic font.
SpriteFont to use with SpriteBatch. See SpriteFont to learn how to use it.
SpriteFont NewStatic(StaticSpriteFontData data)
Create a new instance of a static font.
Data for a static SpriteFont object that supports kerning.