Version: 3.3.1-2.1 (using KDE KDE 3.3.1) Installed from: RedHat RPMs OS: Linux I have tried to change my appearance (spicifically fonts) from the kcontrol. After changing the appearance i have logged into the Gnome session. I surprised to see my hinting is enabled in Gnome, though it was not enabled. I have tried to change the hintings from the Kcontrol and Gnome's Main menu => preferences => Fonts => Details => Hinting. But the result remains the same. After that i have removed ~/.fonts.conf file, and logged into Gnome again. Then only my hinting is disabled.
Just now i got new thing. Open "kcontrol" (control-center). Click on "Appearance". Now when you click on "Fonts" in that then only it will create automatically ~/.fonts.conf automatically. Simply you can say that when you click on "Fonts" in the "Appearance" tab then "kcontrol" will create ~/.fonts.conf according to the 'configuration' settings of the checkbox "Use sub-pixel hinting for fonts" in the "Fonts" tab whether this checkbox is selected or not and make it default, and it affect Gnome settings also.
Not only does the kcm do that, I find it quite annoying that it decides to reformat my entire file when no changes are made. I was going to file a new bug, but found this one instead. Why does the kcm change or alter the file when you've cancelled out of the font dialog? I have a lot of custom adjustments and I have it formatted so that I can easily read it By simply opening the kcm, it reformats the entire file inserting anything that it feels is missing. Even if it's already there. One example, it will completely ignore this and re-enter the information using a <match> for each <edit> attribute. <match target="font" > <edit mode="assign" name="autohint"><bool>false</bool></edit> <edit mode="assign" name="hinting"><bool>true</bool></edit> <!-- <edit name="hintstyle"><const>hintmedium</const></edit> --> <edit mode="assign" name="rgba"><const>none</const></edit> <!-- Turn on System wide Antialias --> <edit mode="assign" name="antialias"><bool>true</bool></edit> </match> ------------Is Ignored and this is at the bottom---------- <match target="font" > <edit mode="assign" name="autohint" > <bool>false</bool> </edit> </match> <match target="font" > <edit mode="assign" name="hinting" > <bool>true</bool> </edit> </match> <match target="font" > <edit name="hintstyle" > <const>hintmedium</const> </edit> </match> <match target="font" > <edit mode="assign" name="rgba" > <const>none</const> </edit> </match> <!-- Turn on System wide Antialias --> <match target="font" > <edit mode="assign" name="antialias" > <bool>true</bool> </edit> </match> ----------- You'll notice it has decided to add an <edit> for "hintstyle" even though there is no setting in the original file. Please only write a fonts.conf file if something has changed, nothing should be altered by simply opening a dialog.
The same with KDE4 up to 4.1.96
4.2.1: still here. After a quick glance at kde4base-workspace/kcontrol/fonts/kxftconfig.cpp I think that file is broken in KXftConfig() -> reset() -> apply().
*** Bug 149455 has been marked as a duplicate of this bug. ***
*** Bug 209841 has been marked as a duplicate of this bug. ***
Still happens in 4.6.0. I've been trying to make sense of the font setting code for a few days and I.. haven't gotten very far. If I'm not mistaken, the code in KXftConfig looks for <match target="font"> <edit mode="assign" name="hintstyle"> <const>hintSOMETHING</const> </edit> </match> as a child of <fontconfig>. If it doesn't find that, it modifies .fonts.conf, adds its' own defaults (hintmedium, ...) and reformats the file in the process, even if you said "Use anti-aliasing -> System Settings" (from a quick glance, KXftConfig doesn't know anything about that option). If you "sudo chattr +i .fonts.conf", the file can't be modified anymore but depending on what's in it, the config options XftSubPixel and others might still be set to whatever in .kde4/share/config/kdeglobals. This also sets "Xft.hintstyle: ..." and others in the X server resource database (see "xrdb -query | grep Xft"). In my case, this usually resulted in un-subpixel-hinted fonts in Plasma applets and all KDE apps. The whole mechanism seems fragile to me. Users and distributions (like openSUSE) can set up elaborate .fonts.conf files dealing with hinting details (see for example the Infinality FreeType patches) and the fonts configuration dialog simply overrides everything. I still trying to make sense of the code so that I can get the "Please leave my settings alone" option to work (and make it the default if it isn't already). I'm also toying with the idea of rewriting/refactoring the module, since it looks like it hasn't been touched much since ancient times. By the way, what is this Xft configuration (the stuff in "xrdb -query | grep Xft") good for anymore? Afaik this method of font configuration is outdated, even if Qt still deals with it (src/gui/kernel/qapplication_x11.cpp).
(In reply to comment #7) > By the way, what is this Xft configuration (the stuff > in "xrdb -query | grep Xft") good for anymore? Afaik this method of font > configuration is outdated, even if Qt still deals with it > (src/gui/kernel/qapplication_x11.cpp). These X resources are screen-specific settings read by libXft. cairo and Qt also look at these settings to mimic libXft's behaviour. These are useful for setting the default screen properties, such indicating subpixel order and saying whether the user prefers hinting. Fontconfig <match target="font" > settings should override the X resource settings. They provide a means to tailor settings to the font. For example, preferring a lighter hintstyle for fonts that have bad TrueType instructions. Beware, however, that fontconfig settings are not only used for screen rendering but font rendering in general so it doesn't make sense, for example, to turn on hinting unconditionally in a fontconfig file. It probably makes sense to set the X resources if the user changes the corresponding font rendering preferences in Kcontrol (but preferably not if the user merely changes preferred fonts). It should not be necessary for Kcontrol to add any fontconfig rules at all, because applications take into account the X resources.
Created attachment 59264 [details] Do not modify .fonts.conf when loading it. Now nothing is written before the user clicks apply or ok. Thanks for your comment. I'm not sure if I can really remove the fontconfig stuff (I want to!). I tried setting hinting and subpixel hinting via .Xdefaults and removing my user .fonts.conf (openSUSE 11.4) and didn't get what I wanted. Dunno. Maybe I'm overlooking something? Where else is the config used where it doesn't make sense to set things unconditionally? I know that font substitutions take effect in e.g. Okular (poppler), but font hinting is disabled when viewing PDFs. Anyway, after blankly staring at my monitor for more than a month, I came up with a patch to solve the overwriting problem. Turns out that the file was modified in *loading* routines. Ouch. Now nothing is written before the user clicks apply or ok, the way it should be. Can somebody test this?
Created attachment 59266 [details] Do not modify .fonts.conf when loading it. Now nothing is written before the user clicks apply or ok. Thanks for your comment. I'm not sure if I can really remove the fontconfig stuff (I want to!). I tried setting hinting and subpixel hinting via .Xdefaults and removing my user .fonts.conf (openSUSE 11.4) and didn't get what I wanted. Dunno. Maybe I'm overlooking something? Where else is the config used where it doesn't make sense to set things unconditionally? I know that font substitutions take effect in e.g. Okular (poppler), but font hinting is disabled when viewing PDFs. Anyway, after blankly staring at my monitor for more than a month, I came up with a patch to solve the overwriting problem. Turns out that the file was modified in *loading* routines. Ouch. Now nothing is written before the user clicks apply or ok, the way it should be. Can somebody test this?
*** This bug has been confirmed by popular vote. ***
(In reply to comment #10) > Created an attachment (id=59266) [details] > Do not modify .fonts.conf when loading it. Now nothing is written before the > user clicks apply or ok. I had the same issue as described in bug 245664, and while trying to find a solution for it, I managed to duplicate your patch - down to the last byte :) So, I can confirm the patch works; not only does it prevent .fonts.conf from being overwritten when loading the fonts kcm, but as a side effect, it also prevents it from being overwritten when applying font changes when "Use anti-aliasing" is set to "System Settings".
Is this patch still not included in mainline?
(In reply to comment #13) > Is this patch still not included in mainline? Nope (and I don't have any commit-rights)
Created attachment 72365 [details] a patch to remove settings when "System defaults" are selected I wrote a patch to resolve problem that "System Settings" does not change any value. Now when you select "System Settings", the font setting module removes all of values that it appended to ~/.fonts.conf. If you are using openSUSE and KDE 4.8, you can download patched package from: https://build.opensuse.org/project/show?project=home%3Aftake%3Abranches%3AKDE%3ADistro%3AFactory This bug is really annoying. I hope this bug is resolved soon in official release. See also: https://bugzilla.novell.com/show_bug.cgi?id=768896
Mind posting your patch to reviewboard.kde.org for review?
No problem. Has Nikolaus's patch been submitted there? We need both patches to resolve this problem.
I have submitted to the review board: https://git.reviewboard.kde.org/r/119764/
Git commit f02df03cb87b4bb5724eec668d49126a5f52a1e7 by Eike Hein, on behalf of Fuminobu TAKEYAMA. Committed on 29/09/2014 at 09:22. Pushed by hein into branch 'master'. Fix BUG#105797: inappropriate fontconfig settings are saved when kcontrol/fonts is shown and no way to revert them Fix kcontrol/fonts saves fontconfig settings when it is opened. Add "System default" to each config. It removes a corresponding fontconfig entry made by this module. "System default" is now default values for sub-pixel rendering and hinting. Selecting "System default" also reverts Xft configs. REVIEW: 119764 M +40 -40 kcms/fonts/fonts.cpp M +3 -2 kcms/fonts/fonts.h M +67 -43 kcms/fonts/kxftconfig.cpp M +16 -9 kcms/fonts/kxftconfig.h http://commits.kde.org/plasma-desktop/f02df03cb87b4bb5724eec668d49126a5f52a1e7