manix Posted July 8, 2011 Share Posted July 8, 2011 Hey, I googled that topic just about now and found a tutorial that seemed to be pretty accurate but too complicated at the same time so I couldn't understand much. My next option is asking you ^^ How can I have a custom font in my website ? Obviously the user has to download it the first time he loads the site, but how do I do that? Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/ Share on other sites More sharing options...
Zane Posted July 8, 2011 Share Posted July 8, 2011 <br /> @font-face {<br /> font-family: "Custom Font"; /* This is what you name your custom font */<br /> src: url(custom-font.ttf); /* This is where you put the path to your font */<br /> }<br /> .customtext {<br /> font-family: "Custom Font"; /* This is how you apply the font. */<br /> color:red;<br /> }<br /> Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1240256 Share on other sites More sharing options...
manix Posted July 8, 2011 Author Share Posted July 8, 2011 Ok that worked for the first font I used but then I just replaced the file from the htdocs with another one and it stopped working ... O.o EDIT: I used the same name ofc Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1240279 Share on other sites More sharing options...
Zane Posted July 8, 2011 Share Posted July 8, 2011 you have to refresh your cache Ctrl + F5 Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1240280 Share on other sites More sharing options...
manix Posted July 8, 2011 Author Share Posted July 8, 2011 omg I know I refresh it all the time, it just displays the default font.. Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1240281 Share on other sites More sharing options...
Zane Posted July 8, 2011 Share Posted July 8, 2011 hmmm.. and your sure that it has the same filename? Or better yet, post your code.. just the font style part. Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1240282 Share on other sites More sharing options...
manix Posted July 8, 2011 Author Share Posted July 8, 2011 @font-face { font-family: "Fonta"; src: url(Fonta.ttf); } a.navmenu:link,a.navmenu:visited { font-family: Fonta; ... } <li><a class="navmenu" href="home.php">Начало</a></li> and it worked perfectly with the first font I used (placed the 'Fonta.ttf' in the htdocs) and then I downloaded another one and just replaced the old one and it's not working anymore.. ps. the font has cyrillic characters if that's what you're thinking the problem is Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1240284 Share on other sites More sharing options...
JKG Posted July 11, 2011 Share Posted July 11, 2011 Get your font file, upload it to Font Squirrel. Its really good and exports your font into all web formats. It gives you a download zip with everything in it to copy and paste into your css/html. http://www.fontsquirrel.com/fontface/generator Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1241329 Share on other sites More sharing options...
stublackett Posted July 13, 2011 Share Posted July 13, 2011 Get your font file, upload it to Font Squirrel. Its really good and exports your font into all web formats. It gives you a download zip with everything in it to copy and paste into your css/html. http://www.fontsquirrel.com/fontface/generator Or keep the font face and convert it to Cufon. http://cufon.shoqolate.com/generate/ As another option, Works a treat for me Quote Link to comment https://forums.phpfreaks.com/topic/241443-custom-font/#findComment-1242208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.