spacer
Yehuda Shiran September 4, 2000
Using the Kashida Effect
Tips: September 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Kashida is a typographic effect that justifies lines of text by elongating characters at algorithmically-selected points. It is mostly used in Arabic writing systems. The property can be used with any justification style such as the auto, distribute, kashida, and newspaper values of the textJustify property.

You can control the kashida effect by specifying the textKashidaSpace property of the style object. The kashida effect is measured in the ratio of kashida expansion to empty space expansion. When it is 100%, there is only kashida expansion. When it is 0%, there is only white space expansion. You can find out the kashida effect of an object in object.style.textKashidaSpace. Here is how you specify the kashida effect:

object.style.textKashidaSpace = vKashida;

where vKashida is one of two options:

  • percentage. Integer, followed by a %. 100% is kashida expansion only; 0% is white space expansion only.

  • inherit. Text is expanded like the text in the parent object.

The following paragraph (works only in IE 5.5 and up) demonstrates the textKashidaSpace property. Click one of the two links following the paragraph, and watch the kashida effect (early versions of IE 5.5 do not support it!):

Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line

100% kashida 0% kashida

Here is how we defined the above paragraph and links:

<P ID="kashidaEffect" STYLE="text-kashida-space:100%; width:100%; text-align:justify; left:0">
Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line
Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line
Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line Long Line
Long Line Long Line Long Line Long Line Long Line Long Line 
</P>
<A HREF="javascript:void(kashidaEffect.style.textKashidaSpace='100%')">100% kashida</A>
<A HREF="javascript:void(kashidaEffect.style.textKashidaSpace='0%\)">0% kashida</A>


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business