PageRenderTime 517ms CodeModel.GetById 164ms app.highlight 3ms RepoModel.GetById 232ms app.codeStats 0ms

/Utilities/Graphics/FontStyle.cs

#
C# | 100 lines | 19 code | 11 blank | 70 comment | 0 complexity | 631f2c0c68dc9e78ff0351cc701992a0 MD5 | raw file
  1using System;
  2
  3namespace Delta.Utilities.Graphics
  4{
  5	/// <summary>
  6	/// Font style for the font creation process, allows us to add shadow
  7	/// to the font, create an outline, use italic or bold text plus
  8	/// specifying anti aliasing. Combine these with or and pass them to
  9	/// FontGenerator.GenerateFont, but also used for creating and loading
 10	/// fonts to make sure we got the correct style.
 11	/// </summary>
 12	[Flags]
 13	public enum FontStyle
 14	{
 15		/// <summary>
 16		/// Normal is probably used by most fonts, just renders the font out
 17		/// and uses anti aliasing, no bold, no italic, no shadow and no outline.
 18		/// </summary>
 19		Normal = 0,
 20
 21		/// <summary>
 22		/// Use italic (works only if the font has it), not used often.
 23		/// </summary>
 24		Italic = 1,
 25
 26		/// <summary>
 27		/// Make font bold (works only if font supports this).
 28		/// </summary>
 29		Bold = 2,
 30
 31		/// <summary>
 32		/// Add underline to the font (works only if font supports this).
 33		/// Note: This may look strange with some other effects (like shadow or
 34		/// outline) because this is not supported well and probably needs some
 35		/// fixing when rending the font.
 36		/// </summary>
 37		Underline = 4,
 38
 39		/// <summary>
 40		/// Add shadow to the font, usually makes the font a little bigger
 41		/// to fit the shadow (which is just the font again painted in black
 42		/// with a 10% distance into the bottom right, rendered before the
 43		/// actual white font).
 44		/// </summary>
 45		AddShadow = 8,
 46
 47		/// <summary>
 48		/// Add a black outline to the font, currently does not work well,
 49		/// especially for big fonts. Small fonts look ok. This will add some
 50		/// spacing (2px) around the font to allow an artist to add outlines
 51		/// himself if he isn't pleased with the generated texture.
 52		/// </summary>
 53		AddOutline = 16,
 54
 55		/// <summary>
 56		/// Increase the contrast of the font rendering to its maximum value.
 57		/// This can be used the font is too blurry otherwise. Should not be
 58		/// used with NoAntiAliasing, this would not affect SingleBitPerPixel.
 59		/// </summary>
 60		HighContrast = 32,
 61
 62		/// <summary>
 63		/// Decrease the contrast to a very low setting to make the font look more
 64		/// smooth. You should only use this for big fonts and if you think the
 65		/// font is too sharp. Should not be used with NoAntiAliasing, this would
 66		/// not affect SingleBitPerPixel rendering. Do not use together with
 67		/// HighContrast, then this setting will be ignored.
 68		/// </summary>
 69		LowContrast = 64,
 70
 71		/// <summary>
 72		/// Instead of using the default anti aliasing (which uses
 73		/// TextRenderingHint.AntiAliasGridFit) use
 74		/// TextRenderingHint.AntiAlias (no grid fit), which produces very different
 75		/// different results on small fonts, which are usually very sharp with the
 76		/// default settings (makes sense). However if you want smooth fonts and
 77		/// ClearTypeAntiAliasing is too much, use this setting.
 78		/// </summary>
 79		SmoothAntiAliasing = 128,
 80
 81		/// <summary>
 82		/// Disable anti aliasing (uses TextRenderingHint.SingleBitPerPixel),
 83		/// should not be necessary, even small fonts look ok with anti aliasing.
 84		/// Note: Do not use together with ClearTypeAntiAliasing, then
 85		/// this setting will be ignored (then Clear Type Anti aliasing will be
 86		/// still on, this only disables the default Anti aliasing).
 87		/// </summary>
 88		NoAntiAliasing = 256,
 89
 90		/// <summary>
 91		/// Instead of using the default anti aliasing (which uses
 92		/// TextRenderingHint.AntiAliasGridFit) use
 93		/// TextRenderingHint.ClearTypeGridFit, which might produce slightly
 94		/// different results depending if the font and system support clear type.
 95		/// Sometimes produces less sharp fonts so this is not the default and the
 96		/// difference can usually be neglected.
 97		/// </summary>
 98		ClearTypeAntiAliasing = 512,
 99	}
100}