问题描述
我正在使用PowerShell和ImageMagick创建我的字体集的自定义图像,以确定要安装到系统中的字体.我想让图像包含一些字体信息,但是我很难提取该信息.我在 https://powershell.org/forums找到了一些有用的代码/topic/listing-font-details/#post-78006 ,但是我发现只能在系统的字体目录内内访问信息.我的收藏集位于%SystemRoot%\ Fonts
的外部.
I'm using PowerShell and ImageMagick to create customized images of my font collection to determine which fonts I want to install into the system. I'd like to have the image include some font information, but I am having a difficult time extracting that information. I found some useful code at https://powershell.org/forums/topic/listing-font-details/#post-78006, but I found that information is only accessible within the system's font directory. My collection exists outside of %SystemRoot%\Fonts
.
我想访问类似的东西
- 字体名称(Aparajita)
- 字体样式(粗体,普通,斜体)
- 字体类型(Raster,OpenType/TrueType)
等
这可能吗?
推荐答案
在查看了Theo的答案并进行了一些代码修改之后,我发现根据是否安装了字体,存在不同的扩展属性.以下输出的顶部是安装字体时的结果,而不是未安装字体时的结果.简而言之,如果要将字体样式"和设计为"嵌入到Im生成的图像中,则需要先安装字体.
After reviewing Theo's answer, and doing some code modification, I made the discovery that there are different extended attributes depending on if the font is installed or not.The top section of the following output is when the font is installed, versus the bottom section when it is not installed. In short, if I want to embed the 'Font Style' and 'Designed For' into the image Im generating, I need to install the font first.
Value Attribute Index
----- --------- -----
Regular Font style 1
Show Show/hide 2
Arabic Designed for 3
Text Category 4
Microsoft Corporation Designer/foundry 5
Editable Font embeddability 6
OpenType Font type 7
Arabic Typesetting Family 8
2013-Aug-22 11:34 A Date modified 10
505 KB Size 11
C:\Windows\Fonts\ARABTYPE.TTF Font file names 13
6.00 Font version 14
------------------------------------------------------------------------------------
609 KB Size 1
TrueType font file Item type 2
2009-Jun-10 04:43 P Date modified 3
2019-Dec-16 01:50 P Date created 4
2019-Dec-16 01:50 P Date accessed 5
A Attributes 6
Available offline Availability 8
Unspecified Perceived type 9
Everyone Owner 10
Unrated Rating 19
Mamoun Sakkal, Paul C. Nelson and John Hudson Authors 20
Arabic Typesetting Title 21
© 2008 Microsoft Corporation. All Rights Res... Copyright 25
94.9 GB Total size 50
WINDOWS8.1 (this PC) Computer 53
.ttf File extension 156
arabtype.ttf Filename 157
5.91 File version 158
1.81 GB Space free 161
No Shared 178
Fonts Folder name 181
Y:\Documents\Fonts Folder path 182
Fonts (Y:\Documents) Folder 183
Y:\Documents\Fonts\arabtype.ttf Path 185
TrueType font file Type 187
Unresolved Link status 193
98% Space used 242
Not shared Sharing status 282
Available <unknown> 283
这篇关于通过PowerShell获取卸载的Windows字体的详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!