changeset 1714:80f90763d2c3

Don't touch letter spacing for small-caps
author Jorge Arellano Cid <jcid@dillo.org>
date Fri, 08 Oct 2010 13:06:12 -0400
parents 4d87e55c0bbb
children 493343d3d7ae
files dw/fltkplatform.cc dw/fltkviewbase.cc
diffstat 2 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkplatform.cc	Thu Oct 07 13:06:30 2010 -0400
+++ b/dw/fltkplatform.cc	Fri Oct 08 13:06:12 2010 -0400
@@ -361,9 +361,7 @@
    int curr = 0, next = 0, nb;
    
    if (font->fontVariant == 1) {
-      int sc_fontsize, sc_letterSpacing;
-      sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
-      sc_letterSpacing = lout::misc::roundInt(font->letterSpacing * 0.78);
+      int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
       memset (&st1, '\0', sizeof (mbstate_t));
       memset (&st2, '\0', sizeof (mbstate_t));
       for (curr = 0; next < len; curr = next) {
@@ -378,7 +376,7 @@
             /* make utf8 string for converted char */
             nb = wcrtomb(chbuf, wcu, &st2);
             setfont(ff->font, sc_fontsize);
-            width += sc_letterSpacing;
+            width += font->letterSpacing;
             width += (int)getwidth(chbuf, nb);
          }
       }
--- a/dw/fltkviewbase.cc	Thu Oct 07 13:06:30 2010 -0400
+++ b/dw/fltkviewbase.cc	Fri Oct 08 13:06:12 2010 -0400
@@ -498,9 +498,7 @@
       mbstate_t st1, st2;
 
       if (font->fontVariant == 1) {
-         int sc_fontsize, sc_letterSpacing;
-         sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
-         sc_letterSpacing = lout::misc::roundInt(font->letterSpacing * 0.78);
+         int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
          memset (&st1, '\0', sizeof (mbstate_t));
          memset (&st2, '\0', sizeof (mbstate_t));
          for (curr = 0; next < len; curr = next) {
@@ -517,7 +515,7 @@
                int n = wcrtomb(chbuf, wcu, &st2);
                setfont(ff->font, sc_fontsize);
                drawtext(chbuf, n, viewX, viewY);
-               viewX += sc_letterSpacing;
+               viewX += font->letterSpacing;
                viewX += (int)getwidth(chbuf, n);
             }
          }