예제 #1
0
파일: FontUtil.cs 프로젝트: biorpg/RT.Util
 private static int enumFontsCallback(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontType, int lParam)
 {
     if (lpelfe.elfLogFont.lfPitchAndFamily.HasFlag(FontPitchAndFamily.FIXED_PITCH))
     {
         _monospaceFontNames.Add(lpelfe.elfFullName);
     }
     return(1);
 }
예제 #2
0
 public int Callback(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int fontType, int lParam)
 {
     try
     {
         cnt++;
         if (fontType != TRUETYPE_FONTTYPE)
             fontList.Add(lpelfe);
     }
     catch { }
     return cnt;
 }
 public int Callback(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int fontType, int lParam)
 {
     try
     {
         cnt++;
         if (fontType != TRUETYPE_FONTTYPE)
         {
             fontList.Add(lpelfe);
         }
     }
     catch {}
     return(cnt);
 }
예제 #4
0
        private static int EnumerateFontCallback(
            ref ENUMLOGFONTEXDV fontAttributes,
            ref NEWTEXTMETRICEX textMetrics,
            FontTypes fontType,
            LPARAM lParam)
        {
            var info = (List <FontInformation>)GCHandle.FromIntPtr(lParam).Target;

            info.Add(new FontInformation {
                FontType = fontType, TextMetrics = textMetrics, FontAttributes = fontAttributes
            });
            return(1);
        }
 public int callback1(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontType, int lParam)
 {
     try
     {
         FontType fontType;
         if (FontType == 2 || FontType == 4)
         {
             fontType = (ClientTools.Fonts.FontType)FontType;
         }
         else
         {
             fontType = ClientTools.Fonts.FontType.Unknown;
         }
         FontFamilies.Add(new FontFamily(lpelfe.elfFullName, fontType));
     }
     catch (Exception e)
     {
         System.Diagnostics.Trace.WriteLine(e.ToString());
     }
     return(1);
 }
예제 #6
0
        public int callback1(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontTypeParam, int lParam)
        {
            try
            {
                FontType fontType;
                if (FontTypeParam == 2 || FontTypeParam == 4)
                {
                    fontType = (FontType)FontTypeParam;
                }
                else
                {
                    fontType = FontType.Unknown;
                }

                FontFamilies.Add(new FontFamily(lpelfe.elfFullName, fontType));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            return(1);
        }
예제 #7
0
 public int callback1(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontType, int lParam)
 {
     try
     {
         FontType fontType;
         if (FontType == 4 && lpelfe.elfFullName.StartsWith("@") == false && lpelfe.elfScript != "Symbol")
         {
             fontType = (FontType)FontType;
             FontFamilies.Add(new FontFamily(lpelfe.elfFullName, fontType)
             {
                 Script = lpelfe.elfScript, Style = lpelfe.elfStyle, Weight = lpelfe.elfLogFont.lfWeight.ToString(), Charset = lpelfe.elfLogFont.lfCharSet.ToString()
             });
         }
         else
         {
             fontType = Helpers.FontType.Unknown;
         }
     }
     catch (Exception e)
     {
         System.Diagnostics.Trace.WriteLine(e.ToString());
     }
     return(1);
 }
예제 #8
0
 private static int enumFontsCallback(ref ENUMLOGFONTEX lpelfe, ref NEWTEXTMETRICEX lpntme, int FontType, int lParam)
 {
     if (lpelfe.elfLogFont.lfPitchAndFamily.HasFlag(FontPitchAndFamily.FIXED_PITCH))
         _monospaceFontNames.Add(lpelfe.elfFullName);
     return 1;
 }