#13 KDE Font hintstyle none or slight "breaks" kdiff3

v1.0_(example)
open
nobody
None
1
2013-05-27
2013-05-24
Jeff B
No

Running KDE on Kubuntu 13.04 (on two different systems), if you change the font hintstyle to either "none" or "slight", the bottom part of kdiff3 (the merge/edit window) doesn't handle cursor positioning correctly. Clicking the mouse pointer results in a slight offset (to the left) of where the cursor actually ends up. Also, once the cursor is positioned, editing, such as hitting the backspace key, causes the wrong character to be affected. Basically, it looks like the cursor is shown in one spot, but kdiff3 acts like the cursor is a little to the right - about 1 character, at size 9. At larger fonts, you'll notice that the cursor is placed in the middle of a character, instead of before or after the character.

I've tried several fonts that come with Kubuntu, including DejaVu Sans Mono. Putting the hintstyle to medium eliminates the problem. Anti-aliasing doesn't seem to affect this.

I'm curious if anyone else can reproduce this behavior.

Discussion

  • Jeff B
    Jeff B
    2013-05-25

    Hi Joachim,

    Thanks for the response.

    I think you are right. I read that bug earlier, but must have not read it closely enough. I also verified that Ubuntu 9,12 fonts don't have the issue I was seeing. I spent so much time looking at the editing problem, I didn't even notice the alignment issues in the top (A,B,C) windows.

    Other than switching to the previously mentioned fonts, I was fixing this by copying the /etc/fonts/fonts.conf file to something like ~/myfonts.conf and adding xml statements to turn on hinting and set the style to medium. I then started kdiff3 by pre-pending the command with "FONTCONFIG_FILE=~/myfonts.conf". There may be a better way, but I couldn't find one. This allowed just kdiff3 to use medium hinting.

    Jeff

     
  • Joachim Eibl
    Joachim Eibl
    2013-05-25

    Hi Jeff,

    This is very interesting. Could you please attach your myfonts.conf or the diff when compared to your fonts.conf?

    Joachim

     
  • Jeff B
    Jeff B
    2013-05-27

    Hi Joachim,

    Here you go. Hope this helps.

    With this, I can set KDE to use "hintslight" hintstyle, but force kdiff3 to use "hintmedium". There is probably more elegant ways do do this, but without spending a ton of time tracing through all the fontconfig config files and flows, this works ok.

    Jeff

    jeff@Kubuntu:~$ diff -u /etc/fonts/fonts.conf ~/myfonts.conf
    --- /etc/fonts/fonts.conf       2012-08-22 00:16:46.000000000 -0400
    +++ /home/jeff/myfonts.conf     2013-05-24 20:03:58.008776205 -0400
    @@ -152,4 +152,17 @@
                    </rescan>
            </config>
    
    +<match target="font">
    + <edit mode="assign" name="hinting">
    +  <bool>true</bool>
    + </edit>
    +</match>
    +
    +<match target="font">
    + <edit mode="assign" name="hintstyle">
    +  <const>hintmedium</const>
    + </edit>
    +</match>
    +
     </fontconfig>
    
     
    Last edit: Jeff B 2013-05-27