[gnome-settings-daemon/wip/carlosg/shuffle-font-mouse-settings: 1/2] xsettings: Use font aa/hinting/rgba-order settings from gsettings-desktop-schemas




commit 3b2c0ac51fe65c0e63a5a3fc2e3f6d8627a1ae8d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Aug 27 00:11:39 2020 +0200

    xsettings: Use font aa/hinting/rgba-order settings from gsettings-desktop-schemas
    
    Move these settings there, as they are more universal than gnome-settings-daemon.

 ...ettings-daemon.plugins.xsettings.gschema.xml.in | 15 -------
 plugins/xsettings/gsd-xsettings-manager.c          | 46 +++++++++++-----------
 2 files changed, 23 insertions(+), 38 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in 
b/data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in
index ce45ac67..a5f2f543 100644
--- a/data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in
+++ b/data/org.gnome.settings-daemon.plugins.xsettings.gschema.xml.in
@@ -1,21 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schemalist>
   <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.xsettings" 
path="/org/gnome/settings-daemon/plugins/xsettings/">
-    <key name="antialiasing" enum="org.gnome.settings-daemon.GsdFontAntialiasingMode">
-      <default>'grayscale'</default>
-      <summary>Antialiasing</summary>
-      <description>The type of antialiasing to use when rendering fonts. Possible values are: “none” for no 
antialiasing, “grayscale” for standard grayscale antialiasing, and “rgba” for subpixel antialiasing (LCD 
screens only).</description>
-    </key>
-    <key name="hinting" enum="org.gnome.settings-daemon.GsdFontHinting">
-      <default>'slight'</default>
-      <summary>Hinting</summary>
-      <description>The type of hinting to use when rendering fonts. Possible values are: “none” for no 
hinting and “slight” for fitting only to the Y-axis like Microsoft’s ClearType, DirectWrite and Adobe’s 
proprietary font rendering engine. Ignores native hinting within the font, generates hints algorithmically. 
Used on Ubuntu by default. Recommended. The meaning of “medium” and “full” depends on the font format (.ttf, 
.otf, .pfa/.pfb) and the installed version of FreeType. They usually try to fit glyphs to both the X and the 
Y axis (except for .otf: Y-only). This can lead to distortion and/or inconsistent rendering depending on the 
quality of the font, the font format and the state of FreeType’s font engines.</description>
-    </key>
-    <key name="rgba-order" enum="org.gnome.settings-daemon.GsdFontRgbaOrder">
-      <default>'rgb'</default>
-      <summary>RGBA order</summary>
-      <description>The order of subpixel elements on an LCD screen; only used when antialiasing is set to 
“rgba”. Possible values are: “rgb” for red on left (most common), “bgr” for blue on left, “vrgb” for red on 
top, “vbgr” for red on bottom.</description>
-    </key>
     <key name="disabled-gtk-modules" type="as">
       <default>[]</default>
       <summary>List of explicitly disabled GTK+ modules</summary>
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index 7b6fe439..13ad37dc 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -66,9 +66,9 @@
 #define CURSOR_SIZE_KEY "cursor-size"
 #define CURSOR_THEME_KEY "cursor-theme"
 
-#define FONT_ANTIALIASING_KEY "antialiasing"
-#define FONT_HINTING_KEY      "hinting"
-#define FONT_RGBA_ORDER_KEY   "rgba-order"
+#define FONT_ANTIALIASING_KEY "font-antialiasing"
+#define FONT_HINTING_KEY      "font-hinting"
+#define FONT_RGBA_ORDER_KEY   "font-rgba-order"
 
 #define GTK_SETTINGS_DBUS_PATH "/org/gtk/Settings"
 #define GTK_SETTINGS_DBUS_NAME "org.gtk.Settings"
@@ -670,21 +670,21 @@ xft_settings_get (GsdXSettingsManager *manager,
                   GsdXftSettings    *settings)
 {
        GSettings  *interface_settings;
-        GsdFontAntialiasingMode antialiasing;
-        GsdFontHinting hinting;
-        GsdFontRgbaOrder order;
+        GDesktopFontAntialiasingMode antialiasing;
+        GDesktopFontHinting hinting;
+        GDesktopFontRgbaOrder order;
         gboolean use_rgba = FALSE;
         double dpi;
         int cursor_size;
 
        interface_settings = g_hash_table_lookup (manager->settings, INTERFACE_SETTINGS_SCHEMA);
 
-        antialiasing = g_settings_get_enum (manager->plugin_settings, FONT_ANTIALIASING_KEY);
-        hinting = g_settings_get_enum (manager->plugin_settings, FONT_HINTING_KEY);
-        order = g_settings_get_enum (manager->plugin_settings, FONT_RGBA_ORDER_KEY);
+        antialiasing = g_settings_get_enum (interface_settings, FONT_ANTIALIASING_KEY);
+        hinting = g_settings_get_enum (interface_settings, FONT_HINTING_KEY);
+        order = g_settings_get_enum (interface_settings, FONT_RGBA_ORDER_KEY);
 
-        settings->antialias = (antialiasing != GSD_FONT_ANTIALIASING_MODE_NONE);
-        settings->hinting = (hinting != GSD_FONT_HINTING_NONE);
+        settings->antialias = (antialiasing != G_DESKTOP_FONT_ANTIALIASING_MODE_NONE);
+        settings->hinting = (hinting != G_DESKTOP_FONT_HINTING_NONE);
         settings->window_scale = get_window_scale (manager);
         dpi = get_dpi_from_gsettings (manager);
         settings->dpi = dpi * 1024; /* Xft wants 1/1024ths of an inch */
@@ -696,46 +696,46 @@ xft_settings_get (GsdXSettingsManager *manager,
         settings->hintstyle = "hintfull";
 
         switch (hinting) {
-        case GSD_FONT_HINTING_NONE:
+        case G_DESKTOP_FONT_HINTING_NONE:
                 settings->hintstyle = "hintnone";
                 break;
-        case GSD_FONT_HINTING_SLIGHT:
+        case G_DESKTOP_FONT_HINTING_SLIGHT:
                 settings->hintstyle = "hintslight";
                 break;
-        case GSD_FONT_HINTING_MEDIUM:
+        case G_DESKTOP_FONT_HINTING_MEDIUM:
                 settings->hintstyle = "hintmedium";
                 break;
-        case GSD_FONT_HINTING_FULL:
+        case G_DESKTOP_FONT_HINTING_FULL:
                 settings->hintstyle = "hintfull";
                 break;
         }
 
         switch (order) {
-        case GSD_FONT_RGBA_ORDER_RGBA:
+        case G_DESKTOP_FONT_RGBA_ORDER_RGBA:
                 settings->rgba = "rgba";
                 break;
-        case GSD_FONT_RGBA_ORDER_RGB:
+        case G_DESKTOP_FONT_RGBA_ORDER_RGB:
                 settings->rgba = "rgb";
                 break;
-        case GSD_FONT_RGBA_ORDER_BGR:
+        case G_DESKTOP_FONT_RGBA_ORDER_BGR:
                 settings->rgba = "bgr";
                 break;
-        case GSD_FONT_RGBA_ORDER_VRGB:
+        case G_DESKTOP_FONT_RGBA_ORDER_VRGB:
                 settings->rgba = "vrgb";
                 break;
-        case GSD_FONT_RGBA_ORDER_VBGR:
+        case G_DESKTOP_FONT_RGBA_ORDER_VBGR:
                 settings->rgba = "vbgr";
                 break;
         }
 
         switch (antialiasing) {
-        case GSD_FONT_ANTIALIASING_MODE_NONE:
+        case G_DESKTOP_FONT_ANTIALIASING_MODE_NONE:
                 settings->antialias = 0;
                 break;
-        case GSD_FONT_ANTIALIASING_MODE_GRAYSCALE:
+        case G_DESKTOP_FONT_ANTIALIASING_MODE_GRAYSCALE:
                 settings->antialias = 1;
                 break;
-        case GSD_FONT_ANTIALIASING_MODE_RGBA:
+        case G_DESKTOP_FONT_ANTIALIASING_MODE_RGBA:
                 settings->antialias = 1;
                 use_rgba = TRUE;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]