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;

  • 相关阅读:
    DNS服务器详解
    numpy学习
    test_pandas
    1.爬虫基本介绍
    数据分析介绍及软件使用 01
    3.解析库beautifulsoup
    jQuery UI vs EasyUI
    "file:///" file 协议
    Display:Block
    前端响应式设计中@media等的相关运用
  • 原文地址:https://www.cnblogs.com/yzryc/p/6374302.html
Copyright © 2011-2022 走看看