static extern IntPtr CreateFontW( [In] Int32 nHeight, [In] Int32 nWidth, [In] Int32 nEscapement, [In] Int32 nOrientation, [In] FontWeight fnWeight, [In] Boolean fdwItalic, [In] Boolean fdwUnderline, [In] Boolean fdwStrikeOut, [In] FontCharSet fdwCharSet, [In] FontPrecision fdwOutputPrecision, [In] FontClipPrecision fdwClipPrecision, [In] FontQuality fdwQuality, [In] FontPitchAndFamily fdwPitchAndFamily, [In] String lpszFace);
/// <summary> /// Initializes a new instance of the <see cref="Text" /> class. /// </summary> /// <param name="height">The height.</param> /// <param name="width">The width.</param> /// <param name="weight">The weight.</param> /// <param name="mipLevels">The mip levels.</param> /// <param name="isItalic">if set to <c>true</c> [is italic].</param> /// <param name="characterSet">The character set.</param> /// <param name="precision">The precision.</param> /// <param name="quality">The quality.</param> /// <param name="pitchAndFamily">The pitch and family.</param> /// <param name="faceName">Name of the face.</param> public Text(int height, int width, FontWeight weight, int mipLevels, bool isItalic, FontCharacterSet characterSet, FontPrecision precision, FontQuality quality, FontPitchAndFamily pitchAndFamily, string faceName) { font = new Font( Drawing.Direct3DDevice, height, width, weight, mipLevels, isItalic, characterSet, precision, quality, pitchAndFamily, faceName); }
public GDIFont(string lfFaceName, int lfHeight, byte lfPitchAndFamily, byte lfCharSet, FontQuality lfQuality, FontWeight lfWeight, bool lfItalic, bool lfStrikeOut, bool lfUnderline, byte lfClipPrecision, byte lfOutPrecision, int lfEscapement, int lfOrientation, int lfWidth, Guid aGuid) : base(true, aGuid) { fFaceName = lfFaceName; fHeight = lfHeight; fLogFont = new LOGFONT(); //fLogFont.Init(); fLogFont.lfCharSet = lfCharSet; fLogFont.lfClipPrecision = lfClipPrecision; fLogFont.lfEscapement = lfEscapement; fLogFont.lfFaceName = lfFaceName; fLogFont.lfHeight = lfHeight; fLogFont.lfItalic = (byte)(lfItalic ? 1 : 0); fLogFont.lfOrientation = lfOrientation; fLogFont.lfOutPrecision = lfOutPrecision; fLogFont.lfPitchAndFamily = lfPitchAndFamily; fLogFont.lfQuality = (byte)lfQuality; fLogFont.lfStrikeOut = (byte)(lfStrikeOut ? 1 : 0); fLogFont.lfUnderline = (byte)(lfUnderline ? 1 : 0); fLogFont.lfWeight = (int)lfWeight; fLogFont.lfWidth = lfWidth; //fFontHandle = GDI32.CreateFontIndirect(ref fLogFont); IntPtr fontHandle = GDI32.CreateFontW( lfHeight, lfWidth, lfEscapement, lfOrientation, (int)lfWeight, (uint)(lfItalic ? 1 : 0), (uint)(lfUnderline ? 1 : 0), (uint)(lfStrikeOut ? 1 : 0), lfCharSet, lfOutPrecision, lfClipPrecision, (uint)lfQuality, lfPitchAndFamily, lfFaceName); SetHandle(fontHandle); }
public Text( string textValue, int height, int width, FontWeight weight, int mipLevels, bool isItalic, FontCharacterSet characterSet, FontPrecision precision, FontQuality quality, FontPitchAndFamily pitchAndFamily, string faceName) { // Initialize properties _textValue = textValue; ReplaceFont(height, width, weight, mipLevels, isItalic, characterSet, precision, quality, pitchAndFamily, faceName); RegisterEventHandlers(); }
public void ReplaceFont( int height, int width, FontWeight weight, int mipLevels, bool isItalic, FontCharacterSet characterSet, FontPrecision precision, FontQuality quality, FontPitchAndFamily pitchAndFamily, string faceName) { if (TextHandle != null) { TextHandle.Dispose(); } TextHandle = new Font(Drawing.Direct3DDevice, height, width, weight, mipLevels, isItalic, characterSet, precision, quality, pitchAndFamily, faceName); RecalculateBoundingAndDisplayedText(); }
/// <summary>Create a font object</summary> public Font CreateFont(Device device, int height, int width, FontWeight weight, int mip, bool italic, CharacterSet charSet, Precision outputPrecision, FontQuality quality, PitchAndFamily pandf, string fontName) { // Create the font description FontDescription desc = new FontDescription(); desc.Height = height; desc.Width = width; desc.Weight = weight; desc.MipLevels = mip; desc.IsItalic = italic; desc.CharSet = charSet; desc.OutputPrecision = outputPrecision; desc.Quality = quality; desc.PitchAndFamily = pandf; desc.FaceName = fontName; // return the font return(CreateFont(device, desc)); }
public Text(string message, string faceName, uint height, int x, int y, ColorBGRA color, bool italic = false, bool bold = false, FontQuality quality = FontQuality.Antialiased) { Height = height; Color = color; X = x; Y = y; Message = message; Font = new Font(Drawing.Direct3DDevice, new FontDescription { FaceName = faceName, Height = (int)height, Quality = quality, Italic = italic, Weight = bold ? FontWeight.Bold : FontWeight.Regular }); Drawing.OnPreReset += Drawing_OnPreReset; Drawing.OnPostReset += Drawing_OnPostReset; }
public Text(string message, uint height, int x, int y, ColorBGRA color, bool italic = false, bool bold = false, FontQuality quality = FontQuality.Antialiased) { Height = height; Color = color; X = x; Y = y; Message = message; Font = new Font(Drawing.Direct3DDevice, new FontDescription { FaceName = "Gill Sans MT Pro Medium", Height = (int)height, Quality = quality, Italic = italic, Weight = bold ? FontWeight.Bold : FontWeight.Regular }); Drawing.OnPreReset += Drawing_OnPreReset; Drawing.OnPostReset += Drawing_OnPostReset; AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; }
public static extern IntPtr CreateFont(int nHeight, int nWidth, int nEscapement, int nOrientation, FontWeight fnWeight, FontItalic fdwItalic, FontUnderline fdwUnderline, FontStrikeOut fdwStrikeOut, FontCharSet fdwCharSet, FontOutputPrecision fdwOutputPrecision, FontClipPrecision fdwClipPrecision, FontQuality fdwQuality, FontPitchAndFamily fdwPitchAndFamily, string lpszFace);
/// <summary> /// Initializes a new instance of the <see cref="Font"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="height">The height.</param> /// <param name="width">The width.</param> /// <param name="weight">The weight.</param> /// <param name="mipLevels">The mip levels.</param> /// <param name="isItalic">if set to <c>true</c> [is italic].</param> /// <param name="characterSet">The character set.</param> /// <param name="precision">The precision.</param> /// <param name="quality">The quality.</param> /// <param name="pitchAndFamily">The pitch and family.</param> /// <param name="faceName">Name of the face.</param> public Font(Device device, int height, int width, FontWeight weight, int mipLevels, bool isItalic, FontCharacterSet characterSet, FontPrecision precision, FontQuality quality, FontPitchAndFamily pitchAndFamily, string faceName) { D3DX9.CreateFont(device, height, width, (int)weight, mipLevels, isItalic, (int)characterSet, (int)precision, (int)quality, (int)pitchAndFamily, faceName, this); }
private static int GetFontKey(Device dev, string name, int size, bool italic, FontWeight weight, FontQuality quality) { int hashCode = 0; unchecked { hashCode += 1000000007 * dev.ComPointer.GetHashCode(); hashCode += 1000000009 * name.GetHashCode(); hashCode += 1000000021 * size.GetHashCode(); hashCode += 1000000033 * italic.GetHashCode(); hashCode += 1000000087 * weight.GetHashCode(); hashCode += 1000000093 * quality.GetHashCode(); } return(hashCode); }
public Font(Device device, int height, int width, FontWeight weight, int mipLevels, bool italic, CharacterSet characterSet, Precision outputPrecision, FontQuality quality, PitchAndFamily pitchAndFamily, string faceName) : base(device, height, width, weight, mipLevels, italic, characterSet, outputPrecision, quality, pitchAndFamily, faceName) { }
/// <summary>Create a font object</summary> public Font CreateFont(Device device, int height, int width, FontWeight weight, int mip, bool italic, CharacterSet charSet, Precision outputPrecision, FontQuality quality, PitchAndFamily pandf, string fontName) { // Create the font description FontDescription desc = new FontDescription(); desc.Height = height; desc.Width = width; desc.Weight = weight; desc.MipLevels = mip; desc.IsItalic = italic; desc.CharSet = charSet; desc.OutputPrecision = outputPrecision; desc.Quality = quality; desc.PitchAndFamily = pandf; desc.FaceName = fontName; // return the font return CreateFont(device, desc); }
/// <summary> /// Create a new font from a path /// </summary> public Font(string filePath, int size = 9, bool bold = false, FontQuality quality = FontQuality.Default) { _font = MtaClient.DxCreateFont(filePath, size, bold, quality.ToString().ToLower()); }
public static extern IntPtr CreateFont(int h, int w, int e, int o, FontWeight weight, bool italic, bool underline, bool strikeout, FontCharSet charset, FontPrecision outPrecision, FontClipPrecision clipPrecision, FontQuality quality, FontPitchAndFamily pitchAFam, string face);
public Font(Device device, int height, int width, FontWeight weight, int miplevels, bool italic, CharacterSet charset, Precision outputPrecision, FontQuality quality, PitchAndFamily pitchFamily, string faceName) { throw new NotImplementedException(); }