Font Installtion

Got a problem you cannot solve? Try here.
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Font Installtion

Postby jimo » Tue Aug 30, 2005 6:31 pm

How do I install a custom font on the target system?

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Wed Aug 31, 2005 6:16 am

Copy files into $WINDIR$\\Fonts

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Wed Aug 31, 2005 9:25 am

Yes, but isn't there a command to install/register fonts, or should I force a reboot?

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Wed Aug 31, 2005 9:31 am

No, just copying the font files should be fine, I believe.

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Wed Aug 31, 2005 3:18 pm

Copying does not work,

I read this in the winodws installer documentation:
Windows Installer
Font Table
The Font table contains the information for registering font files with the system.


The Font table has the following columns.

Column Type Key Nullable
File_ Identifier Y N
FontTitle Text Y



Columns


File_
External key into the File table entry for the font file. It is recommended that the component containing the font file have the FontsFolder specified in the Directory_ column of the Component table.
FontTitle
Font name. It is recommended that you leave this column null for TrueType Fonts and TrueType Collections because the installer can register the font after reading the correct font title from the font file. If the font name is entered, it must be identical to font title from the font file. You must specify a title for fonts that do not have embedded names, such as .fon files.

Remarks

This table is referred to when the RegisterFonts action or the UnregisterFonts action is executed.

If the FontTitle field is left Null, the Font name is read directly from the font file specified. If the font name recorded into the FontTitle field differs from the internal font name recorded in the font file, the font is registered twice by the RegisterFonts action.

Font files should not be authored with a language ID, as fonts do not have an embedded language ID resource.Thus the Language column of the File table should be left null for font files.

Because the installer does not refcount font files by default, preexisting font files may be removed with their component when uninstalling an application. To ensure that a font file is not removed, authors may set the msidbComponentAttributesSharedDllRefCount or msidbComponentAttributesPermanent bit flags in the Attributes column of the Component Table_msi_Component_Table for the component containing the font file.


It seems that windows installer has a method for this, can this functionality be exposed?

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Wed Aug 31, 2005 3:23 pm

The corresponding Windows Installer standard action would be RegisterFonts

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Thu Sep 01, 2005 8:45 am

Thank you for reporting this.

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Thu Sep 01, 2005 9:58 am

Please paste this code into your setup script - it contains the necessary API calls to register (and, optionally unregister) a font that has been copied over.

Code: Select all

~InstallAWARE Clipboard Data~
~Call DLL Function~
~{12574AA8-AF82-4E0B-86BB-1B5559164412}~
~gdi32.dll,RemoveFontResourceA,bool,,"pointer to string",$TARGETDIR$\\font.ttf,$~
~mIDEFunc.dll\\mEXEFunc.dll~
~Comment~
~{D716ED65-395B-488D-9DAB-A9BF18864D53}~
~Remove Font File~
~Call DLL Function~
~{48537E1C-E3F3-4F71-B09E-7F9754079EC0}~
~user32.dll,SendMessageA,long,,"double word",4294967295,"double word",29,"double word",0,"double word",0,$~
~mIDEFunc.dll\\mEXEFunc.dll~
~Comment~
~{361C97BD-6316-4EBC-A7B4-16C1D9215DF7}~
~Send WM_FONTCHANGE Message~
~Call DLL Function~
~{909CB40B-4E18-48D7-B3D7-A9B4209A04D3}~
~gdi32.dll,AddFontResourceA,long,,"pointer to string",$TARGETDIR$\\fontfile.ttf,$~
~mIDEFunc.dll\\mEXEFunc.dll~
~Comment~
~{444DD43F-C304-452B-9A71-FD416C2AF57F}~
~Add Font File~

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Thu Sep 01, 2005 10:07 am

Does the SendMessage call have to be placed after the UnRegister call in the uninstall sequence?

By the way, great response time, I really appreciate you guys.

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Fri Sep 02, 2005 4:56 am

I think you would only unregister during an uninstall, before Apply Uninstall is called, to deregister the fonts from the system.

And, you would register each font (or unregister each font), and then you would call the Send Message WinAPI at the end of the entire (un)registration sequence, to broadcast to applications the font table changes.

Thanks for your kind words - please help spread the word on InstallAware!

casic
Posts: 260
Joined: Thu Mar 17, 2005 4:02 am
Location: Germany
Contact:

Plugin for font installation available

Postby casic » Sat Jan 07, 2006 3:30 pm

Hi,

I developed a plugin for easy and save font installation (Freeware!). More information is available here: http://www.installaware.com/forum/viewtopic.php?t=480.

cu

Markus

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Tue Jan 17, 2006 3:20 pm

Works great thanks! Love your other plugins as well!


Return to “Technical Support”

Who is online

Users browsing this forum: Baidu [Spider] and 140 guests