Sunday, February 05, 2012

CUFON for Arabic Text: @font-face as a solution

I have seen a lot of people asking how to use CUFON with Arabic fonts and texts. This library is amazing indeed especially that it comes at an early stage when a lot of browsers did not know more than 7-10 generic fonts that people are bored with.

Arabic developers (or right to left developers) were not able to use this library because it does not support complex scripts. There is no intention for further development to cover this language as well as mentioned several times by the lead developer of CUFON.

What is the solution then for an arab developer or designer who would like to give a special touch for his websites? The solution is very easy and handy. @font-face !!! Some fancy examples are found on this page (

How to use it with Arabic text? The solution is very simple:
@font-face {
  src: source url;
  [font-style:regular html style];
The major task is to select a nice TTF (or even OTF) font that you like and link it to the new font-family that you define (Some fonts needs to be converted to EOT though)


The html code for this example:
<title>كيفية استخدام font-face مع اللغة العربية على الانترنت</title>
<link href="./font-face.css" rel="stylesheet" type="text/css" />
<div id="font-face-arabic-text-title">بسم الله الرحمن الرحيم</div>

الحمد لله الذي انعم على الإنسان بنعمة العقل والإبتكار وحب البحث والتعلم. كنا عالماً او متعلماً او محباً للعلم ولا تكن الرابعة فتهلك.

<div id="font-face-arabic-text-body">هذه تجربة بسيطة وتعريف بكيفية استخدام خاصية font-face مع النص العربي لإضفاء جمالية خاصة على الصفحات المصممة للانترنت باللغة العربية.</div>


The css code for this example:

@font-face {
    font-family: "Gideas Font-face Demo";
    font-weight: normal;
    src: local("âک؛"), url("fonts/thickTitleFont.ttf") format("truetype");

font: 150% 'Gideas Font-face Demo','Simplified Arabic';

font: 120% 'Gideas Font-face Demo','Simplified Arabic';