On 06/10/07 16:32, Oleg Roitburd wrote: > Hi, > On Sun, 2007-06-10 at 15:45 +0200, Klaus Schmidinger wrote: >> VDR developer version 1.5.3 is now available at >> >> ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.5.3.tar.bz2 >> >> A 'diff' against the previous developer version is available at >> >> ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.5.2-1.5.3.diff > >> - The pixel fonts have been completely removed from the VDR source. >> - VDR is now "UTF-8 aware". It handles strings according to the character >> encoding used on the user's system. All internationalization strings and >> incoming SI data are converted to the system encoding. > > nice to hear this. > I'm beginning with 1st plugin, that can't this handle. and it's your > plugin :-) > make[1]: Entering directory `/tmp/vdr-1.5.3/PLUGINS/src/skincurses' > ... The attached patch makes it compile. I haven't been able to see it display UTF-8 characters, though. >From what I've seen on the web it should work when linked with -lncursesw, but then again maybe just setting LANG=de_DE.utf8 isn't enough to tell curses to actually use UTF-8 on an otherwise pure ISO system... Klaus
--- PLUGINS/src/skincurses/Makefile 2006/09/09 12:38:35 1.7 +++ PLUGINS/src/skincurses/Makefile 2007/06/10 16:19:08 @@ -66,7 +66,7 @@ all: libvdr-$(PLUGIN).so libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) -lncurses -o $@ + $(CXX) $(CXXFLAGS) -shared $(OBJS) -lncursesw -o $@ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) dist: clean --- PLUGINS/src/skincurses/skincurses.c 2006/09/10 14:23:55 1.11 +++ PLUGINS/src/skincurses/skincurses.c 2007/06/10 16:18:17 @@ -6,6 +6,8 @@ * $Id: skincurses.c 1.11 2006/09/10 14:23:55 kls Exp kls $ */ +//XXX TODO strlen()! + #include <ncurses.h> #include <vdr/osd.h> #include <vdr/plugin.h> @@ -19,12 +21,10 @@ class cCursesFont : public cFont { public: - cCursesFont(void): cFont(NULL) {} - virtual int Width(unsigned char c) const { return 1; } + virtual int Width(uint c) const { return 1; } virtual int Width(const char *s) const { return s ? strlen(s) : 0; } - virtual int Height(unsigned char c) const { return 1; } - virtual int Height(const char *s) const { return 1; } virtual int Height(void) const { return 1; } + virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const {} }; static const cCursesFont Font; @@ -135,6 +135,8 @@ void cCursesOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment) { + if (!s) + return; int w = Font->Width(s); int h = Font->Height(); if (Width || Height) {
_______________________________________________ vdr mailing list vdr@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr