/Utilities/Graphics/FontStyle.cs
C# | 100 lines | 19 code | 11 blank | 70 comment | 0 complexity | 631f2c0c68dc9e78ff0351cc701992a0 MD5 | raw file
Possible License(s): Apache-2.0
- using System;
-
- namespace Delta.Utilities.Graphics
- {
- /// <summary>
- /// Font style for the font creation process, allows us to add shadow
- /// to the font, create an outline, use italic or bold text plus
- /// specifying anti aliasing. Combine these with or and pass them to
- /// FontGenerator.GenerateFont, but also used for creating and loading
- /// fonts to make sure we got the correct style.
- /// </summary>
- [Flags]
- public enum FontStyle
- {
- /// <summary>
- /// Normal is probably used by most fonts, just renders the font out
- /// and uses anti aliasing, no bold, no italic, no shadow and no outline.
- /// </summary>
- Normal = 0,
-
- /// <summary>
- /// Use italic (works only if the font has it), not used often.
- /// </summary>
- Italic = 1,
-
- /// <summary>
- /// Make font bold (works only if font supports this).
- /// </summary>
- Bold = 2,
-
- /// <summary>
- /// Add underline to the font (works only if font supports this).
- /// Note: This may look strange with some other effects (like shadow or
- /// outline) because this is not supported well and probably needs some
- /// fixing when rending the font.
- /// </summary>
- Underline = 4,
-
- /// <summary>
- /// Add shadow to the font, usually makes the font a little bigger
- /// to fit the shadow (which is just the font again painted in black
- /// with a 10% distance into the bottom right, rendered before the
- /// actual white font).
- /// </summary>
- AddShadow = 8,
-
- /// <summary>
- /// Add a black outline to the font, currently does not work well,
- /// especially for big fonts. Small fonts look ok. This will add some
- /// spacing (2px) around the font to allow an artist to add outlines
- /// himself if he isn't pleased with the generated texture.
- /// </summary>
- AddOutline = 16,
-
- /// <summary>
- /// Increase the contrast of the font rendering to its maximum value.
- /// This can be used the font is too blurry otherwise. Should not be
- /// used with NoAntiAliasing, this would not affect SingleBitPerPixel.
- /// </summary>
- HighContrast = 32,
-
- /// <summary>
- /// Decrease the contrast to a very low setting to make the font look more
- /// smooth. You should only use this for big fonts and if you think the
- /// font is too sharp. Should not be used with NoAntiAliasing, this would
- /// not affect SingleBitPerPixel rendering. Do not use together with
- /// HighContrast, then this setting will be ignored.
- /// </summary>
- LowContrast = 64,
-
- /// <summary>
- /// Instead of using the default anti aliasing (which uses
- /// TextRenderingHint.AntiAliasGridFit) use
- /// TextRenderingHint.AntiAlias (no grid fit), which produces very different
- /// different results on small fonts, which are usually very sharp with the
- /// default settings (makes sense). However if you want smooth fonts and
- /// ClearTypeAntiAliasing is too much, use this setting.
- /// </summary>
- SmoothAntiAliasing = 128,
-
- /// <summary>
- /// Disable anti aliasing (uses TextRenderingHint.SingleBitPerPixel),
- /// should not be necessary, even small fonts look ok with anti aliasing.
- /// Note: Do not use together with ClearTypeAntiAliasing, then
- /// this setting will be ignored (then Clear Type Anti aliasing will be
- /// still on, this only disables the default Anti aliasing).
- /// </summary>
- NoAntiAliasing = 256,
-
- /// <summary>
- /// Instead of using the default anti aliasing (which uses
- /// TextRenderingHint.AntiAliasGridFit) use
- /// TextRenderingHint.ClearTypeGridFit, which might produce slightly
- /// different results depending if the font and system support clear type.
- /// Sometimes produces less sharp fonts so this is not the default and the
- /// difference can usually be neglected.
- /// </summary>
- ClearTypeAntiAliasing = 512,
- }
- }