Beispiel #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++;
                }
            }
        }
Beispiel #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++;
         }
     }
 }
Beispiel #3
0
 [DllImport("gdi32.dll", CharSet = CharSet.Unicode)] //need -> unicode
 public extern static IntPtr CreateFontIndirect(ref LOGFONT logFont);
Beispiel #4
0
 public static extern int EnumFontFamiliesEx(HDC hdc, ref LOGFONT lpLogFont, ref int lpEnumFontProc, int lParam, int dw);
Beispiel #5
0
 public static extern int CreateFontIndirect(LOGFONT lpLogFont);
Beispiel #6
0
 [DllImport("gdi32.dll", CharSet = CharSet.Unicode)] //need -> unicode
 public extern static IntPtr CreateFontIndirect(ref LOGFONT logFont);