• 枚举当前字体


    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;

  • 相关阅读:
    Android开源项目发现---ImageView 篇(持续更新)
    Android开源项目发现---GridView 篇(持续更新)
    python的setup.py文件
    版本控制系统git
    python如何调用c编译好可执行程序
    Python特殊语法:filter、map、reduce、lambda [转]
    Apache+Mysql+PHP 套件
    django开发环境搭建(参考流程)
    C++ GUI Qt4编程-创建自定义窗口部件
    Qt学习笔记-Widget布局管理
  • 原文地址:https://www.cnblogs.com/yzryc/p/6374302.html
Copyright © 2020-2023  润新知