#include "gfx.h"
#include "txtform.h"
-#define M_VERSION 1.12
+#define M_VERSION 1.18
#define NCF_FILE "/var/tuxbox/config/neutrino.conf"
#define HDF_FILE "/tmp/.msgbox_hidden"
}
static int yo=80,dy;
-static int psx, psy, pxw, pyw, myo=0, buttx=80, butty=30, buttdx=20, buttdy=10, buttsize=0, buttxstart=0, buttystart=0;
+int psx;
+static int psy, pxw, pyw, myo=0, buttx=80, butty=30, buttdx=20, buttdy=10, buttsize=0, buttxstart=0, buttystart=0;
int show_txt(int buttonly)
{
/******************************************************************************
* RenderString
******************************************************************************/
-
+extern int psx;
int RenderString(char *string, int _sx, int _sy, int maxwidth, int layout, int size, int color)
{
int stringlen = 0, _ex = 0, charwidth = 0,found = 0;
if(sscanf(rptr+1,"%4d",&i)==1)
{
rptr+=4;
+ sx = psx + 10 + i;
_sx=i;
}
break;
}
else
{
- if((charwidth = RenderChar(*rptr, _sx, _sy, _ex, varcolor)) == -1) return _sx; /* string > maxwidth */
+ int uml = 0;
+ switch(*rptr) /* skip Umlauts */
+ {
+ case '\xc4':
+ case '\xd6':
+ case '\xdc':
+ case '\xe4':
+ case '\xf6':
+ case '\xfc':
+ case '\xdf': uml=1; break;
+ }
+ if (uml == 0)
+ {
+ // UTF8_to_Latin1 encoding
+ if (((*rptr) & 0xf0) == 0xf0) /* skip (can't be encoded in Latin1) */
+ {
+ rptr++;
+ if ((*rptr) == 0)
+ *rptr='\x3f'; // ? question mark
+ rptr++;
+ if ((*rptr) == 0)
+ *rptr='\x3f';
+ rptr++;
+ if ((*rptr) == 0)
+ *rptr='\x3f';
+ }
+ else if (((*rptr) & 0xe0) == 0xe0) /* skip (can't be encoded in Latin1) */
+ {
+ rptr++;
+ if ((*rptr) == 0)
+ *rptr='\x3f';
+ rptr++;
+ if ((*rptr) == 0)
+ *rptr='\x3f';
+ }
+ else if (((*rptr) & 0xc0) == 0xc0)
+ {
+ char c = (((*rptr) & 3) << 6);
+ rptr++;
+ if ((*rptr) == 0)
+ *rptr='\x3f';
+ *rptr = (c | ((*rptr) & 0x3f));
+ }
+ }
+ if((charwidth = RenderChar(*rptr, _sx, _sy, _ex, varcolor)) == -1) return _sx; /* string > maxwidth */
_sx += charwidth;
}
rptr++;