summaryrefslogtreecommitdiff
path: root/src/xutf8/ucs2fontmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xutf8/ucs2fontmap.c')
-rw-r--r--src/xutf8/ucs2fontmap.c127
1 files changed, 61 insertions, 66 deletions
diff --git a/src/xutf8/ucs2fontmap.c b/src/xutf8/ucs2fontmap.c
index 2cbfd3983..50f85e551 100644
--- a/src/xutf8/ucs2fontmap.c
+++ b/src/xutf8/ucs2fontmap.c
@@ -1,5 +1,4 @@
-/* "$Id$"
- *
+/*
* Author: Jean-Marc Lienher ( http://oksid.ch )
* Copyright 2000-2003 by O'ksi'D.
*
@@ -7,11 +6,11 @@
* the file "COPYING" which should have been included with this file. If this
* file is missing or damaged, see the license at:
*
- * http://www.fltk.org/COPYING.php
+ * https://www.fltk.org/COPYING.php
*
- * Please report all bugs and problems on the following page:
+ * Please see the following page on how to report bugs and issues:
*
- * http://www.fltk.org/str.php
+ * https://www.fltk.org/bugs.php
*/
#include <stdlib.h>
@@ -53,17 +52,17 @@ typedef struct {
#include "lcUniConv/cp1251.h"
#include "headers/symbol_.h"
#include "headers/dingbats_.h"
-
+
/*************** conv_gen.c ************/
/*const*/
static int ucs2fontmap(char *s, unsigned int ucs, int enc) {
switch(enc) {
- case 0: /* iso10646-1 */
+ case 0: /* iso10646-1 */
s[0] = (char) ((ucs & 0xFF00) >> 8);
s[1] = (char) (ucs & 0xFF);
return 0;
- case 1: /* iso8859-1 */
+ case 1: /* iso8859-1 */
if (ucs <= 0x00FF) {
if (ucs >= 0x0001) {
s[0] = 0;
@@ -72,15 +71,15 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) {
}
}
break;
- case 2: /* iso8859-2 */
+ case 2: /* iso8859-2 */
if (ucs <= 0x00a0) {
s[0] = 0;
s[1] = (char) ucs;
return 2;
} else if (ucs < 0x0180) {
if (ucs >= 0x00a0) {
- s[0] = 0;
- s[1] = (char) iso8859_2_page00[ucs-0x00a0];
+ s[0] = 0;
+ s[1] = (char) iso8859_2_page00[ucs-0x00a0];
if (s[1]) return 2;
}
} else if (ucs < 0x02e0) {
@@ -88,105 +87,105 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) {
s[0] = 0;
s[1] = (char) iso8859_2_page02[ucs-0x02c0];
if (s[1]) return 2;
- }
+ }
}
break;
- case 3: /* iso8859-3 */
+ case 3: /* iso8859-3 */
if (iso8859_3_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 3;
- }
+ }
break;
- case 4: /* iso8859-4 */
+ case 4: /* iso8859-4 */
if (iso8859_4_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 4;
- }
+ }
break;
- case 5: /* iso8859-5 */
+ case 5: /* iso8859-5 */
if (iso8859_5_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 5;
- }
+ }
break;
- case 6: /* iso8859-6 */
+ case 6: /* iso8859-6 */
if (iso8859_6_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 6;
- }
+ }
break;
- case 7: /* iso8859-7 */
+ case 7: /* iso8859-7 */
if (iso8859_7_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 7;
- }
+ }
break;
- case 8: /* iso8859-8 */
+ case 8: /* iso8859-8 */
if (iso8859_8_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 8;
- }
+ }
break;
- case 9: /* iso8859-9 */
+ case 9: /* iso8859-9 */
if (iso8859_9_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 9;
- }
+ }
break;
- case 10: /* iso8859-10 */
+ case 10: /* iso8859-10 */
if (iso8859_10_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 10;
- }
+ }
break;
- case 25: /* iso8859-11 */
+ case 25: /* iso8859-11 */
if (iso8859_11_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 25;
- }
+ }
break;
- case 11: /* iso8859-13 */
+ case 11: /* iso8859-13 */
if (iso8859_13_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 11;
- }
+ }
break;
- case 12: /* iso8859-14 */
+ case 12: /* iso8859-14 */
if (iso8859_14_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 12;
- }
+ }
break;
- case 13: /* iso8859-15 */
+ case 13: /* iso8859-15 */
if (iso8859_15_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 13;
- }
+ }
break;
- case 14: /* koi8-r */
+ case 14: /* koi8-r */
if (koi8_r_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 14;
- }
+ }
break;
- case 15: /* big5 */
+ case 15: /* big5 */
if (big5_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 15;
- }
+ }
break;
- case 16: /* ksc5601.1987-0 */
+ case 16: /* ksc5601.1987-0 */
if (ksc5601_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 16;
- }
+ }
break;
- case 17: /* gb2312.1980-0 */
+ case 17: /* gb2312.1980-0 */
if (gb2312_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 17;
- }
+ }
break;
- case 18: /* jisx0201.1976-0 */
+ case 18: /* jisx0201.1976-0 */
if (jisx0201_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 18;
- }
+ }
break;
- case 19: /* jisx0208.1983-0 */
+ case 19: /* jisx0208.1983-0 */
if (jisx0208_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 19;
- }
+ }
break;
- case 20: /* jisx0212.1990-0 */
+ case 20: /* jisx0212.1990-0 */
if (jisx0212_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 20;
- }
+ }
break;
- case 21: /* symbol */
+ case 21: /* symbol */
if (ucs <= 0x00F7) {
if (ucs >= 0x0020) {
s[0] = 0;
@@ -237,7 +236,7 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) {
}
}
break;
- case 22: /* dingbats */
+ case 22: /* dingbats */
if (ucs <= 0x00A0) {
if (ucs >= 0x0020) {
s[0] = 0;
@@ -276,15 +275,15 @@ static int ucs2fontmap(char *s, unsigned int ucs, int enc) {
}
}
break;
- case 23: /* koi8-u */
+ case 23: /* koi8-u */
if (koi8_u_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 23;
- }
+ }
break;
- case 24: /* microsoft-cp1251 */
+ case 24: /* microsoft-cp1251 */
if (cp1251_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
return 24;
- }
+ }
break;
case 26: /* gbk/cp936ext */
if (cp936ext_wctomb(NULL, (unsigned char*)s, ucs, 2) > 0) {
@@ -330,27 +329,27 @@ static int encoding_number(const char *enc) {
} else if (!strcmp(enc, "koi8-r")) {
return 14;
} else if (!strcmp(enc, "big5-0") || !strcmp(enc, "big5.eten-0") ||
- !strcmp(enc, "big5p-0"))
+ !strcmp(enc, "big5p-0"))
{
return 15;
} else if (!strcmp(enc, "ksc5601.1987-0")) {
return 16;
- } else if (!strcmp(enc, "gb2312.1980-0") || !strcmp(enc, "gb2312.80-0") ||
- !strcmp(enc, "gb2312.80&gb8565.88") || !strcmp(enc, "gb2312.80-0"))
+ } else if (!strcmp(enc, "gb2312.1980-0") || !strcmp(enc, "gb2312.80-0") ||
+ !strcmp(enc, "gb2312.80&gb8565.88") || !strcmp(enc, "gb2312.80-0"))
{
return 17;
} else if (!strcmp(enc, "jisx0201.1976-0")) {
return 18;
} else if (!strcmp(enc, "jisx0208.1983-0") || !strcmp(enc, "jisx0208.1990-0")
- || !strcmp(enc, "jisx0208.1978-0"))
+ || !strcmp(enc, "jisx0208.1978-0"))
{
return 19;
} else if (!strcmp(enc, "jisx0212.1990-0")) {
return 20;
} else if (!strcmp(enc, "symbol")) {
return 21;
- } else if (!strcmp(enc, "dingbats") || !strcmp(enc, "zapfdingbats") ||
- !strcmp(enc, "zapf dingbats") || !strcmp(enc, "itc zapf dingbats"))
+ } else if (!strcmp(enc, "dingbats") || !strcmp(enc, "zapfdingbats") ||
+ !strcmp(enc, "zapf dingbats") || !strcmp(enc, "itc zapf dingbats"))
{
return 22;
} else if (!strcmp(enc, "koi8-u")) {
@@ -364,7 +363,3 @@ static int encoding_number(const char *enc) {
};
return -1;
}
-
-/*
- * End of "$Id$".
- */