Difference between revisions of "Fonts"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
(Some Typo and Example for PS Type 1 Fonts)
Line 3: Line 3:
  
  
== basic info ==
+
== Basic info ==
  
 
To install new fonts on a Windows machine, you have to do two things:
 
To install new fonts on a Windows machine, you have to do two things:
Line 10: Line 10:
 
* add a registry entry.
 
* add a registry entry.
  
 +
== Example Batch file ==
  
 
+
An example.bat file would look like this:
== example batch file ==
+
 
+
An example bat file will look like this:
+
  
 
<source lang="dos">
 
<source lang="dos">
Line 22: Line 20:
  
  
== example registry file ==
+
== Example Registry file ==
  
An example registry file will look like this:
+
An example registry file would look like this:
 
<source lang="reg">
 
<source lang="reg">
 
Windows Registry Editor Version 5.00
 
Windows Registry Editor Version 5.00
Line 33: Line 31:
  
  
== example XML file for WPKG ==
+
== Example XML install file for WPKG ==
  
 
<source lang="xml">
 
<source lang="xml">
Line 47: Line 45:
 
</source>
 
</source>
  
== Inno Setup Script ==
+
== Example Inno Setup Script ==
 
Because I had problems with the registry setting I found another way to install fonts by writing an installer. [[Inno Setup]] makes this easy and a script like the following will package a number of fonts into a pseudo-application.
 
Because I had problems with the registry setting I found another way to install fonts by writing an installer. [[Inno Setup]] makes this easy and a script like the following will package a number of fonts into a pseudo-application.
  
Line 71: Line 69:
 
   <upgrade cmd='%SOFTWARE%\font-setup.exe /sp- /silent /norestart' />
 
   <upgrade cmd='%SOFTWARE%\font-setup.exe /sp- /silent /norestart' />
 
</package>
 
</package>
 +
</source>
 +
 +
== Example Inno Setup Script PS Type 1 Fonts==
 +
I tested this with success on Windows XP Machines with PS Type 1 Fonts. Copy the font and add the registry entry in the right section. After a reboot the font is fully installed. Adopt the silent install script for WPKG from above.
 +
 +
<source lang=inno>
 +
[Setup]
 +
AppName=Font Installer
 +
AppVerName=Font Installer 1.0
 +
CreateAppDir=false
 +
DisableProgramGroupPage=true
 +
ShowLanguageDialog=no
 +
 +
[Files]
 +
; FontInstall does not work with my SP3
 +
Source: "BENSCNBL.PFB"; DestDir: "{fonts}"; Flags: onlyifdoesntexist
 +
Source: "BENSCNBL.pfm"; DestDir: "{fonts}"; Flags: onlyifdoesntexist
 +
 +
[Registry]
 +
; Create Registry entrys for the fonts
 +
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Type 1 Installer\Type 1 Fonts"; ValueType: multisz; ValueName: "BentonSansCond Black"; ValueData: "T{break}BENSCNBL.pfm{break}BENSCNBL.PFB"; Flags: uninsdeletevalue
 
</source>
 
</source>
  
 
[[category:Silent Installers]]
 
[[category:Silent Installers]]
 
[[Category: Changing Windows settings]]
 
[[Category: Changing Windows settings]]

Revision as of 14:16, 25 June 2010

This is a silent installer for distributing additional fonts. Always be sure to be entitled to use the fonts you are distributing.


Basic info

To install new fonts on a Windows machine, you have to do two things:

  • copy the font file to %WINDIR%\Fonts\ directory,
  • add a registry entry.

Example Batch file

An example.bat file would look like this:

%COMSPEC% /c copy /Y "%SOFTWARE%\Fonts\*.TTF" "%WINDIR%\Fonts\"
regedit /s "%SOFTWARE%\Fonts\add-fonts.reg"


Example Registry file

An example registry file would look like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Frankfurt Gothic (TrueType)"="FRANKGON.TTF"


Example XML install file for WPKG

<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package id="additional-fonts" name="Additional fonts" revision="1" reboot="false" priority="950" execute="once">

  <install cmd='"%SOFTWARE%\Fonts\add-fonts.bat"' />

</package>
</packages>

Example Inno Setup Script

Because I had problems with the registry setting I found another way to install fonts by writing an installer. Inno Setup makes this easy and a script like the following will package a number of fonts into a pseudo-application.

[Files]
Source: C:\WINDOWS\Fonts\CALIBRI.TTF; DestDir: {fonts}; FontInstall: Calibri; Flags: onlyifdoesntexist uninsneveruninstall
Source: C:\WINDOWS\Fonts\FuturaStd-Book.otf; DestDir: {fonts}; FontInstall: FuturaStd-Book (OpenType); Flags: onlyifdoesntexist uninsneveruninstall fontisnttruetype
...

[Setup]
AppName=Font Installer
AppVerName=Font Installer 1.0
CreateAppDir=false
DisableProgramGroupPage=true
ShowLanguageDialog=no

The package definition would be

<package id="additional-fonts" name="Additional fonts" revision="10" reboot="false" priority="950">
  <check type="uninstall" condition="exists" path="Font Installer 1.0" />
  <install cmd='%SOFTWARE%\font-setup.exe /sp- /silent /norestart' />
  <upgrade cmd='%SOFTWARE%\font-setup.exe /sp- /silent /norestart' />
</package>

Example Inno Setup Script PS Type 1 Fonts

I tested this with success on Windows XP Machines with PS Type 1 Fonts. Copy the font and add the registry entry in the right section. After a reboot the font is fully installed. Adopt the silent install script for WPKG from above.

[Setup]
AppName=Font Installer
AppVerName=Font Installer 1.0
CreateAppDir=false
DisableProgramGroupPage=true
ShowLanguageDialog=no

[Files]
; FontInstall does not work with my SP3
Source: "BENSCNBL.PFB"; DestDir: "{fonts}"; Flags: onlyifdoesntexist
Source: "BENSCNBL.pfm"; DestDir: "{fonts}"; Flags: onlyifdoesntexist

[Registry]
; Create Registry entrys for the fonts
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Type 1 Installer\Type 1 Fonts"; ValueType: multisz; ValueName: "BentonSansCond Black"; ValueData: "T{break}BENSCNBL.pfm{break}BENSCNBL.PFB"; Flags: uninsdeletevalue