PDA

View Full Version : How does SB know if a font already exists?



NewsArchive
01-13-2009, 01:29 AM
Hi Folks

If I've got a font I need to install how does SB check if its exists at the
moment? Is a simply a case of seeing if the font file name exists in the
fonts folder or are there any other checks SB does?

I've got a problem where a font needs to install itself (havent established
OS from customer yet) but its not installing it so just wanted to check some
basics first.

--
--
Cheers
Richard

NewsArchive
01-13-2009, 01:30 AM
Hi Richard,

> If I've got a font I need to install how does SB check if its exists at
> the moment? Is a simply a case of seeing if the font file name exists in
> the fonts folder or are there any other checks SB does?
>
> I've got a problem where a font needs to install itself (havent
> established OS from customer yet) but its not installing it so just wanted
> to check some basics first.

You can use the "Check Font..." function to determine whether a particular
font is installed.

SetupBuilder itself does a file exist check during the font install.

Similar to:

If %FONTSDIR%\VERDANA.TTF File or Folder exists Then
Display Message Box "Verdana.ttf does exist!" -- ""
End

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
01-14-2009, 01:25 AM
Hi Friedrich

Ok I might have found a problem then. <g>

Scenerio is this.

Copy a font file from windows/font onto your desktop, give it a unique name
so the physical file name doesnt exist in the font folder and then copy it
back to windows/font folder. Vista will ask you if you want to replace the
font, yet the filenames are different so it must be picking up something
like an ID from within the Font file.

Now this is the problem I need to check if the font exists but it will
always have a different filename becuase its come from a font website so is
using their name. As it happens I have named the physical file the same as
the one that might be already installed in windows but its still replacing
them and seems to be always installing.

Is there anyway we could check the internal Font ID Windows is using?

Cheers

Richard

NewsArchive
01-14-2009, 01:25 AM
Hi Richard,

Windows uses the "typeface name" here. This typeface name is also used in
"Check Font...".

To be honest, I don't know if there is any API that can resolve the font
resource from the table back to the physical filename. But the filename can
be found in the Registry.

Theoretically (not tested! <g>), it should be possible for you to use "Check
Font..." to determine whether a particular font is installed. If this is
the case (and you would like to install a new one), scan the "Font" registry
key to retrieve the physical filename of the font. Then remove the registry
key and use the "RemoveFontResource" Windows API. After that, reinstall the
font.

What do you think?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
01-14-2009, 01:26 AM
Hi Richard,

BTW, would it be possible to send me some of the font files so I can play
with it?

Thanks,
Friedrich