[XeTeX] Word wrapping in Lao

Brian Wilson bountonw at gmail.com
Fri Apr 16 09:15:11 CEST 2010


Lao, Thai and Khmer space at the phrasal level and not the word level. I was
not getting any word wrapping in Lao (haven't tried Thai or Khmer yet) until
a friend suggested that I add the following in the preamble

\renewcommand{\|}{\hspace{0pt}}

and then insert \| at each potential word break.This works, but with more
than 1000 pages of text in these languages, manually inserting this command
at every word would get old quickly. A friend has suggested that I go back
and use movable type as it probably wouldn't be any slower than doing it
this way. My main reason for leaving In Design was because I didn't want to
have to manually enter in the word spaces for each line. It seems that I am
back where I started.  Wouldn't it be easier to tell "TeX" where spaces
can't occur and then let it have freedom to make its breaks everywhere else?
I think I know all of the break rules where breaks can not occur at the
syllable level and a dictionary of non-breakable words could be added.

How can this problem be solved so that Lao is fully functional in TeX for
all users everywhere?

Here is a sample document with filler text. I am using Saysettha MX font on
a mac.

\documentclass[a5paper,twocolumn,draft]{book}
\special{papersize=148mm, 210mm}

\usepackage{fontspec}% provides font selecting commands
\usepackage{xunicode}% provides unicode character macros
\usepackage{xltxtra} % provides some fixes/extras

\setmainfont{Saysettha MX}

\renewcommand{\|}{\hspace{0pt}}

\begin{document}


10ຂ້າພະອົງ\|ອົດສາ\|ຮັບໃຊ້\|ພະອົງ\|ດ້ວຍ\|ສຸດໃຈ\|
ໂຜດ\|ຮັກສາ\|ຢ່າ\|ໃຫ້\|ຝ່າຝືນ\|ພະຂໍ້\|ຄຳສັ່ງ\|ດ້ວຍ.

11ຂ້າພະອົງ\|ຖືຮັກສາ\|ພະບັນຍັດ\|ໄວ້\|ຢູ\|່ໃນ\|ຈິດ\|ໃຈ\|ເພື່ອ\|ວ່າ\|ຈະ\|ບໍ\|່ໄດ\|້ເຮັດ\|ບາບ\|ຕໍ່\|ສູ້\|ພະເຈົ້າ.

12ຂ້າພະອົງ\|ຍົກຍໍ\|ພະອົງ\|ພະຜູ້ເປັນເຈົ້າຂ້າ!
ໂຜດ\|ສັ່ງສອນ\|ວິທີທາງ\|ຂອງ\|ພະອົງ\|ໃຫ້\|ດ້ວຍ.

13ຂ້າພະອົງ\|ຈະ\|ເວົ້າ\|ຫລຳ\|ໄປ\|ມາ\|ດ້ວຍ\|ສຽງ\|ດັງໆ\|ພະບັນຍັດ\|ທຸກ\|ຂໍ້\|ທີ່\|ພະອົງ\|ມອບ\|ໃຫ້\|ນັ້ນ.

14ຂ້າພະອົງ\|ຂັບຕາມ\|ພະຂໍ້ຄຳສັ່ງ\|ດ້ວຍ\|ຄວາມ\|ຍິນດີ\|ຫລາຍ\|ກວ່າ\|ຄວາມ\|ຮັ່ງ\|ມີ\|ອັນ\|ຫລາຍ\|ລົ້ນ.

15ຂ້າພະອົງ\|ສຶກສາ\|ຄັກ\|ແນ່\|ສິ່ງ\|ທີ່\|ພະອົງ\|ໄດ້\|ແນະ\|ນຳ\|ແລະ\|ພິຈາລະນາ\|ເຖິງ\|ພະຂໍ້ຄຳ\|ສັ່ງສອນ\|ນັ້ນ.

16ຂ້າພະອົງ\|ພໍເອິກ\|ພໍໃຈ\|ໃນ\|ພະບັນຍັດ\|ທັງຫລາຍ\|ແລະ\|ຈະ\|ບໍ່\|ລືມໄລ\|ພະຂໍ້ຄຳສັ່ງ\|ຢ່າງ\|ເດັດຂາດ.

Repeat

10ຂ້າພະອົງ\|ອົດສາ\|ຮັບໃຊ້\|ພະອົງ\|ດ້ວຍ\|ສຸດໃຈ\|
ໂຜດ\|ຮັກສາ\|ຢ່າ\|ໃຫ້\|ຝ່າຝືນ\|ພະຂໍ້\|ຄຳສັ່ງ\|ດ້ວຍ.

11ຂ້າພະອົງ\|ຖືຮັກສາ\|ພະບັນຍັດ\|ໄວ້\|ຢູ\|່ໃນ\|ຈິດ\|ໃຈ\|ເພື່ອ\|ວ່າ\|ຈະ\|ບໍ\|່ໄດ\|້ເຮັດ\|ບາບ\|ຕໍ່\|ສູ້\|ພະເຈົ້າ.

12ຂ້າພະອົງ\|ຍົກຍໍ\|ພະອົງ\|ພະຜູ້ເປັນເຈົ້າຂ້າ!
ໂຜດ\|ສັ່ງສອນ\|ວິທີທາງ\|ຂອງ\|ພະອົງ\|ໃຫ້\|ດ້ວຍ.

13ຂ້າພະອົງ\|ຈະ\|ເວົ້າ\|ຫລຳ\|ໄປ\|ມາ\|ດ້ວຍ\|ສຽງ\|ດັງໆ\|ພະບັນຍັດ\|ທຸກ\|ຂໍ້\|ທີ່\|ພະອົງ\|ມອບ\|ໃຫ້\|ນັ້ນ.

14ຂ້າພະອົງ\|ຂັບຕາມ\|ພະຂໍ້ຄຳສັ່ງ\|ດ້ວຍ\|ຄວາມ\|ຍິນດີ\|ຫລາຍ\|ກວ່າ\|ຄວາມ\|ຮັ່ງ\|ມີ\|ອັນ\|ຫລາຍ\|ລົ້ນ.

15ຂ້າພະອົງ\|ສຶກສາ\|ຄັກ\|ແນ່\|ສິ່ງ\|ທີ່\|ພະອົງ\|ໄດ້\|ແນະ\|ນຳ\|ແລະ\|ພິຈາລະນາ\|ເຖິງ\|ພະຂໍ້ຄຳ\|ສັ່ງສອນ\|ນັ້ນ.

16ຂ້າພະອົງ\|ພໍເອິກ\|ພໍໃຈ\|ໃນ\|ພະບັນຍັດ\|ທັງຫລາຍ\|ແລະ\|ຈະ\|ບໍ່\|ລືມໄລ\|ພະຂໍ້ຄຳສັ່ງ\|ຢ່າງ\|ເດັດຂາດ.

Repeat

10ຂ້າພະອົງ\|ອົດສາ\|ຮັບໃຊ້\|ພະອົງ\|ດ້ວຍ\|ສຸດໃຈ\|
ໂຜດ\|ຮັກສາ\|ຢ່າ\|ໃຫ້\|ຝ່າຝືນ\|ພະຂໍ້\|ຄຳສັ່ງ\|ດ້ວຍ.

11ຂ້າພະອົງ\|ຖືຮັກສາ\|ພະບັນຍັດ\|ໄວ້\|ຢູ\|່ໃນ\|ຈິດ\|ໃຈ\|ເພື່ອ\|ວ່າ\|ຈະ\|ບໍ\|່ໄດ\|້ເຮັດ\|ບາບ\|ຕໍ່\|ສູ້\|ພະເຈົ້າ.

12ຂ້າພະອົງ\|ຍົກຍໍ\|ພະອົງ\|ພະຜູ້ເປັນເຈົ້າຂ້າ!
ໂຜດ\|ສັ່ງສອນ\|ວິທີທາງ\|ຂອງ\|ພະອົງ\|ໃຫ້\|ດ້ວຍ.

13ຂ້າພະອົງ\|ຈະ\|ເວົ້າ\|ຫລຳ\|ໄປ\|ມາ\|ດ້ວຍ\|ສຽງ\|ດັງໆ\|ພະບັນຍັດ\|ທຸກ\|ຂໍ້\|ທີ່\|ພະອົງ\|ມອບ\|ໃຫ້\|ນັ້ນ.

14ຂ້າພະອົງ\|ຂັບຕາມ\|ພະຂໍ້ຄຳສັ່ງ\|ດ້ວຍ\|ຄວາມ\|ຍິນດີ\|ຫລາຍ\|ກວ່າ\|ຄວາມ\|ຮັ່ງ\|ມີ\|ອັນ\|ຫລາຍ\|ລົ້ນ.

15ຂ້າພະອົງ\|ສຶກສາ\|ຄັກ\|ແນ່\|ສິ່ງ\|ທີ່\|ພະອົງ\|ໄດ້\|ແນະ\|ນຳ\|ແລະ\|ພິຈາລະນາ\|ເຖິງ\|ພະຂໍ້ຄຳ\|ສັ່ງສອນ\|ນັ້ນ.

16ຂ້າພະອົງ\|ພໍເອິກ\|ພໍໃຈ\|ໃນ\|ພະບັນຍັດ\|ທັງຫລາຍ\|ແລະ\|ຈະ\|ບໍ່\|ລືມໄລ\|ພະຂໍ້ຄຳສັ່ງ\|ຢ່າງ\|ເດັດຂາດ.


\end{document}

Any help, advice or direction is greatly appreciated.

Brian Wilson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20100416/9627c382/attachment-0001.html>


More information about the XeTeX mailing list