Exemple #1
0
        public static unsafe void SetFontName(ref LOGFONT logFont, string fontName)
        {
            //font name not longer than 32 chars
            char[] fontNameChars = fontName.ToCharArray();
            int    j             = Math.Min(fontNameChars.Length, 31);

            fixed(char *c = logFont.lfFaceName)
            {
                char *c1 = c;

                for (int i = 0; i < j; ++i)
                {
                    *c1 = fontNameChars[i];
                    c1++;
                }
            }
        }
Exemple #2
0
 public static unsafe void SetFontName(ref LOGFONT logFont, string fontName)
 {
     //font name not longer than 32 chars
     char[] fontNameChars = fontName.ToCharArray();
     int j = Math.Min(fontNameChars.Length, 31);
     fixed (char* c = logFont.lfFaceName)
     {
         char* c1 = c;
         for (int i = 0; i < j; ++i)
         {
             *c1 = fontNameChars[i];
             c1++;
         }
     }
 }
Exemple #3
0
 [DllImport("gdi32.dll", CharSet = CharSet.Unicode)] //need -> unicode
 public extern static IntPtr CreateFontIndirect(ref LOGFONT logFont);
Exemple #4
0
 public static extern int EnumFontFamiliesEx(HDC hdc, ref LOGFONT lpLogFont, ref int lpEnumFontProc, int lParam, int dw);
Exemple #5
0
 public static extern int CreateFontIndirect(LOGFONT lpLogFont);
Exemple #6
0
 [DllImport("gdi32.dll", CharSet = CharSet.Unicode)] //need -> unicode
 public extern static IntPtr CreateFontIndirect(ref LOGFONT logFont);