Dwarrowdelf.Client.TileSetLoader.CreateCharDrawing C# (CSharp) Method

CreateCharDrawing() private method

private CreateCharDrawing ( CharGfx gfx ) : System.Windows.Media.Drawing
gfx CharGfx
return System.Windows.Media.Drawing
        Drawing CreateCharDrawing(CharGfx gfx)
        {
            var fontFamily = gfx.FontFamily != null ? gfx.FontFamily : m_symbolSet.FontFamily;
            var typeface = new Typeface(fontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);
            var fontSize = gfx.FontSize.HasValue ? gfx.FontSize.Value : m_symbolSet.FontSize;
            var outline = gfx.Outline.HasValue ? gfx.Outline.Value : m_symbolSet.Outline;
            var outlineThickness = gfx.OutlineThickness.HasValue ? gfx.OutlineThickness.Value : m_symbolSet.OutlineThickness;

            var drawing = TileSetLoaderHelpers.DrawCharacter(gfx.Char, typeface, fontSize, gfx.Color, gfx.Background, outline,
                outlineThickness, gfx.Reverse, gfx.Mode);

            drawing = TileSetLoaderHelpers.NormalizeDrawing(drawing, new Point(gfx.X, gfx.Y), new Size(gfx.W, gfx.H),
                gfx.Rotate, !gfx.Opaque, gfx.Opacity);

            drawing.Freeze();

            return drawing;
        }