Tuesday, February 5, 2008

Issues regarding the fonts

Hi to All again...........
Well most of the web developers face some problems while displaying the fonts (regional language) in the webpages as generally they go for the true type font.

So here is the problem that they are using true type font.

Generally when we go for some true type font those fonts wont dispaly in the webpage unless you have those fonts installed on the system on which you want to view the webpage.
There are two ways to get those fonts installed on the user system............
1.Ask the user ....if he is having some problem viewing the webpage..........
and link this text to somewebpage..........

Provide the user with manual and automatic font installation
Manual Installation

Fisrt place all those fonts in the one folder zip the folder
and place the folder somewhere on the server and simply provide the link to the zip file on the server.Ask the user to download and get it installed on the system by unzipping it and placing the fonts file in the fonts folder on the system.
With that fonts will start displaying in the webpage.

Automatic Installation

To create the automatic font installer
Download the Inno Setup from
http://www.jrsoftware.org/isdl.php
Open new file and run the following scipt
------------------------------------Starts here-------
; -- Example1.iss --
; Demonstrates copying 3 files and creating an icon.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

[Setup]
AppName=XYZFonts
AppVerName=XYZFonts 1.0
DefaultDirName={pf}\XXXFonts
DefaultGroupName=Font Lathas
UninstallDisplayIcon={app}\uninst.exe
Compression=lzma
SolidCompression=yes
OutputDir=userdocs:Inno Setup Examples Output]
WizardImageFile=E:\setup.bmp
WizardSmallImageFile=E:\setup_2.bmp
SetupIconFile=E:\favicon.ico
Uninstallable=no

[Files]
Source: "Gautami.ttf"; DestDir: "{win}\fonts\"; Flags: onlyifdoesntexist
Source: "latha.ttf"; DestDir: "{win}\fonts\"; Flags: onlyifdoesntexist
Source: "Tam_barn.ttf"; DestDir: "{win}\fonts\"; Flags: onlyifdoesntexist


[Icons]
;Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"


;----------ends here---------------------------------------------------

AppName=XYZFonts
AppVerName=XYZFonts 1.0
DefaultDirName={pf}\XXXFonts
DefaultGroupName=Font Lathas

Here AppName is the name you wold like to give to your fonts installer
AppVersion is the version of the installer. The DefaultDirName is the name of the directory where you will find some installation and uninstallaion files

UninstallDisplayIcon={app}\uninst.exe -->It is the uninstallation file name
Compression=lzma -->Compression technique
SolidCompression=yes -->Compression Option
OutputDir=userdocs:Inno Setup Examples Output -->path where installer will be placed
WizardImageFile=E:\setup.bmp -->bmp format file that will appear on the installer
WizardSmallImageFile=E:\setup_2.bmp -->again .bmp format file [smaller icon]
SetupIconFile=E:\favicon.ico -->icon for the installer
Uninstallable=no -->I have return uninstallation as no because if you uninstall the fonts sometime it may create problems


[Files]
Source: "Gautami.ttf"; DestDir: "{win}\fonts\"; Flags: onlyifdoesntexist
Source: "latha.ttf"; DestDir: "{win}\fonts\"; Flags: onlyifdoesntexist
Source: "Tam_barn.ttf"; DestDir: "{win}\fonts\"; Flags: onlyifdoesntexist

As you can understand from the above line we are simply specifing the files that you need to install on the user system.
So Innoset will get the gautami.ttf file from the system current location while creating the installer and place it in the windows/fonts/ folder at the time of installation...and Flags: onlyifdoesntexist specifies that install those files only when it is not available on the system.......

These are the two methods for installation of fonts on the user ssytem...In the above method user has to undergo some procedure to install the fonts on the user system........
But you dont want get user involver into all these stuff
Then you can generate the Embeded Open type(.eot)files for your webpages.......
But this technique has some drawback that it works with IE only.........
Otherwise You can go for Portable Font Resourse as works IE and Firefox but this technology is actually outdated and very few people are using it.


So the best Solution to this is go for OpenType font it will save you from all types of headache........
As if the OpenType fonts that you are using if it is not available on the user system ...automatically it will get covert into some other openType font available on the uaer system........
Have a gr8 time


At the end my nerd score

I am nerdier than 64% of all people. Are you a nerd? Click here to find out!