Jump to content


Photo

fonts in php


  • Please log in to reply
8 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 August 2006 - 08:19 PM

if make a folder fonts and get a good font how do i add the font to use it cheers.

eaxmaple

now how to get the font to be a working font cheers.
<?php

$fonts="fonts/";

$message="my name is redarrow";

$result=$message&$font;

echo $result;

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 17 August 2006 - 08:25 PM

The browser, which is running on the user's PC, only has access to fonts on that user's PC. IF you want to display using fonts from the server you need to put the text in an image.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 August 2006 - 08:26 PM

can you kindly show me an example please and were to get the font from cheers.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 17 August 2006 - 08:35 PM

Well, the last time you asked me for an example was for a calendar script. When I had time (a couple of hours, and not the 10mins you believed) I wrote and then posted the script and sent you a PM to tell you it was there. As I never received any acknowledgement for my efforts, you are a liitle low on credit for my time.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 August 2006 - 08:41 PM

i didnt even know you sent the calender code thank you so much sorry about not responding thank you.

i have only looked now and cheers sorry for late reply cheers agin.

very cleaver code for the cal cheers grate.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#6 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 17 August 2006 - 09:46 PM

You can use FontFreaks and can find some nice free ttf fonts. I am sure that you already know how to use a font in an image, right?


Good luck,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 August 2006 - 10:22 PM

not yet please help sorry.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#8 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 17 August 2006 - 10:36 PM

There are some posibilities in regard to embeding fonts in html, but really, this has nothing to do with php.

#9 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 17 August 2006 - 11:47 PM

you can 'force' the font to be downlaoded!

Now I tried this a while back and it only worked in IE at the time but some reading did indicate that other browsers would take it up.....

You will need to get the MS WEFT tool (http://www.microsoft...mbedding/weft3/)

create an .eot file from teh font you need.

in your css put the following

@font-face { font-family: "New Font"; src: url(http://www.ursite.com/font/newfont.eot); }

New Font can be anything you want of course - you will define that....

NOW any text on your site that you wish to use that font on ( example here is a title header)
the html....

<h1 id="title">YOUR TITLE</h1>

the css...

h1#title { font-family: "New Font", Verdana, sans-serif; }

When a user visits the page and the don't have 'New Font' the page will display in the next font in the list BUT as soon as the font has been downloaded the page will refresh with your new font - and shoudl be cached for the next time they visit....


follow me on twitter @PHPsycho




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users