Welcome Guest, Not a member yet? Register   Sign In
How to use different font in codeigniter
#1

[eluser]Roy MJ[/eluser]
Hi everyone,

I have come across a problem where my client needs a different font. I have uploaded the font script in the fonts folder. But how can i call the new font is the css file..??
#2

[eluser]Devon Lambert[/eluser]
I don't believe the font has anything to do with CI. Rather, fonts are handled by the front end and are dependent upon the end user's font selection. However, there are a variety of ways to enable a specific font for an end user.

i.e. font-face, cufon, sifr, etc...

In my personal opinion, I would go with Font-Face as it seems to be the most cross browser, and easy to setup/use option. The only downside being that you have to host and provide the font file, unless you decide to make use of a service like TypeKit OR Google's Font Directory.

The guys over at Nettuts have come up with an excellent way of enabling fonts in the best cross browser fashion.

Hope this helps.
#3

[eluser]Roy MJ[/eluser]
Yes i have separate font file to upload... But what i am asking is how can i make it available in css file.. ? Is it possible to get the font into css or to client side so that particular portion of certain pages in the website is in the new font whereas others are of normal type which v do though css file.
#4

[eluser]Roy MJ[/eluser]
The tutorial uve given is helpful only till converting the font to the required type and i am having that myself. Its talkin abt java while im using php. Have u embedded any font in ur projects??
#5

[eluser]Devon Lambert[/eluser]
[quote author="Roy MJ" date="1298897374"]The tutorial uve given is helpful only till converting the font to the required type and i am having that myself. Its talkin abt java while im using php. Have u embedded any font in ur projects??[/quote]

Hey Roy,

Yes I have, and this is the exact same tutorial I used to do it. I think you may be getting confused here. Fonts have nothing to do with your back end per se. In other words you just need to use the proper front end code, system, flash, javascript, etc.. to make them work.

The tutorial I provided walks you step by step on how to do this for font-face. which I believe is the CSS solution you are after. You should read it in detail.

Here's a quick cheat sheet for the declaration of the fonts in your stylesheet/css file.
Code:
@font-face{
font-family: 'your-font-name';
src:
  url('../path/to/your-font-name.eot?') format('eot'),
  url('../path/to/your-font-name.woff') format('woff'),
  url('../path/to/your-font-name.ttf') format('truetype'),
  url('../path/to/your-font-name.svg#font') format('svg');

Once this declaration is in place you would simply make use of it in your styles by calling

Code:
font-family: 'your-font-name', Arial, Serif;

The tutorial provides more information in greater detail but hopefully you get the gist.
#6

[eluser]Roy MJ[/eluser]
Sorry for the silly questions cuz this is my first attempt.. The name of the font file is BRADHITC_0.ttf

the format would be

@font-face{
font-family: 'BRADHITC_0';
src: url('../path/to/BRADHITC_0.ttf') format('truetype')
}

Is the font-family correct??... Inside the file its written Bradley Hand ITC. Should i replace
font-family: 'BRADHITC_0'; with font-family: 'Bradley Hand ITC';??...
#7

[eluser]Roy MJ[/eluser]
Finally figured out.. In fact it was very easy..Tongue... Jus din no where to call the font ans stuff.. Here is the link which helped me... http://www.netmechanic.com/news/vol3/css_no15.htm




Theme © iAndrew 2016 - Forum software by © MyBB