changeset 2135:362c31163bc9

more fl_toupper
author corvid <corvid@lavabit.com>
date So, 17 Jul 2011 21:53:01 +0000
parents 498945d6d780
children d33356d22c40
files dw/fltkviewbase.cc
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkviewbase.cc	So Jul 17 21:33:47 2011 +0000
+++ b/dw/fltkviewbase.cc	So Jul 17 21:53:01 2011 +0000
@@ -25,8 +25,6 @@
 #include <FL/fl_draw.H>
 
 #include <stdio.h>
-#include <wchar.h>
-#include <wctype.h>
 #include "../lout/msg.h"
 
 extern Fl_Widget* fl_oldfocus;
@@ -550,14 +548,14 @@
           viewY = translateCanvasYToViewY (Y);
       int curr = 0, next = 0, nb;
       char chbuf[4];
-      wchar_t wc, wcu;
+      int c, cu;
 
       if (font->fontVariant == core::style::FONT_VARIANT_SMALL_CAPS) {
          int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
          for (curr = 0; next < len; curr = next) {
             next = theLayout->nextGlyph(text, curr);
-            wc = fl_utf8decode(text + curr, text + next, &nb);
-            if ((wcu = towupper(wc)) == wc) {
+            c = fl_utf8decode(text + curr, text + next, &nb);
+            if ((cu = fl_toupper(c)) == c) {
                /* already uppercase, just draw the character */
                fl_font(ff->font, ff->size);
                fl_draw(text + curr, next - curr, viewX, viewY);
@@ -565,7 +563,7 @@
                viewX += (int)fl_width(text + curr, next - curr);
             } else {
                /* make utf8 string for converted char */
-               nb = fl_utf8encode(wcu, chbuf);
+               nb = fl_utf8encode(cu, chbuf);
                fl_font(ff->font, sc_fontsize);
                fl_draw(chbuf, nb, viewX, viewY);
                viewX += font->letterSpacing;