The Khmer script was one of the earliest writing systems used in Southeast Asia, first appearing in the 7th century CE. It derived immediately from the Pallava script, a variety of the Grantha script of South India, which in turn ultimately is descended from the ancient Brahmi script of India.
Like all Brahmi-derived scripts, Khmer has certain traits similar to those found in South Asian scripts. The direction of writing in Khmer is left to right, and downwards when horizontal space runs out. Khmer is a syllabic alphabet, meaning that a letter represents a syllable in the form of a consonant followed by an inherent vowel. An interesting feature of the Khmer script is that there are two letters for each consonant, one letter carrying the inherent vowel of /a/ and the other /o/. This stems from reusing letters for sounds present in Indian languages but not Khmer. So, roughly speaking, the a-letters correspond to the voiceless letters in Indian scripts, and o-letters to the Indian letters for voiced consonants (fewer of which exist in Khmer than in Indian tongues).
The following is the Khmer script. Note that q is the stands for the glottal stop. Another note is that the last row of letters (g-, f-, and zh-) represent sounds found only in words borrowed from other languages.
Note that I have rearranged the alphabet to group letters by their initial consonants, thus scrambling the traditional alphabetical order. The normal ordering of letters follows those in Indic scripts, but translated onto the a and o letters of Khmer. So for example, the velar (/k/-like sounds) letters in Indic scripts are ordered as ka, kha, ga, gha, and nga. As previously mentioned, voiced consonants letters in Indic scripts were reused for the o-series of letters, and therefore this transforms into ka, kha, ko, kho, and ngo.
Another feature of the Khmer script is the use of extra strokes (called vowel diacritics) around a letter to change the inherent vowel. Once again, because there are two letters for each consonant, the same vowel diacritic works differently for an a-letter and an o-letter. The following chart illustrates this dichotomy. The first line under each row of vowel diacritic lists the vowels for the a-letters, and the second line lists the vowels for the o-letters.
But of course, there are exceptions. The q- letters don't use vowel diacritics, but instead have special letters for many of the vowels. This stems from the fact that the q- letters came from the word-initial /a/ vowel letter in Indic scripts. As there were letters for other word-initial vowels in Indic scripts as well, they also were incorporated into Khmer as q- letters. All q- letters only appear at the beginning of a word, which is the only place where a glottal stop can occur in Khmer.
In addition, certain syllables starting with /r/ and /l/ are also written using special letters too. Once again, this stems from Indic scripts having special cases with /r/ and /l/ sounds.
Consonant clusters are written using ligatures. A ligature is a "double decker" sign composed of a normal letter and a subscript. Normally, subscripts are smaller versions of the normal letters, but sometimes they are mutated into shapes that don't resemble the corresponding normal letters. In a cluster, the first letter to be read is the normal letter, which sits at the "central" location, and the second letter is the subscript, which sits under the first letter and sometimes extends up the side of the first letter. The following chart lists normal letters (in blue) and respective subscripts (in black).
The following is an example of subscripts used in conjunction with normal letters and vowel diacritics to write out Khmer words.
The Khmer script is still used in Cambodia, having evolved over more than a thousand years. One consequence of this long history is that certain words are not pronounced as they are spelled, so sometimes a comma-like diacritic is placed on letters that are no longer pronounced.
The Lao and Thai scripts are related to the Khmer script, but exact relationships are unknown. Some consider Lao to be a "sibling" to Khmer and Thai as a derived script, but with the rapid spread of Buddhism and Indian scripts into Southeast Asia the exact parentage of these scripts will likely remain uncertain.