[XeTeX] Word wrapping in Lao

John Was john.was at ntlworld.com
Fri Apr 16 10:42:12 CEST 2010


I don't know these languages at all, but (until something better is produced) I wonder if something could be done by making characters live.  If there is a finite number of characters after which a break (without hyphen) is permissible on all or nearly all occasions, you could list them in the file header something like this

 

\catcode"0EAD=\active \defອ{\char"0EAD\hskip 1sp}

 

That ought to put a tiny (invisible) space after the character ອ, which has Unicode value 0EAD, and TeX will then see it as a legitimate breakpoint.  But if there are huge numbers of places where such a break would be prohibited, you'd have as much trouble as you are having already.  There may be ways of controlling it, though:  I would hope (but haven't tried it out) that a \hyphenation exception list would still work, i.e. that the \hskip 1sp would be overriden if your \hyphenation list contained ອ plus another character that formed an unbreakable group.

 

Not sure if this is of any use....

 

 

John



  ----- Original Message ----- 
  From: Brian Wilson 
  To: xetex at tug.org 
  Sent: Friday, April 16, 2010 8:15 AM
  Subject: [XeTeX] Word wrapping in Lao


  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




------------------------------------------------------------------------------




  --------------------------------------------------
  Subscriptions, Archive, and List information, etc.:
    http://tug.org/mailman/listinfo/xetex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20100416/38269f5b/attachment-0001.html>


More information about the XeTeX mailing list