为什么TFontDialog比Screen.Fonts提供更少的字体? [英] Why TFontDialog gives less fonts than Screen.Fonts?

查看:216
本文介绍了为什么TFontDialog比Screen.Fonts提供更少的字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么TFontDialog比Screen.Fonts提供更少的字体? (例如,Arial *字体,Comic字体等,不会在TFontDialog中显示)

似乎TFontDialog给出的字体列表与写字板,而Screen.Fonts给出的字体列表基本上与Word相同。

非常感谢您的见解!

PS:
Delphi XE,
Windows 7

PS:相关的SO主题:
$ b



  1. )显然, TFontDialog 的确不显示这些隐藏的字体。



    另外, 中列出的一些字体没有在 Font 组合框的 TFontDialog ,但添加到字体样式组合框。以 Arial 为例:字体样式列出了10个项目,它们似乎是字体 Arial Arial Black Arial Narrow


    I am wondering why TFontDialog gives less fonts than Screen.Fonts? (For example, the Arial* font, the Comic font, etc, does not show in TFontDialog)

    It also seems that the font list given by TFontDialog is the same as WordPad, whereas the font list given by Screen.Fonts is basically the same as Word.

    Thank you very much for your insights!

    PS: Delphi XE, Windows 7

    PS: related SO topics:

    1. Too many fonts when enumerating with EnumFontFamiliesEx function
    2. Finding System Fonts with Delphi
    3. How to use external fonts?

    PS: related web pages:

    1. TFontDialog to show all Fonts @ borland.newsgroups.archived
    2. TFontDialog to show all Fonts @ delphigroups

    unit Unit2;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
    
    type
      TForm2 = class(TForm)
        lst1: TListBox;
        dlgFont1: TFontDialog;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form2: TForm2;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm2.FormCreate(Sender: TObject);
    begin
      lst1.Items.AddStrings(Screen.Fonts);
    end;
    
    procedure TForm2.Button1Click(Sender: TObject);
    begin
      dlgFont1.Device := fdBoth;
      if dlgFont1.Execute then
      begin
    
      end;
    end;
    
    end.    
    

    解决方案

    Screen.Fonts returns all installed fonts, including hidden fonts as administrated in Registry\HKCU\Software\Microsoft\Windows NT\CurrentVersion\Font Management\Inactive Fonts. (Source) Apparently, TFontDialog does not display these hidden fonts.

    Furthermore, some fonts listed in Screen.Fonts are not mentioned in the Font combo box of TFontDialog, but are added to the Font style combo box. Take Arial for example: the Font style lists 10 items, which seems to be the combination of the fonts Arial, Arial Black and Arial Narrow.

    这篇关于为什么TFontDialog比Screen.Fonts提供更少的字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆