Пример #1
0
        } // End Sub SaveImage

        public void SetFont(string strFontName, System.Drawing.FontStyle fsFontStyle, int iFontSize, System.Drawing.Color cTextColor)
        {
            TextFont  = new System.Drawing.Font(strFontName, iFontSize, fsFontStyle, System.Drawing.GraphicsUnit.Point);
            TextColor = cTextColor;
            //Color.Black
            TextBrush = new System.Drawing.SolidBrush(TextColor);
        } // End Sub SetFont
Пример #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.FontDialog fd = new System.Windows.Forms.FontDialog();

            System.Drawing.FontStyle style = System.Drawing.FontStyle.Regular;

            if (Settings.Default.SystemFontStyle == FontStyles.Italic)
            {
                style |= System.Drawing.FontStyle.Italic;
            }

            if (Settings.Default.SystemFontWeight == FontWeights.Bold)
            {
                style |= System.Drawing.FontStyle.Bold;
            }

            System.Drawing.Font font = new System.Drawing.Font(
                Settings.Default.SystemFontFamily.ToString(),
                (float)Settings.Default.SystemFontSize * 72.0f / 96.0f,
                style);

            fd.Font = font;

            System.Windows.Forms.DialogResult dr = fd.ShowDialog();
            if (dr != System.Windows.Forms.DialogResult.Cancel)
            {
                Settings.Default.SystemFontFamily = new System.Windows.Media.FontFamily(fd.Font.Name);
                Settings.Default.SystemFontSize   = fd.Font.Size * 96.0 / 72.0;
                Settings.Default.SystemFontWeight = fd.Font.Bold ? FontWeights.Bold : FontWeights.Regular;
                Settings.Default.SystemFontStyle  = fd.Font.Italic ? FontStyles.Italic : FontStyles.Normal;
            }
        }
Пример #3
0
        /// <summary>
        /// Append the provided message to the chatBox text box including the provided formatting.
        /// </summary>
        /// <param name="message"></param>
        public void AppendLineToChatHistory(System.Drawing.FontStyle style, string text, bool addNewLine)
        {
            //To ensure we can successfully append to the text box from any thread
            //we need to wrap the append within an invoke action.
            ChatHistory.Dispatcher.BeginInvoke(new Action(() =>
            {
                if (style == System.Drawing.FontStyle.Regular)
                {
                    ChatHistory.Inlines.Add(new Run(text));
                }
                else if (style == System.Drawing.FontStyle.Bold)
                {
                    ChatHistory.Inlines.Add(new Bold(new Run(text)));
                }
                else if (style == System.Drawing.FontStyle.Italic)
                {
                    ChatHistory.Inlines.Add(new Italic(new Run(text)));
                }
                else
                {
                    ChatHistory.Inlines.Add(new Run("Error: Attempted to add unknown text with unknown font style."));
                }

                if (addNewLine)
                {
                    ChatHistory.Inlines.Add("\n");
                }
                Scroller.ScrollToBottom();
            }));
        }
Пример #4
0
        private void _buttonChooseFont_Click(object sender, RoutedEventArgs e)
        {
            FontDialog fontDialog = new FontDialog();

            System.Drawing.FontStyle fontStyle = System.Drawing.FontStyle.Regular;
            if (_tabHeader1.FontWeight == FontWeights.Bold)
            {
                fontStyle |= System.Drawing.FontStyle.Bold;
            }
            if (_tabHeader1.FontStyle == FontStyles.Italic)
            {
                fontStyle |= System.Drawing.FontStyle.Italic;
            }

            fontDialog.Font = new System.Drawing.Font(_tabHeader1.FontFamily.ToString(), (float)(_tabHeader1.FontSize * 72.0 / 96.0), fontStyle);

            var result = fontDialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                SetFont(fontDialog, _tabHeader1);
                SetFont(fontDialog, _tabHeader2);
                SetFont(fontDialog, _tabHeader3);
            }
        }
Пример #5
0
        private void _CheckBox_formazasok(string alap_ertelmezett_e, int id, params System.Windows.Forms.CheckBox[] be)
        {
            if (alap_ertelmezett_e == "1" || id == 0)
            {
                rgb_szoveg_alap  = _rgb_szoveg_alap;
                betu_stilus_alap = _betu_stilus_alap;
            }
            else
            {
                formazas_beallitasok_beolvasasa(id);
            }
            for (int i = 0; i < darabolo.Length; i++)
            {
                ddarabolo[i] = rgb_szoveg_alap.Split(';')[i];
                darabolo[i]  = Convert.ToInt32(ddarabolo[i]);
            }
            for (int i = 0; i < be.Length; i++)
            {
                be[i].ForeColor = System.Drawing.Color.FromArgb(darabolo[0], darabolo[1], darabolo[2]);

                System.Drawing.FontFamily fa = new System.Drawing.FontFamily(betu_stilus_alap.Split(';')[0]);
                float size = float.Parse(betu_stilus_alap.Split(';')[1]);
                System.Drawing.FontStyle f = (System.Drawing.FontStyle)Enum.Parse(typeof(System.Drawing.FontStyle), betu_stilus_alap.Split(';')[2], true);
                be[i].Font = new System.Drawing.Font(fa.Name, size, f); // betűtípus
                //be[i].Font = new System.Drawing.Font(betu_stilus_alap, be[i].Font.Size, System.Drawing.FontStyle.Bold);
            }
        }
Пример #6
0
        private System.Drawing.FontStyle parseStyle(string styles)
        {
            System.Drawing.FontStyle fontStyle = System.Drawing.FontStyle.Regular;
            foreach (var style in styles.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries))
            {
                switch (style)
                {
                case "Regular":
                    fontStyle |= System.Drawing.FontStyle.Regular;
                    break;

                case "Bold":
                    fontStyle |= System.Drawing.FontStyle.Bold;
                    break;

                case "Italic":
                    fontStyle |= System.Drawing.FontStyle.Italic;
                    break;

                case "Underline":
                    fontStyle |= System.Drawing.FontStyle.Underline;
                    break;

                case "Strikeout":
                    fontStyle |= System.Drawing.FontStyle.Strikeout;
                    break;
                }
            }
            return(fontStyle);
        }
Пример #7
0
 /// <summary>
 /// AsciiFont Constructor
 /// </summary>
 /// <param name="fontName">Font name</param>
 /// <param name="fontSize">Font size in pixels</param>
 /// <param name="fontStyle">Optional FontStyle</param>
 public AsciiFont(string fontName, int fontSize, FontStyle fontStyle = FontStyle.Regular)
 {
     FontName = fontName;
     FontSize = fontSize;
     CreateFont(fontStyle);
     CreateBitmaps();
 }
Пример #8
0
 public FontDescriptor(string familyName, float size, FontStyle style, float outlineThickness)
 {
     FamilyName = familyName;
     Size = size;
     Style = style;
     OutlineThickness = outlineThickness;
 }
Пример #9
0
        /// <summary>
        /// Get cached font instance for the given font properties.<br/>
        /// Improve performance not to create same font multiple times.
        /// </summary>
        /// <returns>cached font instance</returns>
        public PixelFarm.Drawing.FontInfo GetCachedFont(string family, float size, System.Drawing.FontStyle style)
        {
            var font = TryGetFont(family, size, style);

            if (font == null)
            {
                //check if font exist
                if (!_existingFontFamilies.ContainsKey(family))
                {
                    //if not then check from font map
                    string mappedFamily;
                    if (_fontsMapping.TryGetValue(family, out mappedFamily))
                    {
                        //if has map then try get from existing
                        font = TryGetFont(mappedFamily, size, style);
                        if (font == null)
                        {
                            //if not found then
                            //create and register
                            font = CreateFont(mappedFamily, size, style);
                        }
                    }
                }
                if (font == null)
                {
                    //if still null
                    font = CreateFont(family, size, style);
                }
            }
            return(font);
        }
Пример #10
0
        private XnaFont LoadXnaFont(string assetName)
        {
            string[]  fontDesc   = assetName.Split(',');
            string    familyName = fontDesc[0];
            float     size;
            FontStyle style;

            if (float.TryParse(fontDesc[1], out size) &&
                Enum.TryParse(fontDesc[2], out style))
            {
                System.Drawing.FontStyle fStyle = System.Drawing.FontStyle.Regular;
                switch (style)
                {
                case FontStyle.Regular: fStyle = System.Drawing.FontStyle.Regular; break;

                case FontStyle.Bold: fStyle = System.Drawing.FontStyle.Bold; break;

                case FontStyle.Italic: fStyle = System.Drawing.FontStyle.Italic; break;
                }
                var baseFont = new System.Drawing.Font(familyName, size, fStyle, System.Drawing.GraphicsUnit.Pixel);
                return(new XnaFont(GraphicsDevice, baseFont));
            }
            else
            {
                return(null);
            }
        }
Пример #11
0
        /// <summary>
        /// 创建字体
        /// </summary>
        public Font CreateFont(string familyName, float emSize, System.Drawing.FontStyle style)
        {
            try
            {
                FontDescription description = new FontDescription();
                description.FaceName = familyName;
                //description.Height = (int)(1.9 * 10);
                description.Height = (int)(emSize);

                if (style == System.Drawing.FontStyle.Regular)
                {
                    return(CreateFont(description));
                }
                if ((style & System.Drawing.FontStyle.Italic) != 0)
                {
                    description.IsItalic = true;
                }
                if ((style & System.Drawing.FontStyle.Bold) != 0)
                {
                    description.Weight = FontWeight.Heavy;
                }
                description.Quality = FontQuality.AntiAliased;
                return(CreateFont(description));
            }
            catch
            {
                return(DefaultDrawingFont);
            }
        }
Пример #12
0
        public static System.Drawing.FontStyle GetFontStylesPrinter(int n)
        {
            System.Drawing.FontStyle f = System.Drawing.FontStyle.Regular;
            switch (f)
            {
            case System.Drawing.FontStyle.Bold:
                f = System.Drawing.FontStyle.Bold;
                break;

            case System.Drawing.FontStyle.Italic:
                f = System.Drawing.FontStyle.Italic;
                break;

            case System.Drawing.FontStyle.Regular:
                f = System.Drawing.FontStyle.Regular;
                break;

            case System.Drawing.FontStyle.Strikeout:
                f = System.Drawing.FontStyle.Strikeout;
                break;

            case System.Drawing.FontStyle.Underline:
                f = System.Drawing.FontStyle.Underline;
                break;

            default:
                break;
            }
            return(f);
        }
Пример #13
0
        /// <summary>
        /// Creates a font.
        /// </summary>
        public Font CreateFont(string familyName, float emSize, System.Drawing.FontStyle style)
        {
            try
            {
                FontDescription description = new FontDescription();
                description.FaceName = familyName;
                description.Height   = (int)(1.9 * emSize);

                if (style == System.Drawing.FontStyle.Regular)
                {
                    return(CreateFont(description));
                }
                if ((style & System.Drawing.FontStyle.Italic) != 0)
                {
                    description.IsItalic = true;
                }
                if ((style & System.Drawing.FontStyle.Bold) != 0)
                {
                    description.Weight = FontWeight.Heavy;
                }
                description.Quality = FontQuality.AntiAliased;
                return(CreateFont(description));
            }
            catch
            {
                Log.Write(Log.Levels.Error, "FONT", string.Format("Unable to load '{0}' {2} ({1}em)",
                                                                  familyName, emSize, style));
                return(defaultDrawingFont);
            }
        }
Пример #14
0
    internal System.Drawing.Font get_drawing_font()
    {
        if (internal_font == null || check_font_dirty())
        {
            System.Drawing.FontFamily ff;
            try
            {
                ff = new System.Drawing.FontFamily(name, private_fonts);
            }
            catch (Exception e)
            {
                ff = new System.Drawing.FontFamily(name);
            }
            System.Drawing.FontStyle style = System.Drawing.FontStyle.Regular;
            if (bold && ff.IsStyleAvailable(System.Drawing.FontStyle.Bold))
            {
                style = System.Drawing.FontStyle.Bold;
            }
            if (italic && ff.IsStyleAvailable(System.Drawing.FontStyle.Italic))
            {
                style = System.Drawing.FontStyle.Italic;
            }
            if (bold && italic && ff.IsStyleAvailable(System.Drawing.FontStyle.Bold) && ff.IsStyleAvailable(System.Drawing.FontStyle.Italic))
            {
                style = System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic;
            }

            if (internal_font != null)
            {
                internal_font.Dispose();
            }
            internal_font = new System.Drawing.Font(ff, size - 10, style, System.Drawing.GraphicsUnit.Pixel);
        }
        return(internal_font);
    }
Пример #15
0
        private System.Drawing.FontStyle GetFontStyle(string fontStyle)
        {
            System.Drawing.FontStyle styleDraw = System.Drawing.FontStyle.Regular;
            switch (fontStyle)
            {
            case "Regular":
                styleDraw = System.Drawing.FontStyle.Regular;
                break;

            case "Bold":
                styleDraw = System.Drawing.FontStyle.Bold;
                break;

            case "Italic":
                styleDraw = System.Drawing.FontStyle.Italic;

                break;

            case "Underline":
                styleDraw = System.Drawing.FontStyle.Underline;
                break;

            case "Strikeout":
                styleDraw = System.Drawing.FontStyle.Strikeout;
                break;
            }
            return(styleDraw);
        }
        //private Single mFuenteEspacion;

        public void Fuente(string Nombre, int Tamaño, System.Drawing.FontStyle Estilo)
        {
            mFuenteNombre = Nombre;
            mFuenteTamaño = Tamaño;
            mFuenteEstilo = Estilo;
            EstablecerFuente();
        }
Пример #17
0
 public CToast(ref GraphicsDeviceManager graphicsDM, ref Feel feel, int xPos, int yPos, int width, int height, string text,
               string fontName, int fontSize, System.Drawing.FontStyle fontStyle, Color fontColor, Color backColor, TextAlign textAlign, bool isFocusable) :
     base(xPos, yPos, width, height, text, fontName, fontSize, fontStyle, fontColor, backColor, textAlign, isFocusable)
 {
     Trimmed = true;
     ShowMessage(text);
 }
Пример #18
0
 public CTicker(int xPos, int yPos, int width, int height, string fontName,
                int fontSize, System.Drawing.FontStyle fontStyle, Color fontColor, Color bgColor, bool isFocusable) :
     base(xPos, yPos, width, height, string.Empty, fontName, fontSize, fontStyle, fontColor, bgColor, TextAlign.Left, isFocusable)
 {
     _isTicker   = true;
     ScrollSpeed = 2;
 }
Пример #19
0
        //[ValidateInput(false)]
        //public ActionResult watermark_handler()
        //{
        //    PrepairEditor(delegate(Editor editor)
        //    {
        //        editor.UploadImage += new UploadImageEventHandler(Editor1_UploadImage);
        //    });
        //    return new EmptyResult();
        //}

        void Editor1_UploadImage(object sender, UploadImageEventArgs args)
        {
            string text = Request["txt_watermark"];

            System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(400, 200, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
            using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap))
            {
                System.Drawing.FontStyle style = System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic | System.Drawing.FontStyle.Underline;
                System.Drawing.Font      font  = new System.Drawing.Font(System.Drawing.FontFamily.GenericMonospace, 26, style);
                System.Drawing.SizeF     size  = g.MeasureString(text, font);
                g.DrawString(text, font, System.Drawing.Brushes.DarkGreen, bitmap.Width - size.Width, bitmap.Height - size.Height);
            }

            RTE.ConfigWatermark watermark = new ConfigWatermark();
            watermark.XAlign    = "right";
            watermark.YAlign    = "bottom";
            watermark.XOffset   = -10;
            watermark.YOffset   = -10;
            watermark.MinWidth  = 450;
            watermark.MinHeight = 300;
            watermark.Image     = bitmap;

            args.Watermarks.Clear();
            args.Watermarks.Add(watermark);
            args.DrawWatermarks = true;
        }
Пример #20
0
        /// <summary>
        /// Get cached font if it exists in cache or null if it is not.
        /// </summary>
        PixelFarm.Drawing.FontInfo TryGetFont(string family, float size, System.Drawing.FontStyle style)
        {
            PixelFarm.Drawing.FontInfo fontInfo = null;
            FontKey fontKey = new FontKey(family.ToLower(), size, style);

            _fontInfoCacheByFontKey.TryGetValue(fontKey, out fontInfo);
            return(fontInfo);
        }
Пример #21
0
 /// <summary>
 /// Creates a new line.
 /// </summary>
 /// <param name="text">The line's content.</param>
 /// <param name="size">The font size of the line, by default 8.</param>
 /// <param name="style">The font style of the line.</param>
 /// <param name="type">The line's font's family.</param>
 /// <param name="alignment">The text aligment type of the line. Left by default.</param>
 public Line(string text, float size = 8, FontStyle style = FontStyle.Regular, string type = DefaultFontType, TextAlignment alignment = TextAlignment.Left)
 {
     Text      = text;
     Size      = size;
     Style     = style;
     Type      = type;
     Alignment = alignment;
 }
Пример #22
0
 public abstract bool DrawString(
     System.Drawing.Graphics graphics,
     System.Drawing.FontFamily fontFamily,
     System.Drawing.FontStyle fontStyle,
     int fontSize,
     string strText,
     System.Drawing.Rectangle rtDraw,
     System.Drawing.StringFormat strFormat);
Пример #23
0
 private SharpDX.DirectWrite.FontStyle StyleFromFontStyle(System.Drawing.FontStyle style)
 {
     SharpDX.DirectWrite.FontStyle ret = SharpDX.DirectWrite.FontStyle.Normal;
     if (style.HasFlag(System.Drawing.FontStyle.Italic))
     {
         ret |= SharpDX.DirectWrite.FontStyle.Italic;
     }
     return(ret);
 }
Пример #24
0
        public void GetDrawingStyle_Test1()
        {
            FontStyle fontStyle = FontStyle.Bold;

            System.Drawing.FontStyle expected = System.Drawing.FontStyle.Bold;
            System.Drawing.FontStyle actual;
            actual = PDFFont.GetDrawingStyle(fontStyle);
            Assert.AreEqual(expected, actual);
        }
Пример #25
0
 private SharpDX.DirectWrite.FontWeight WeightFromFontStyle(System.Drawing.FontStyle style)
 {
     SharpDX.DirectWrite.FontWeight ret = SharpDX.DirectWrite.FontWeight.Normal;
     if (style.HasFlag(System.Drawing.FontStyle.Bold))
     {
         ret = SharpDX.DirectWrite.FontWeight.Bold;
     }
     return(ret);
 }
Пример #26
0
        //根据配置得到字体
        private System.Drawing.Font getFont(XmlNode fontNode)
        {
            float size = 9f;

            System.Drawing.FontStyle styles = System.Drawing.FontStyle.Regular;

            foreach (XmlNode node in fontNode.ChildNodes)
            {
                if (node.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                string text = node.InnerText.Trim();

                switch (node.Name)
                {
                case "Size":
                    size = MB.Util.MyConvert.Instance.ToFloat(text, 2);
                    break;

                case "Bold":
                    if (MB.Util.MyConvert.Instance.ToBool(text))
                    {
                        styles = styles | System.Drawing.FontStyle.Bold;
                    }
                    break;

                case "Italic":
                    if (MB.Util.MyConvert.Instance.ToBool(text))
                    {
                        styles = styles | System.Drawing.FontStyle.Italic;
                    }
                    break;

                case "Strikeout":
                    if (MB.Util.MyConvert.Instance.ToBool(text))
                    {
                        styles = styles | System.Drawing.FontStyle.Strikeout;
                    }
                    break;

                case "UndeLine":
                    if (MB.Util.MyConvert.Instance.ToBool(text))
                    {
                        styles = styles | System.Drawing.FontStyle.Underline;
                    }
                    break;

                default:
                    MB.Util.TraceEx.Write("节点" + node.Name + "还没有进行处理,请确定对应的XML文件配置是否正确,请区分大小写。");
                    break;
                }
            }
            System.Drawing.Font font = new System.Drawing.Font("Microsoft Sans Serif", size, styles);
            return(font);
        }
Пример #27
0
            public XFontSourceKey(string fontFamilyName, System.Drawing.FontStyle fontStyle)
            {
                if (String.IsNullOrWhiteSpace(fontFamilyName))
                {
                    throw new ArgumentException("Value cannot be null or empty.", nameof(fontFamilyName));
                }

                this.FontFamilyName = fontFamilyName;
                this.FontStyle      = fontStyle;
            }
Пример #28
0
 public override void RefreshObject(int xPos, int yPos, int width, int height, string text,
                                    string fontName,
                                    int fontSize,
                                    System.Drawing.FontStyle fontStyle,
                                    Color fontColor, Color backColor, TextAlign textAlign, bool visible, bool isFocusable)
 {
     // don't overwrite text (toast message survives to layout change!)
     base.RefreshObject(xPos, yPos, width, height, Text,
                        fontName, fontSize, fontStyle, fontColor, backColor, textAlign, visible, isFocusable);
     ShowMessage(Text);
 }
Пример #29
0
        internal Entities.SongElementFormat GetSongElementFormat()
        {
            var    colorPickerValue = colorPicker.Value;
            string fontName         = cmbFont.Text;
            float  fontSize         = 1;

            float.TryParse(cmbFontSize.Text, out fontSize);
            System.Drawing.Color     color     = System.Drawing.Color.FromArgb((int)colorPickerValue.Rb, (int)colorPickerValue.Gb, (int)colorPickerValue.Bb);
            System.Drawing.FontStyle fontStyle = (System.Drawing.FontStyle)Enum.Parse(typeof(System.Drawing.FontStyle), cmbFontStyle.Text);
            return(new Entities.SongElementFormat(fontName, fontSize, fontStyle, color));
        }
Пример #30
0
 internal WindowTextFont(string fontFamily, float sizeInPt, FontStyle style, int outlineSize)
 {
     Font        = new Font(fontFamily, (int)Math.Round(sizeInPt * 96 / 72), style, GraphicsUnit.Pixel);
     FontHeight  = Font.Height;
     OutlineSize = outlineSize;
     Characters  = new CharacterGroup(Font, OutlineSize);
     if (Viewer3D.Viewer.Catalog != null)
     {
         EnsureCharacterData(Viewer3D.Viewer.Catalog.GetString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 \",.-+|!$%&/()=?;:'_[]"));
     }
 }
Пример #31
0
        public static FontStyle Map(System.Drawing.FontStyle fontStyle)
        {
            switch (fontStyle)
            {
            case System.Drawing.FontStyle.Italic:
                return(FontStyles.Italic);

            default:
                return(FontStyles.Normal);
            }
        }
Пример #32
0
 public FontDescriptor(string familyName, float size, FontStyle style)
     : this(familyName, size, style, 0)
 { }
Пример #33
0
        public sFont(String name, String path, int scale, bool replacement)
        {
            String fontPath = cProperties.getProperty("path_fonts");
            String skinPath = cProperties.getProperty("path_skin");
            String skinsPath = cProperties.getProperty("path");

            pfc = new PrivateFontCollection();

            Name = name; 
            Path = path;

            Scale = scale;
            Replacement = replacement;

            //This way we have only the file name, but what happens if the fonts are in the skin directory ?
            //Lets check all posibilities
            Filename = Path.Substring(Path.LastIndexOf('/')>0?Path.LastIndexOf('/')+1:0);
            String AbsolutPathFont = fontPath + "/" + Filename;
            String AbsolutPathSkinPathFont = skinsPath + "/" + skinPath + "/" + Filename;
            String RelativPathFont = Path;
            String RelativPathSkinPathFont = skinsPath + "/" + skinPath + "/" + Path;
            RelativPathFont = Path;
            RelativPathFont = RelativPathFont.Replace("enigma2", "");
            RelativPathFont = RelativPathFont.Replace("usr", "");
            RelativPathFont = RelativPathFont.Replace("local", "");
            RelativPathFont = RelativPathFont.Replace("share", "");
            RelativPathFont = RelativPathFont.Replace("var", "");
            RelativPathFont = skinsPath + "/" + RelativPathFont;

            AbsolutPathFont = AbsolutPathFont.Replace("\\", "/");
            AbsolutPathSkinPathFont = AbsolutPathSkinPathFont.Replace("\\", "/");
            RelativPathFont = RelativPathFont.Replace("\\", "/");
            RelativPathSkinPathFont = RelativPathSkinPathFont.Replace("\\", "/");


            //RelativPathFont = fontPath.Replace("fonts", "") + RelativPathFont;

            String lookupPath = "";
            if (File.Exists(AbsolutPathFont))
                lookupPath = new FileInfo(AbsolutPathFont).FullName;
            else if (File.Exists(AbsolutPathSkinPathFont))
                lookupPath = new FileInfo(AbsolutPathSkinPathFont).FullName;
            else if (File.Exists(RelativPathFont))
                lookupPath = new FileInfo(RelativPathFont).FullName;
            else if (File.Exists(RelativPathSkinPathFont))
                lookupPath = new FileInfo(RelativPathSkinPathFont).FullName;
            else
            {
                String errorMessage = "";
                errorMessage += "e2skinner2 has searched in several places for the font \"" + Filename + ".\"\n";
                errorMessage += "Unfortunatly the search was not successful.\n";
                errorMessage += "\n";
                errorMessage += "Search Locations:\n";
                errorMessage += "\t" + new FileInfo(AbsolutPathFont).FullName + "\n";
                errorMessage += "\t" + new FileInfo(AbsolutPathSkinPathFont).FullName + "\n";
                errorMessage += "\t" + new FileInfo(RelativPathFont).FullName + "\n";
                errorMessage += "\t" + new FileInfo(RelativPathSkinPathFont).FullName + "\n";

                MessageBox.Show(errorMessage,
                    "Error while loading fonts",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information,
                    MessageBoxDefaultButton.Button1);

                return;
            }

            try
            {
                pfc.AddFontFile(lookupPath);
            }
            catch (FileNotFoundException error)
            {
                String errorMessage = "";
                errorMessage += "e2skinner2 has tried to open the font \"" + Filename + "\".\n";
                errorMessage += "Unfortunatly this was not successful.\n";
                errorMessage += "Either the font type is not supported by e2kinner2,\n";
                errorMessage += "or it is not a vaild font.\n";
                errorMessage += "\n";
                errorMessage += "Location:\n";
                errorMessage += "\t" + new FileInfo(lookupPath).FullName + "\n" + error + "\n";

                MessageBox.Show(errorMessage,
                    "Error while loading fonts",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information,
                    MessageBoxDefaultButton.Button1);

                return;
            }

            FontFamily = pfc.Families[0];
            String name2 = FontFamily.GetName(0);
            FontStyle = System.Drawing.FontStyle.Regular;
            if (FontFamily.IsStyleAvailable(System.Drawing.FontStyle.Regular))
                FontStyle = System.Drawing.FontStyle.Regular;
            else
                FontStyle = System.Drawing.FontStyle.Bold;

            int t1 = FontFamily.GetCellAscent(FontStyle);
            int t2 = FontFamily.GetCellDescent(FontStyle);
            int t3 = FontFamily.GetEmHeight(FontStyle);
            int t4 = FontFamily.GetLineSpacing(FontStyle);
        }