Développement web indépendant à Montpellier

Publié le mardi 30 juillet 2013 13:10:36

Inclure des polices personnalisées en CSS

Il est loin le temps où l'on avait qu'un choix restrictif de polices à utiliser sur le net. Maintenant on peut plus ou moins utiliser les polices que l'on souhaite grâce à CSS3 et l'instruction @font-face décrite depuis  un bail mais implémenté récemment dans les navigateurs.

Avant, on utilisait Sifr (en flash) ou d'autres techniques Javascript. (cufon etc...)

Vous avez déjà un choix intéressant de police sur Google Fonts, mais vous il est également possible d'héberger votre propres polices. Une démo ici : http://demo.ligams.free.fr/fonts/

La théorie

En CSS, déclarez simplement votre police, puis appliquez le style, ici pour h1 :

 @font-face {
    font-family: "PolicePerso";
    font-weight: normal;
    src: url('PolicePerso.ttf');
}
h1 {
    font-family: "PolicePerso";
}

La pratique

Ce serait trop facile ! en réalité tous les navigateurs n'apprécient pas forcément TTF (truetype), notamment les anciennes versions d'Internet Explorer (Internet Explorer 10 c'est bon, mais pas avant).

Il faut servir aux vielles version d'IE un format opentype EOT. Si vous ne disposez pas de cette police au format EOT,  vous pouvez facilement convertir vos polices TTF en EOT.

Modification de la CSS :

 @font-face{ 
     font-style:normal; 
     font-weight: normal;
     font-family:'PolicePerso'; 
    src: 
    url('PolicePerso.eot?') format("embedded-opentype"),
    url('PolicePerso.ttf') format("truetype");
}
h1 {
    font-family: "PolicePerso";
}

Notez la présence du point d'interrogation derrière l'URL de la police Opentype, ce n'est pas une coquille. Ne l'oubliez pas.

En faisant ainsi, vous afficherez votre police à partir de la version 5.5 d'Internet Explorer.

Notez cet article !

  • Actuellement 4.5 sur 5 étoiles
  • 1
  • 2
  • 3
  • 4
  • 5

Note : 4.7/5 (6 notes attribuées)

Merci d'avoir participé !

Vous avez déjà noté cette page, vous ne pouvez la noter qu'une fois !

Votre note a été changée, merci de votre participation !

Bonne résolution ! j'arrête d'alourdir mes pages avec des boutons de partage, mais vous pouvez continuer de partager :-)

Commentaires

  1. Owen | Thanks a lot for sharing |

    Thanks a lot for sharing us about this update. Hope you will not get tired on making posts as informative as this.

  2. Thank you for taking the time to publish this information very useful!

  3. DSASD | ketogenic diet weight loss |

    You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!.

  4. ADSad | treatment hemorrhoid bowel |

    Hi! Thanks for the great information you have provided! You have touched on crucuial points!

  5. rentyoura... | rentyouraccount.com review |

    Hello! I just wish to give an enormous thumbs up for the nice info you've got right here on this post. I will probably be coming back to your weblog for more soon!

  6. Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return.

  7. pharmaceu... | pharmaceutical hcg drops |

    Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up.

  8. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,..

  9. DASF | treatment for hemorrhoids |

    You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!!

  10. So luck to come across your excellent blog. Your blog brings me a great deal of fun.. Good luck with the site.

  11. earn mone... | earn money by playing games on facebook |

    This is my first time visit here. From the tons of comments on your articles.I guess I am not only one having all the enjoyment right here!

  12. I'm hoping you keep writing like this. I love how careful and in depth you go on this topic. Keep up the great work

  13. wedding p... | wedding photographer blog |

    When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your.

  14. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.

  15. claire | tutos |

    C'est toujours intéressant de choisir sa typographie pour donner de la vie à son texte .Super à vous de partager votre expérince avec vos tutos

  16. I read that Post and got it fine and informative. Please share more like that...

  17. Alfie | This article is simple to see without |

    This article is simple to see without departing out any specifics and enjoy. Excellent work! You finished particular factors that were trusted there try this web-site . I discovered almost all individuals may accept your site and did a research about them.

  18. DASDAS | sinusitis sinus problems |

    Very useful info. Hope to see more posts soon!.

  19. Dsasda | treatment of internal hemorrhoids |

    Admiring the time and effort you put into your blog and detailed information you offer!..

  20. XASDASD | Natural supplements for ED |

    Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing

  21. This is a good post. This post gives truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. Thank you so much. Keep up the good works.

  22. Great post, you have pointed out some excellent points, I as well believe this is a very superb website.

  23. William | I am very much pleased |

    I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article.

  24. Thanks so much for this information. I have to let you know I concur on several of the points you make here and others may require some further review, but I can see your viewpoint.

  25. ZdSDASD | external hemorrhoid treatment |

    I am very happy to discover your post as it will become on top in my collection of favorite blogs to visit.

  26. well the thing is that tmy nod di on fht ewieldes thting in dion

  27. Good article, but it would be better if in future you can share more about this subject. Keep posting.


  28. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us.

  29. Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you propose starting with a free platform like WordPress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any suggestions? Many thanks!

  30. [url=http://...ooming.us/]dog grooming[/url]
    <a href="http://...ot;>dog grooming</a>
    Dog grooming is good ,I would even say great website ,thanks!
    This post I liked ,because all concisely,clearly,cool!

  31. edwardmar... | Nursing Coursework Help |

    I personally like your post, you have shared good article. It will help me in great deal.

  32. brazilian... | brazilian weave wholesale distributors |

    Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.

  33. I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy.

  34. sexual pr... | sexual problems in females |

    Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next..

  35. Please continue this great work and I look forward to more of your awesome blog posts.

  36. I have a hard time describing my thoughts on content, but I really felt I should here. Your article is really great. I like the way you wrote this information.

  37. Love what you're doing here guys, keep it up!..

  38. Nice blog. Found this while searching through
    <a href="http://...</a>
    [url=http://...ly/1bdDlXc]google.[/url]

    http://...ly/1bdDlXc

  39. That is very helpful for increasing my knowledge in this field.

  40. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again.

  41. midwest i... | <a href="http://imb-online.net/need-buy-midwest-dog-crates/">midwest icrate vs life stages</a> |

    I have been checking out a few of your stories and i can state pretty good stuff. I will definitely bookmark your blog

  42. <a href="... | midwest icrate vs life stages |

    Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return.

  43. midwest i... | midwest icrate vs life stages |

    If you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you.

  44. iOS Mobil... | iOS Mobile Application Development ServiceC |

    I genuinely appreciated understanding it. Sitting tight for some more incredible articles like this from you in the nearing days

  45. Science Channel’s are giving a complete knowledge to its viewers about every thing students write done dissertation on this subjects and show its importance.

  46. I appreciate your efforts in preparing this post. I really like your blog articles.

  47. I genuinely appreciated understanding it. Sitting tight for some more incredible articles like this from you in the nearing days

  48. No doubt! It will be truly hard enrolling! I wish you good fortunes!

  49. Well thanks for posting such an outstanding idea. I like this blog & I like the topic and thinking of making it right.

  50. Globaliza... | Globalization of Hyatt Place Case Solution |

    I need to offer a go-ahead for such an educational post....its truly astonishing

  51. affordabl... | affordable website design pakistan |

    Pretty helpful material, much thanks for this article

  52. the amazi... | the amazing spider man game |

    Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!

  53. There is definately a great deal to know about this subject. I like all of the points you've made.

  54. I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts.

  55. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Great work

  56. The article posted was very informative and useful. You people are doing a great job. Keep going.

  57. This was among the best posts and episode from your team it let me learn many new things.

  58. Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog.

  59. Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!!

  60. Cette css code est tres util,merci beacoup.

  61. cologne f... | cologne for men with pheromones |

    Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many.

  62. [url=http://...ooming.us/]dog grooming[/url]
    <a href="http://...ot;>dog grooming</a>
    This post I liked ,because all concisely,clearly,cool!
    I really liked this website ,it is very clearly set out information.

  63. Wow, cool post. I’d like to write like this too – taking time and real hard work to make a great article… but I put things off too much and never seem to get started. Thanks though.

  64. This is also a very good post which I really enjoy reading. It is not everyday that I have the possibility to see something like this.

  65. I must say, I thought this was a pretty interesting read when it comes to this topic. Liked the material. . . . .

  66. Top elect... | Top electric scooter for teen |

    It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing.

  67. Thank you for the post. I will definitely comeback.

  68. pheromone... | pheromone additives for men |

    Nice knowledge gaining article. This post is really the best on this valuable topic.

  69. Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!..

  70. This was really an interesting topic and I kinda agree with what you have mentioned here!

  71. interraci... | interracial dating sites |

    I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts.
    <a href="http://...nterracial dating sites</a>

  72. The Year... | The Year of Beautiful Uncertainty |

    You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!
    <a href="http://...ot;>The Year of Beautiful Uncertainty</a>

  73. Penguin R... | Penguin Run Saga, Cartoon |

    Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people..
    <a href="http://...gt;Penguin Run Saga, Cartoon</a>

  74. Genetic t... | Genetic testing technology |

    Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people..

  75. Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have.

  76. Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up.

  77. handmade... | handmade childrens clothes |

    Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.

  78. I know your expertise on this. I must say we should have an online discussion on this. Writing only comments will close the discussion straight away! And will restrict the benefits from this information.

  79. prostheti... | prosthetic eye infection |

    i really like this article please keep it up.

  80. thanks for the tips and information..i really appreciate it..

  81. dfffffffffffffffffffffffff

  82. malditabr... | malditabratinella.blogspot.com |

    You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!

  83. best appe... | best appetite suppressant teas |

    Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have.

  84. fiber gum... | fiber gummies for weight loss |

    Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic.

  85. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..

  86. Good information! It has long been looking for. Thanks to the author
    http://...torbmi.org

  87. New web site is looking good. Thanks for the great effort.

  88. Crossvill... | Crossville's Roofing Reviews |

    Great Article it its really informative and innovative keep us posted with new updates. its was really valuable. thanks a lot.

  89. Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people..

  90. This article gives the light in which we can observe the reality. This is very nice one and gives in depth information. Thanks for this nice article.

  91. This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog..

  92. austin we... | austin wedding photo booth rental |

    Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.

  93. Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article.

  94. Wonderful blog post. This is absolute magic from you! I have never seen a more wonderful post than this one. You've really made my day today with this. I hope you keep this up!

  95. I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!

  96. ironmaste... | http://www.asamilwaukee.org/best-adjustable-weight-bench-options/ |

    I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog!

  97. This is really thanks a lot for visiting the nice info that to utilize the different services in this blog. It was really useful info.

  98. Useful info is visible in this blog that to helpful technology in this blog.

  99. Thanks a lot for using the amazing services in this blog and the lot of technology is visible in this blog.

  100. This is very much impressed with this blog and the providing the lots of posts are display in this blog.

  101. Thanks a lot for using the amazing presentation and view is also very cool for this website.

  102. I am really satisfied y the great info is visible I this blog that to sharing the nice technology is visible in this blog.

  103. I am really satisfied by the great approach is visible in this blog and thanks a lot for using the great info is visible in this blog.

  104. This is very much happy for providing the amazing technology is visible in this blog.

  105. Thanks a lot for using the amazing technology in this blog that to utilize the nice technology in this blog.

  106. This is really satisfied y the great info is visible in this blog and the really inspired by the great info is visible in this blog.

  107. Thanks a lot for using the nice technology in this blog and the nice approach in this blog.

  108. I am very much enjoyed for the great approach is visible in this blog that to sharing the amazing services in this blog.

  109. This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses.

  110. dfdsfd | best seo for law firms |

    The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface.

  111. stevenjhok | technology is visible in this blog |

    Frequently I am searching the great info is visible in this blog and the nice services in this blog.

  112. stevenjhok | info is visible in this blog |

    I had really like it very much for using the nice services in this blog. This is very much satisfied by the different technology is visible in this blog and thanks a lot for using the nice interesting info is visible in this blog.
    http://...free.co.uk

  113. The great services are visible in this blog and the nice technology is visible in this blog. I am really like it very much for using the great services in this blog and the different services are display in this blog.

  114. Please continue this great work and I look forward to more of your awesome blog posts.

  115. This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post.

  116. No doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post.

  117. curso de... | curso de excel avançado |

    I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information.

  118. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!

  119. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well..

  120. I really enjoyed reading this post, big fan. Keep up the good work and please tell me when can you publish more articles or where can I read more on the subject?

  121. I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing.

  122. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks...

  123. Super article pour mon annuaire généraliste

  124. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for.

  125. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!

  126. Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!!

  127. League Ci... | League City carpet cleaners |

    I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,..

  128. Toujours un peu de mal avec le code, on va essayer çà :)

  129. Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.

  130. http://ww... | http://www.friv5online.com/ |

    Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work.

  131. Merci beaucoup pour ce tuto très réussi, je cherchais justement à savoir comment faire mais je galère un peu avec le CSS haha

  132. RV Dealer... | RV Dealer in Carthage Missouri |

    hello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community.

  133. I found a good Website with telephone numbers for customer service http://...r-service/

  134. This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog..

  135. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post.

  136. edu and g... | edu and gov backlinks for seo |

    Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read.

  137. I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information.

  138. Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people..

  139. I found a good Website with telephone numbers for customer service
    http://...r-service/

  140. sell stru... | sell structured settlements |

    I am very much pleased with the contents you have mentioned. I wanted to thank you for this great article.

  141. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.

  142. I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing.

  143. I would like to say that this blog really convinced me to do it! Thanks, very good post.

  144. Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.

  145. medical c... | medical cannabis guardianships |

    Thanks for sharing the info, keep up the good work going.... I really enjoyed exploring your site. good resource...

  146. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging,

  147. My friend recommended this blog and he was totally right keep up the good work

  148. Amazing article thanks or sharing..

  149. normal and relevant information with phone numbers of support services found only here
    http://...00-number/

  150. I searched many information this disease on the Internet, because it is very unpleasant disease and embarrassed to talk about it, and then found a lot of useful information
    http://...rhoid.com/

  151. for lovers of dogs, found a cool rock, big and beautiful, here on the site there is a photo and a story about it
    http://...ardog.net/

  152. C'est génial de rencontrer un blog de temps en temps qui n'est pas le même
    De la date rehashed matériel. Grande lecture!

  153. Thanks for the great post. I’m a big fan of your writing style. I will comeback and read all the other articles you posted

  154. I found a good Website with telephone numbers for customer service http://...r-service/

  155. canewilia... | Dissertation Writing Service |

    I personally like your post, you have shared good article. It will help me in great deal.
    <a href="http://...>Thesis Writing Help</a>

  156. Physical... | Physical Layer Project Help |

    Amazing article thanks or sharing..

  157. do my com... | do my computer science homework |

    My friend recommended this blog and he was totally right keep up the good work

  158. online mb... | online mba dissertation writing service |

    This was a great and interesting article to read. I have really enjoyed all of this very cool information

  159. I personally like your post; you have shared good insights and experiences. Keep it up.

  160. I'm getting excited about this kind of beneficial information of your stuff in the future

  161. Mechanica... | Mechanical Engineering Project Help |

    I loved the way you discuss the topic great work thanks for the share.

  162. I found a wonderful site, and there is a cool breed of http://...kyinfo.net

  163. We're the most effective online games website

  164. Solitary gamer and multiplayer game

  165. for lovers of dogs, found a cool rock, big and beautiful, here on the site there is a photo and a story about it

  166. normal and relevant information with phone numbers of support services found only here

  167. I searched many information this disease on the Internet, because it is very unpleasant disease and embarrassed to talk about it, and then found a lot of useful information

  168. Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people.

  169. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging.

  170. Fine post. Thanks, I ll follow the next one. Useful and interesting information

  171. Admirer le dévouement que vous mettez dans votre site et en profondeur des informations que vous présentez.
    C'est génial de rencontrer un blog de temps en temps qui n'est pas le même
    De la date rehashed matériel. Grande lecture!

  172. This is really good idea. Thanks for sharing!

  173. Well thanks for posting such good content and I appreciate your efforts to download
    <a href="https:/...;Blackmart Alpha Apk</a>
    <a href="http://...;Blackmart Alpha Apk</a>
    <a href="http://...;Blackmart Apk Download</a>

  174. CSS3 n'a cessé de nous étonner surtout avec la fonctionnalité @font-face. Merci pour les codes mentionnés.

  175. lomazz55@... | loma |

    Play Free online Flash Games on your PC

    http://...gamers.net
    http://...gossip.net
    http://...eels.ninja

    more fun playing your favorite flash game

  176. C'est une fonction que j'utilise tous les jours, je suis devenu un vrai maniaque de la typographie. Mais c'est vrai que cela peut changer une page web du tout au tout, donc c'est à connaitre.

  177. Globaliza... | Globalization of Hyatt Place Case Solution |

    I cherished the way you talk about the point awesome work much obliged for the share Your useful post.

  178. Thank you, I've been seeking for info about this subject matter for ages and yours is the best I have discovered so far

  179. Merci pour ce tuto.

  180. Très utile, merci beaucoup chef

  181. J'apprends le CSS3 en ce moment, et vous m'avez fillé un bon coup de main dans ma recherche !
    Merci.

  182. Juste pour info et pour faire un peu de la pub...
    En SASS avec le framework Compass ça donne:

    @import compass/css3

    +font-face("PolicePerso", "PolicePerso.ttf", "PolicePerso.eot")

    .h1
    font-family: "PolicePerso"

    --
    :D

  183. Zakia | comparer les banques |

    CSS3 n'a cessé de nous étonner surtout avec la fonctionnalité @font-face. Merci pour les codes mentionnés.