Skip to content

Appendix

Font rendering settings example

The following settings show proper settings in sync with each other.

Entries in ~/.Xdefaults or ~/.Xresources

Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: slight
Xft.rgba: rgb

Entries in ~/.config/fontconfig/fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  ...
  <match target="font">
    <edit name="antialias" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
  <match target="pattern">
    <edit name="dpi" mode="assign">
      <double>92</double>
    </edit>
  </match>
  <match target="font">
    <edit name="hinting" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
  <match target="font">
    <edit name="hintstyle" mode="assign">
      <const>hintslight</const>
    </edit>
  </match>
  <match target="font">
    <edit name="rgba" mode="assign">
      <const>rgb</const>
    </edit>
  </match>
  <match target="font">
    <edit name="lcdfilter" mode="assign">
      <const>lcddefault</const>
    </edit>
  </match>
  ...
</fontconfig>

xsettingsd

For GTK additonally ensure the following entries in your xsettingsd configuration file.

NOTE: The Xft/DPI value is the actual value multiplied by 1024.

...
Xft/Antialias 1
Xft/DPI 94208
Xft/Hinting 1
Xft/HintStyle "hintslight"
Xft/RGBA "rgb"

Qt environment

For Qt additionally configure the font DPI using the environment variable:

export QT_FONT_DPI=92

Per-Session Startup Example

The following example ~/.xsessionrc (see session startup files) shows how to separate Breeze Qt theming between Openbox, KDE/Plasma and other sessions:

if [ "$DESKTOP_SESSION" = "openbox" ]                                                 
then
    # Openbox standalone session with Breeze Qt theming
    xrdb -merge $HOME/.config/openbox/.Xdefaults
    mkdir -p $HOME/.config/openbox/qt5ct
    touch -a $HOME/.config/openbox/kdeglobals
    ln -sfn $HOME/.config/openbox/qt5ct $HOME/.config/qt5ct
    ln -sfn $HOME/.config/openbox/kdeglobals $HOME/.config/kdeglobals
    export QT_QPA_PLATFORMTHEME=qt5ct
    # NOTE: QT_STYLE_OVERRIDE is required for Dolphin to properly render
    #       the free disk space bar in its status bar
    export QT_STYLE_OVERRIDE=Breeze
    # NOTE: for Okular to render properly, disable Qt autoscaling
    export QT_AUTO_SCREEN_SCALE_FACTOR=0
    export QT_SCALE_FACTOR=1
    # Change LibreOffice to use Qt GUI and file picker
    export SAL_USE_VCLPLUGIN=kde5
    # NOTE: set font dpi in sync with .xsettingsd
    #       and ~/.config/fontconfig/fonts.conf
    export QT_FONT_DPI=92
elif [ "$DESKTOP_SESSION" = "plasma" ]
then
    # KDE / Plasma session
    mkdir -p $HOME/.config/qt5ct.plasma
    ln -sfn $HOME/.config/qt5ct.plasma $HOME/.config/qt5ct
    ln -sfn $HOME/.config/kdeglobals.plasma $HOME/.config/kdeglobals
    xrdb -merge $HOME/.config/kde.org/.Xdefaults
else
    # any other session
    mkdir -p $HOME/.config/qt5ct.default
    ln -sfn $HOME/.config/qt5ct.default $HOME/.config/qt5ct
    touch $HOME/.config/kdeglobals.default
    ln -sfn $HOME/.config/kdeglobals.default $HOME/.config/kdeglobals
    xrdb -merge $HOME/.Xdefaults
    export QT_QPA_PLATFORMTHEME=qt5ct
fi

Full xsettingsd configuration example

Gtk/ButtonImages 1
Gtk/CanChangeAccels 0
Gtk/CursorThemeName "Breeze"
Gtk/CursorThemeSize 32
Gtk/DecorationLayout ":minimize,maximize,close"
Gtk/EnableAnimations 1
Gtk/FontName "InterMedium, 11"
Gtk/IconSizes ""
Gtk/KeyThemeName ""
Gtk/MenuBarAccel "F10"
Gtk/MenuImages 1
Gtk/PrimaryButtonWarpsSlider 0
Gtk/ToolbarIconSize 3
Gtk/ToolbarStyle "icons"
Net/CursorBlink 1
Net/CursorBlinkTime 1200
Net/DndDragThreshold 8
Net/DoubleClickDistance 5
Net/DoubleClickTime 400
Net/EnableEventSounds 1
Net/EnableInputFeedbackSounds 1
Net/IconThemeName "breeze-dark"
Net/ThemeName "Breeze-Dark"
Xft/Antialias 1
Xft/DPI 94208
Xft/Hinting 1
Xft/HintStyle "hintslight"
Xft/RGBA "none"

List of available Breeze GTK3 color overrides

The following is an extensive list of all available color overrides (as of KDE 5.25) for the Breeze GTK3 theme to be used in ~/.config/gtk-3.0/colors.css, see here. The values can be used to sync the GTK3 colors to your Qt color scheme (KDE/Plasma does this automatically).

The following example was generated by KDE/Plasma based on the "Breeze Dark" color scheme:

@define-color borders_breeze #5f6265;
@define-color content_view_bg_breeze #1b1e20;
@define-color error_color_backdrop_breeze #da4453;
@define-color error_color_breeze #da4453;
@define-color error_color_insensitive_backdrop_breeze #592930;
@define-color error_color_insensitive_breeze #592930;
@define-color insensitive_base_color_breeze #1a1d1f;
@define-color insensitive_base_fg_color_breeze #656768;
@define-color insensitive_bg_color_breeze #282c30;
@define-color insensitive_borders_breeze #3a3d41;
@define-color insensitive_fg_color_breeze #6e7173;
@define-color insensitive_selected_bg_color_breeze #282c30;
@define-color insensitive_selected_fg_color_breeze #6e7173;
@define-color insensitive_unfocused_bg_color_breeze #282c30;
@define-color insensitive_unfocused_fg_color_breeze #6e7173;
@define-color insensitive_unfocused_selected_bg_color_breeze #282c30;
@define-color insensitive_unfocused_selected_fg_color_breeze #6e7173;
@define-color link_color_breeze #1d99f3;
@define-color link_visited_color_breeze #9b59b6;
@define-color success_color_backdrop_breeze #27ae60;
@define-color success_color_breeze #27ae60;
@define-color success_color_insensitive_backdrop_breeze #1e4d34;
@define-color success_color_insensitive_breeze #1e4d34;
@define-color theme_base_color_breeze #1b1e20;
@define-color theme_bg_color_breeze #2a2e32;
@define-color theme_button_background_backdrop_breeze #31363b;
@define-color theme_button_background_backdrop_insensitive_breeze #2f3338;
@define-color theme_button_background_insensitive_breeze #2f3338;
@define-color theme_button_background_normal_breeze #31363b;
@define-color theme_button_decoration_focus_backdrop_breeze #3daee9;
@define-color theme_button_decoration_focus_backdrop_insensitive_breeze #335c72;
@define-color theme_button_decoration_focus_breeze #3daee9;
@define-color theme_button_decoration_focus_insensitive_breeze #335c72;
@define-color theme_button_decoration_hover_backdrop_breeze #3daee9;
@define-color theme_button_decoration_hover_backdrop_insensitive_breeze #335c72;
@define-color theme_button_decoration_hover_breeze #3daee9;
@define-color theme_button_decoration_hover_insensitive_breeze #335c72;
@define-color theme_button_foreground_active_backdrop_breeze #fcfcfc;
@define-color theme_button_foreground_active_backdrop_insensitive_breeze #6e7173;
@define-color theme_button_foreground_active_breeze #fcfcfc;
@define-color theme_button_foreground_active_insensitive_breeze #6e7173;
@define-color theme_button_foreground_backdrop_breeze #fcfcfc;
@define-color theme_button_foreground_backdrop_insensitive_breeze #727679;
@define-color theme_button_foreground_insensitive_breeze #727679;
@define-color theme_button_foreground_normal_breeze #fcfcfc;
@define-color theme_fg_color_breeze #fcfcfc;
@define-color theme_header_background_backdrop_breeze #2a2e32;
@define-color theme_header_background_breeze #31363b;
@define-color theme_header_background_light_breeze #2a2e32;
@define-color theme_header_foreground_backdrop_breeze #fcfcfc;
@define-color theme_header_foreground_breeze #fcfcfc;
@define-color theme_header_foreground_insensitive_backdrop_breeze #fcfcfc;
@define-color theme_header_foreground_insensitive_breeze #fcfcfc;
@define-color theme_hovering_selected_bg_color_breeze #3daee9;
@define-color theme_selected_bg_color_breeze #3daee9;
@define-color theme_selected_fg_color_breeze #fcfcfc;
@define-color theme_text_color_breeze #fcfcfc;
@define-color theme_titlebar_background_backdrop_breeze #2a2e32;
@define-color theme_titlebar_background_breeze #31363b;
@define-color theme_titlebar_background_light_breeze #2a2e32;
@define-color theme_titlebar_foreground_backdrop_breeze #fcfcfc;
@define-color theme_titlebar_foreground_breeze #fcfcfc;
@define-color theme_titlebar_foreground_insensitive_backdrop_breeze #fcfcfc;
@define-color theme_titlebar_foreground_insensitive_breeze #fcfcfc;
@define-color theme_unfocused_base_color_breeze #1b1e20;
@define-color theme_unfocused_bg_color_breeze #2a2e32;
@define-color theme_unfocused_fg_color_breeze #fcfcfc;
@define-color theme_unfocused_selected_bg_color_alt_breeze #1f485e;
@define-color theme_unfocused_selected_bg_color_breeze #1f485e;
@define-color theme_unfocused_selected_fg_color_breeze #fcfcfc;
@define-color theme_unfocused_text_color_breeze #fcfcfc;
@define-color theme_unfocused_view_bg_color_breeze #1a1d1f;
@define-color theme_unfocused_view_text_color_breeze #656768;
@define-color theme_view_active_decoration_color_breeze #3daee9;
@define-color theme_view_hover_decoration_color_breeze #3daee9;
@define-color tooltip_background_breeze #31363b;
@define-color tooltip_border_breeze #64686b;
@define-color tooltip_text_breeze #fcfcfc;
@define-color unfocused_borders_breeze #5f6265;
@define-color unfocused_insensitive_borders_breeze #3a3d41;
@define-color warning_color_backdrop_breeze #f67400;
@define-color warning_color_breeze #f67400;
@define-color warning_color_insensitive_backdrop_breeze #633914;
@define-color warning_color_insensitive_breeze #633914;