zoukankan      html  css  js  c++  java
  • 枚举当前字体

    function EnumFontFamilyProc(var lf : TLogFont;
                                var tm : TNewTextMetric;
                                FontType : integer;
                                var Memo : TMemo) : integer
    {$IFDEF WIN32} stdcall; {$ELSE} ; export; {$ENDIF}
    begin
      Memo.Lines.Add(StrPas(@lf.lfFaceName) +
                            #32 + IntToStr(lf.lfHeight));
      result := 1;
    end;

    function EnumFontFamiliesProc(var lf : TLogFont;
                                  var tm : TNewTextMetric;
                                  FontType : integer;
                                  var Memo : TMemo) : integer
    {$IFDEF WIN32} stdcall; {$ELSE} ; export; {$ENDIF}
    begin
      if FontType = TRUETYPE_FONTTYPE then begin
        Memo.Lines.Add(StrPas(@lf.lfFaceName) + #32 + 'All Sizes');
      end else
        EnumFontFamilies(Printer.Handle,
                         @lf.lfFaceName,
                         @EnumFontFamilyProc,
                         LongInt(@Memo));
      result := 1;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    var
      tm : TTextMetric;
      i : integer;
    begin
      if PrintDialog1.Execute then begin
        EnumFontFamilies(Printer.Handle,
                         nil,
                         @EnumFontFamiliesProc,
                         LongInt(@Memo1));
      end;
    end;

  • 相关阅读:
    MyISAM和InnoDB的区别
    MySQL——索引与优化
    jquery选择器及效率问题
    Mac 可设置环境变量的位置、查看和添加PATH环境变量
    javascript默认中文(汉字/标点)长度均为1的解决
    苹果下抓屏截屏方法 包括全屏、选择区域、窗口抓屏等
    java实现window phone推送通知
    设计模式总结
    NHibernate 帮助类(单例实际运用)
    访问者模式
  • 原文地址:https://www.cnblogs.com/yzryc/p/6374302.html
Copyright © 2011-2022 走看看