Commit 1eb62d43 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

New Japanese NC crash messages.

A feeble hack to get Edit to display Japanese, plus a more serious attempt
that doesn't work, compiled out.

Version 4.91. Tagged as 'RISC_OSLib-4_91'
parent f22c5f04
......@@ -69,7 +69,7 @@ LIBFLAGS = -c -o
#
# Include files
#
INCLUDES =
INCLUDES =
STK_EXTN =
......
......@@ -5,8 +5,8 @@
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
Module_MajorVersion SETS "4.90"
Module_Version SETA 490
Module_MajorVersion SETS "4.91"
Module_Version SETA 491
Module_MinorVersion SETS ""
Module_Date SETS "26 Oct 1998"
Module_Date SETS "29 Oct 1998"
END
/* (4.90)
/* (4.91)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 4.90
#define Module_MajorVersion_CMHG 4.91
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 26 Oct 1998
#define Module_Date_CMHG 29 Oct 1998
#define Module_MajorVersion "4.90"
#define Module_Version 490
#define Module_MajorVersion "4.91"
#define Module_Version 491
#define Module_MinorVersion ""
#define Module_Date "26 Oct 1998"
#define Module_Date "29 Oct 1998"
......@@ -75,6 +75,12 @@
#endif
#include "h.verintern.messages"
#define UNICODE
/*#ifdef UNICODE
#include "utf8.h"
#endif*/
/* -------- Forward references -------- */
void txtar__redrawtext(txt t);
......@@ -774,6 +780,26 @@ static int txtar__charwidth(char c) {
return(str.x);
}
#if 0
static int txtar__UCScharwidth(UCS4 c) {
/* Measure the width of a UCS character. */
/* The font must already be set up using font_setfont. */
os_regset regs;
UCS4 a[2];
a[0] = c;
a[1] = 0;
regs.r[1] = (int) a;
regs.r[2] = font_32BIT | font_LENGTH;
regs.r[3] = 10000000;
regs.r[4] = 10000000;
regs.r[7] = 4;
wimpt_noerr(os_swix(Font_ScanString, &regs));
return(regs.r[3]);
}
#endif
static void txtar__expandchars(
txtar__sysdata *s,
char *a,
......@@ -794,14 +820,71 @@ is what happens in fontpaintseveral, to improve drawing of italic fonts. */
int srci = 0;
int dsti = *nchars;
char c;
#ifdef UNICODE
int alphabet=127, dummy;
os_byte(71, &alphabet, &dummy); /* Read current alphabet number */
#endif
tracef2("expandchars ad=%i n=%i.\n", (int) a, n);
while (1) {
if (dsti >= bufsize - 4) break;
if (srci >= n) break;
#ifdef UNICODEx
if (alphabet == 111) {
int l = UTF8_to_UCS4(a+srci, &c);
if (c < 32 || c == 127 || (c>=256 && s->o.fixfont)
|| (c >= 127 && (! s->o.fixfont) && txtar__UCScharwidth(c) == 0)
) {
/* funny character */
cbuf[dsti] = '[';
obuf[dsti++] = srci;
if (c & 0xF0000000) {
cbuf[dsti] = txtar__hexch(c >> 28);
obuf[dsti++] = srci;
}
if (c & 0xFF000000) {
cbuf[dsti] = txtar__hexch(c >> 24);
obuf[dsti++] = srci;
}
if (c & 0xFFF00000) {
cbuf[dsti] = txtar__hexch(c >> 20);
obuf[dsti++] = srci;
}
if (c & 0xFFFF0000) {
cbuf[dsti] = txtar__hexch(c >> 16);
obuf[dsti++] = srci;
}
if (c & 0xFFFFF000) {
cbuf[dsti] = txtar__hexch(c >> 12);
obuf[dsti++] = srci;
}
if (c & 0xFFFFFF00) {
cbuf[dsti] = txtar__hexch(c >> 8);
obuf[dsti++] = srci;
}
if (c & 0xFFFFFFF0) {
cbuf[dsti] = txtar__hexch(c >> 4);
obuf[dsti++] = srci;
}
cbuf[dsti] = txtar__hexch(c);
obuf[dsti++] = srci;
cbuf[dsti] = ']';
obuf[dsti++] = srci;
}
else {
memcpy(cbuf+dsti, a+srci, l);
memset(obuf+dsti, srci, l);
dsti+=l;
}
srci+=l;
}
else {
#endif
c = a[srci];
if (c < 32 || c == 127
|| (c >= 127 /* && c < 128+32 */ && (! s->o.fixfont) && txtar__charwidth(c) == 0)
|| (c >= 127 /* && c < 128+32 */ && (! s->o.fixfont) && alphabet != 111 && txtar__charwidth(c) == 0)
) {
/* funny character */
cbuf[dsti] = '[';
......@@ -819,6 +902,9 @@ is what happens in fontpaintseveral, to improve drawing of italic fonts. */
dsti++;
};
srci++;
#ifdef UNICODEx
}
#endif
};
*nchars = dsti;
cbuf[dsti] = 0;
......
......@@ -180,11 +180,14 @@ extern os_error * font_strwidth(font_string *fs);
/* paint options */
#define font_JUSTIFY 0x01 /* justify text */
#define font_RUBOUT 0x02 /* rub-out box required */
#define font_ABS 0x04 /* absolute co-ordinates */
#define font_JUSTIFY 0x0001 /* justify text */
#define font_RUBOUT 0x0002 /* rub-out box required */
#define font_ABS 0x0004 /* absolute co-ordinates */
/* 8 not used */
#define font_OSCOORDS 0x10 /* os coords supplied (otherwise 1/72000 inch) */
#define font_OSCOORDS 0x0010 /* os coords supplied (otherwise 1/72000 inch) */
#define font_LENGTH 0x0080 /* length supplied */
#define font_16BIT 0x1000 /* 16-bit string supplied */
#define font_32BIT 0x2000 /* 32-bit string supplied */
/* ------------------------------- font_paint -----------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment