I know so little about this that I'm having trouble formulating the question.

Apparently due to technical limitations, nastaleeq style of writing Urdu is very difficult, perhaps impossible, given current standards used on the web. I'd like to do a deep dive into why this is so (the technical aspects, at least).

My, very rough, understanding is this:

Unicode is the standard right now, but it doesn't define how characters look, it only define the names of characters and a numbering system to represent them.

"Fonts," such as Halvetica or Times New Roman, actually define the look of characters.

What is True Type then, and how is it different from Open Type or Postscript or LaTex?

If a language requires that shapes of characters, and how the connect to each other (think cursive), change, based on their location in text...how is that handled? If Unicode is only a representation system and fonts only concern themselves with single characters, where do these location based algorithms go?

Is the current set of standards too limited to handle complex cursive style typography? If so, can HTML's canvas be used to create an alternative/experimental "font system?" If I do need to "roll my own" is Knuth's work on digital typography still relevant or are there more modern references?


That's a whole bunch of questions, and not all have easy answers.

Easy Answers

  • Unicode is a language-independent method for encoding strings of text as sequential numbers of a defined data size per-letter, with the most common being UTF-8, which uses eight-bits per character and is largely identical for the old ASCII English-language equivalent.

  • Fonts are the means of mapping both UTF and ASCII strings to a human-readable graphic. Both TrueType and OpenType are different standards for defining fonts, with the latter being the more recent.

  • PostScript and LaTeX are languages that specifically help layout documents for the printed page, rather than encoding strings. TeX is a foundation to LaTex and PDF is an extension of PostScript, but all are special cases that aren't relevant to the score question aside from being an alternative to HTML or XUI.

How should position-dependent languages be encoded?

Languages where one glyph is substituted for another based on word position should use different glyphs for each variant. It's how capital letters already work in English-like languages, and those have the same language-specific rules as to when semantically equivalent glyph should be used on top of another.

If the variants can be expressed as combining one symbol over another, they can be entered as ligatures instead of separate glyphs, which allows for both fonts and strings to be smaller and thus faster for computers to render.

Can Nastaleeq be written in UTF-8?

I would suspect not, at least not without tolerating a significant spelling variance. This puts the language in company of languages where each word is its own glyph, such as Chinese and Japanese. Assuming there is a usable UTF glyph definition for the alphabet and its various ligatures, that is.

So, is there a UTF standard for Nastaleeq?

It certainly seems as if there is. The external links section of the Nastaleeq Wikipedia page has references to various fonts and software packages that support the script, including links to a web community that opens up in a font that certainly isn't English. But, as I cannot read Urdu or Nastaleeq, I have no idea if http://www.nastaliqonline.ir/ is displaying actual Nastaleeq or a UTF-8 constrained subset.

  • Thanks @DougM, is ther a book or another resource where I can dig into this stuff deeper? I see graphic designers have plenty of material about typography, but I doubt it goes into the mind of technical detail a programmer might find usable
    – Shahbaz
    Dec 7 '13 at 6:48
  • Not that I know of. Most of what I know comes from dabbling with desktop publishing software and professional curiosity. I suspect the nastaleeq web community has better detail than we could provide here.
    – DougM
    Dec 7 '13 at 7:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.