diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2008-09-10 23:56:49 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2008-09-10 23:56:49 +0000 |
| commit | b6bde2e4569aa617c8a6af64947c688c624ed7f8 (patch) | |
| tree | 010d15843eb7d4faf7cd1b0cd44d5b9c00462a83 /src/xutf8/utils/non_spacing.sh | |
| parent | dfb50e85292687561927610e689eb5ab30d0ba26 (diff) | |
Merging the UTF8 patch, consisting of O'ksi'd s original 1.1.6 patch and additions by Ian. PLEASE BE AWARE that the patch in its current incarnation is a regression in many aspects and further work is required before we can announce Unicode support.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/xutf8/utils/non_spacing.sh')
| -rwxr-xr-x | src/xutf8/utils/non_spacing.sh | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/xutf8/utils/non_spacing.sh b/src/xutf8/utils/non_spacing.sh new file mode 100755 index 000000000..ba86bec0f --- /dev/null +++ b/src/xutf8/utils/non_spacing.sh @@ -0,0 +1,103 @@ +#!/bin/sh + + +nopsc=`grep ';Mn;' ../UnicodeData-2.txt` + +IFS=" +" + +#echo "# +# List of non-spacing chars +# +# +# Format: Three tab-separated columns +# Column #1 is the non-spacing Unicode (in hex as 0xXXXX) +# Column #2 is the spacing Unicode (in hex as 0xXXXX) +# Column #3 the Unicode name (follows a comment sign, '#') +# " > space.txt + +rm -f space.txt + + +for line in ${nopsc} +do + ucs=`echo ${line} | cut -d\; -f1` + name=`echo ${line} | cut -d\; -f2` + space=`grep " 0020 ${ucs};" ../UnicodeData-2.txt` + if test "X${space}" != X ;then + tbl=`echo ${space} | cut -d\; -f1` + # echo "0x${ucs} 0x${tbl} # ${name}" >> space.txt + echo "/* U+${ucs} */ 0x${tbl}," >> space.txt + else + # echo "0x${ucs} 0x${ucs} # ${name}" >> space.txt + echo "/* U+${ucs} */ 0x${ucs}," >> space.txt + fi +done + +unset nospc + +# echo "/* EOF */" >> space.txt + +cat space.txt | ./create_table "spacing" > "../headers/spacing.h" 2> ../headers/spacing_tbl.txt + +rm -f space.txt + +cat >../is_spacing.c << ENDOFTEXT +/****************************************************************************** + Copyright 2000-2001 by O'ksi'D + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of O'ksi'D +not be used in advertising or publicity pertaining to distribution +of the software without specific, written prior permission. +O'ksi'D makes no representations about the suitability of +this software for any purpose. It is provided "as is" without +express or implied warranty. + +O'ksi'D DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, +IN NO EVENT SHALL O'ksi'D BE LIABLE FOR ANY SPECIAL, INDIRECT +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. + + Author: Jean-Marc Lienher ( http://oksid.ch ) + +******************************************************************************/ + +#include "headers/spacing.h" + +ENDOFTEXT + +echo " +unsigned short +XUtf8IsNonSpacing( + unsigned int ucs) +{ +" >>../is_spacing.c + +tables=`cat ../headers/spacing_tbl.txt` + +for line in ${tables} +do + tbl=`echo ${line} | cut -d']' -f1` + bot=`echo ${line} | cut -d'_' -f3 | cut -d'[' -f1` + eot=`echo ${line} | cut -d' ' -f2 | cut -d'+' -f2 | cut -d' ' -f1` + echo "\ + if (ucs <= 0x${eot}) { + if (ucs >= 0x${bot}) return ${tbl}ucs - 0x${bot}]; + return 0; + } +" >>../is_spacing.c + +done + +echo " return 0; +} +" >>../is_spacing.c + + |
