[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kcontrol/fonts
From:       Gerold J. Wucherpfennig <gjwucherpfennig () gmx ! net>
Date:       2004-10-17 22:14:10
Message-ID: 20041017221410.41EFE16CAA () office ! kde ! org
[Download RAW message or body]

CVS commit by gjw: 

Add greyscale to the list of available sub-pixel hinting mechanisms.


The Reason:

When you disable sub-pixel hinting this results in removing RGBA settings in ~/.fonts.conf.
That results in using the defaults which seem to be RGB sub-pixel hinting which may still
be overridden in "/etc/fonts/local.conf".


  M +22 -2     fonts.cpp   1.91
  M +10 -2     kxftconfig.cpp   1.33
  M +1 -0      kxftconfig.h   1.14


--- kdebase/kcontrol/fonts/fonts.cpp  #1.90:1.91
@@ -42,4 +42,24 @@
 #undef None
 
+static const char *aa_greyscale_xpm[]={
+"12 12 6 1",
+"a c #dcdcdc",
+"b c #c3c3c3",
+"c c #a0a0a0",
+"d c #808080",
+"e c #585858",
+"f c #303030",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa",
+"ffeeddccbbaa"};
 static const char *aa_rgb_xpm[]={
 "12 12 3 1",
@@ -111,6 +131,6 @@ static const char *aa_vbgr_xpm[]={
 "aaaaaaaaaaaa"};
 
-static QPixmap aaPixmaps[]={ QPixmap(aa_rgb_xpm), QPixmap(aa_bgr_xpm),
-                             QPixmap(aa_vrgb_xpm), QPixmap(aa_vbgr_xpm) };
+static QPixmap aaPixmaps[]={ QPixmap(aa_greyscale_xpm), QPixmap(aa_rgb_xpm),
+                             QPixmap(aa_bgr_xpm), QPixmap(aa_vrgb_xpm), QPixmap(aa_vbgr_xpm) };
 
 /**** DLL Interface ****/

--- kdebase/kcontrol/fonts/kxftconfig.cpp  #1.32:1.33
@@ -197,5 +197,7 @@ static QString getEntry(QDomElement elem
 static KXftConfig::SubPixel::Type strToType(const char *str)
 {
-    if(0==strcmp(str, "rgb"))
+    if(0==strcmp(str, "\0"))
+        return KXftConfig::SubPixel::Greyscale;
+    else if(0==strcmp(str, "rgb"))
         return KXftConfig::SubPixel::Rgb;
     else if(0==strcmp(str, "bgr")) 
@@ -224,5 +226,7 @@ static KXftConfig::Hint::Style strToStyl
 static bool strToType(const char *str, KXftConfig::SubPixel::Type &type)
 {   
-    if(0==memcmp(str, "rgb", 3))
+    if(0==memcmp(str, "\0", 1))
+        type=KXftConfig::SubPixel::Greyscale;
+    else if(0==memcmp(str, "rgb", 3))
         type=KXftConfig::SubPixel::Rgb;
     else if(0==memcmp(str, "bgr", 3))
@@ -824,4 +828,6 @@ QString KXftConfig::description(SubPixel
         case SubPixel::None:
             return i18n("None");
+        case SubPixel::Greyscale:
+            return i18n("Greyscale");
         case SubPixel::Rgb:
             return i18n("RGB");
@@ -842,4 +848,6 @@ const char * KXftConfig::toStr(SubPixel:
         case SubPixel::None:
             return "none";
+        case SubPixel::Greyscale:
+            return "";
         case SubPixel::Rgb:
             return "rgb";

--- kdebase/kcontrol/fonts/kxftconfig.h  #1.13:1.14
@@ -90,4 +90,5 @@ class KXftConfig
         {
             None,
+            Greyscale,
             Rgb,
             Bgr,


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic