コード例 #1
0
ファイル: Win_gdi32.cs プロジェクト: orf53975/Common
 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);
コード例 #2
0
 /// <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);
 }
コード例 #3
0
ファイル: GDIFont.cs プロジェクト: Wiladams/NewTOAPIA
        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);
        }
コード例 #4
0
ファイル: Text.cs プロジェクト: adamj200/EloBuddy.SDK
 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();
 }
コード例 #5
0
ファイル: Text.cs プロジェクト: adamj200/EloBuddy.SDK
 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();
 }
コード例 #6
0
        /// <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));
        }
コード例 #7
0
        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;
        }
コード例 #8
0
        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;
        }
コード例 #9
0
ファイル: NativeW.cs プロジェクト: bclnet/DroidNet
 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);
コード例 #10
0
ファイル: Font.cs プロジェクト: RadioSpace/SharpDX
 /// <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);
 }
コード例 #11
0
        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);
        }
コード例 #12
0
ファイル: Font.cs プロジェクト: HaKDMoDz/Psy
 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)
 {
 }
コード例 #13
0
 /// <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);
 }
コード例 #14
0
ファイル: dxmutmisc.cs プロジェクト: IntegralLee/fomm
        /// <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);
        }
コード例 #15
0
 /// <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());
 }
コード例 #16
0
 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);
コード例 #17
0
 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();
 }