首页 > 解决方案 > [System.Drawing.Text.PrivateFontCollection],OTF 字体,Windows 7/PS2.0

问题描述

这在 Windows 10 中运行良好

$fontFilePath = '\\px\Rollouts\Misc\Fonts\Myriad Pro\MyriadPro-Cond.otf'
$fontCollection = New-Object System.Drawing.Text.PrivateFontCollection
$fontCollection.AddFontFile($fontFilePath)

但在 Windows 7/PS2 中,我得到Exception calling "AddFontFile" with "1" argument(s): "File not found.". 但是 TTF 字体可以正常工作。所以我认为[System.Drawing.Text.PrivateFontCollection]PS2.0 不支持 OpenType 字体?

标签: powershellfonts

解决方案


推荐阅读