Installing a font with Wix not to the local font folder

后端 未结 4 1246
醉酒成梦
醉酒成梦 2021-02-07 04:17

I am using Wix to create an installation for a website.

When adding a font, WiX picks up on the .ttf extension and requires you to install it to the local Font folder (W

4条回答
  •  逝去的感伤
    2021-02-07 04:47

    For the specific case of bootstrap glyphicons_halflings.ttf font which drops into the fonts folder of the website by design this solution works without supressing ICE07 warnings:

    Because you will also be installing the matching woff, eot, and svg webfonts at the same time, you can specify that the TTF file has a companion file and is not a TrueType font.

    If you naively just create a WiX fragment to add the Halflings font files to your sites fonts folder like this: (replace the partial GUIDs as needed)

    
    
        
            
                
                    
                    
                    
                
                
                    
                
         
    
    

    It will add the files to the correct location but building your solution will produce an ICE07 validation warning bemoaning the fact that a TTF font file must go in the Windows Font folder.

    Given this is a web font and is not supposed to go there that's very annoying, but thankfully because it is a web font you need it in many formats to appease IE, Edge, Chrome, Firefox, etc... that means you can make use of the presence of the non TTF font variants to eliminate the warning.

    Refactor the fragment like this:

    
    
        
            
                
                    
                    
                    
                
                
                    
                
            
        
    
    

    Here we deny its a TTF font, and provide it with a companion file that is one of the other web font files. Everything installs where you expect and no ICE07 is produced.

提交回复
热议问题