Azavea.NijPredictivePolicing.AcsAlchemistGui.MainForm.LoadFonts C# (CSharp) Method

LoadFonts() protected method

We're doing this because fonts are rarely consistent between machines (in this case, my dev laptop, and my dev workstation). This changes the appearance of the console log, and the controls quite significantly (stuff disappears), so it's pretty important that the font is right.
protected LoadFonts ( ) : void
return void
        protected void LoadFonts()
        {
            try
            {
                //copied from http://dotnet-coding-helpercs.blogspot.com/
                unsafe
                {
                    var fonts = new List<byte[]>();
                    fonts.Add(Resource1.LiberationMono_Regular);
                    fonts.Add(Resource1.LiberationSans_Regular);

                    foreach (var buffer in fonts)
                    {
                        fixed (byte* pFontData = buffer)
                        {
                            uint dummy = 0;
                            _fontCollection.AddMemoryFont((IntPtr)pFontData, buffer.Length);
                            AddFontMemResourceEx((IntPtr)pFontData, (uint)buffer.Length, IntPtr.Zero, ref dummy);
                        }
                    }
                }

                //opting to leave the form alone for the moment, because these fonts aren't especially awesome
                //this.Font =  new Font(_fontCollection.Families[1], 9);

                //however, we absolutely need a monospaced font here for this to look correct.
                txtLogConsole.Font = new Font(_fontCollection.Families[0], 8f);
            }
            catch (Exception ex)
            {
                this.DisplayException("Error Loading Embedded Font", ex);
            }
        }