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