对于引导 glyphicons_halflings.ttf字体的特定情况,该字体通过设计放入网站的字体文件夹,此解决方案在不抑制 ICE07 警告的情况下工作:
因为您还将同时安装匹配的 woff、eot 和 svg webfonts,您可以指定 TTF 文件有一个伴随文件而不是 TrueType 字体。
如果您天真地创建一个 WiX 片段以将 Halflings 字体文件添加到您的站点字体文件夹,如下所示:(根据需要替换部分 GUID)
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="WebsiteFontsDir">
<Component Id="CMP_WebsiteFonts" Guid="{********-482C-4924-B06E-9FAC34F89D1D}" KeyPath="yes">
<File Id="glyphicons_halflings_regular.eot" Source="$(var.ViewerModule.TargetDir)Police\fonts\glyphicons-halflings-regular.eot" />
<File Id="glyphicons_halflings_regular.svg" Source="$(var.ViewerModule.TargetDir)Police\fonts\glyphicons-halflings-regular.svg" />
<File Id="glyphicons_halflings_regular.woff" Source="$(var.ViewerModule.TargetDir)Police\fonts\glyphicons-halflings-regular.woff" />
</Component>
<Component Id="CMP_WebsiteFonts2" Guid="{********-BFFE-441D-B8F4-156DD596B09F}" KeyPath="yes">
<File Id="glyphicons_halflings_regular.ttf" Source="$(var.ViewerModule.TargetDir)Police\fonts\glyphicons-halflings-regular.ttf" DefaultVersion="1.001" TrueType="yes" />
</Component>
</DirectoryRef>
</Fragment>
它将文件添加到正确的位置,但构建您的解决方案将产生一个ICE07验证警告,抱怨 TTF 字体文件必须放在 Windows 字体文件夹中。
鉴于这是一种网络字体,不应该去那里,这很烦人,但幸运的是,因为它是一种网络字体,你需要它以多种格式来安抚 IE、Edge、Chrome、Firefox 等......这意味着你可以制作使用存在的非 TTF 字体变体来消除警告。
像这样重构片段:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="WebsiteFontsDir">
<Component Id="CMP_WebsiteFonts" Guid="{********-482C-4924-B06E-9FAC34F89D1D}" KeyPath="yes">
<File Id="glyphicons_halflings_regular.eot" Source="$(var.AZViewerModule.TargetDir)fonts\glyphicons-halflings-regular.eot" />
<File Id="glyphicons_halflings_regular.svg" Source="$(var.AZViewerModule.TargetDir)fonts\glyphicons-halflings-regular.svg" />
<File Id="glyphicons_halflings_regular.woff" Source="$(var.AZViewerModule.TargetDir)fonts\glyphicons-halflings-regular.woff" />
</Component>
<Component Id="CMP_WebsiteFonts2" Guid="{********-BFFE-441D-B8F4-156DD596B09F}">
<File Id="glyphicons_halflings_regular.ttf"
Source="$(var.ViewerModule.TargetDir)fonts\glyphicons-halflings-regular.ttf"
TrueType="no"
KeyPath="no"
CompanionFile="glyphicons_halflings_regular.eot"/>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
在这里,我们否认它是 TTF 字体,并为其提供一个伴随文件,该文件是其他 Web 字体文件之一。一切都安装在您期望的位置,并且不会产生 ICE07。