<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>111754</bug_id>
          
          <creation_ts>2005-08-30 10:30:50 +0000</creation_ts>
          <short_desc>Font Manager Needs the Ability to Control Font DPI</short_desc>
          <delta_ts>2006-11-11 08:23:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kcontrol</product>
          <component>general</component>
          <version>3.4.1</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matt T. Proud">khanreaper</reporter>
          <assigned_to name="Daniel Molkentin">molkentin</assigned_to>
          <cc>asraniel</cc>
    
    <cc>l.lunak</cc>
    
    <cc>yhager</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>300</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>369727</commentid>
    <comment_count>0</comment_count>
    <who name="Matt T. Proud">khanreaper</who>
    <bug_when>2005-08-30 10:30:50 +0000</bug_when>
    <thetext>Version:           3.4.1 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
OS:                Linux

On numerous machines running KDE on differing Linux distributions, I have noticed the fonts that KDE has chosen to use are often displayed in a non-optimal DPI, often resulting in their being rendered too large to be acceptable. With this in mind, even though one can set such things from the command line, it is imperative that KControl integrates some sort of a font DPI control mechanism.

I wish that I could give a screenshot for how poorly 100+ dpi rendered fonts look in a place where 96 dpi should be used.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370182</commentid>
    <comment_count>1</comment_count>
    <who name="Pau Tallada Crespí">pau_tallada</who>
    <bug_when>2005-09-01 15:02:04 +0000</bug_when>
    <thetext>*** This bug has been confirmed by popular vote. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>440238</commentid>
    <comment_count>2</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-05-19 14:53:35 +0000</bug_when>
    <thetext>*** Bug 124637 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>440253</commentid>
    <comment_count>3</comment_count>
    <who name="Lubos Lunak">l.lunak</who>
    <bug_when>2006-05-19 15:25:02 +0000</bug_when>
    <thetext>SVN commit 542498 by lunakl:

Make it possible to explicitly force 96DPI or 120DPI.
Apparently there are enough people who for some strange
reason think that using the real DPI is a bug.
FEATURE: 111754



 M  +36 -5     kcontrol/fonts/fonts.cpp  
 M  +3 -0      kcontrol/fonts/fonts.h  
 M  +13 -1     kcontrol/krdb/krdb.cpp  
 M  +11 -0     startkde  


--- trunk/KDE/kdebase/workspace/kcontrol/fonts/fonts.cpp #542497:542498
@@ -618,13 +618,26 @@
    cbAA = new QCheckBox( i18n( &quot;Use a&amp;nti-aliasing for fonts&quot; ), this);
    cbAA-&gt;setWhatsThis( i18n(&quot;If this option is selected, KDE will smooth the edges of curves in &quot;
                               &quot;fonts.&quot;));
-   lay-&gt;addStretch();
    QPushButton *aaSettingsButton = new QPushButton( i18n( &quot;Configure...&quot; ), this);
    connect(aaSettingsButton, SIGNAL(clicked()), SLOT(slotCfgAa()));
    connect(cbAA, SIGNAL(toggled(bool)), aaSettingsButton, SLOT(setEnabled(bool)));
    lay-&gt;addWidget( cbAA );
    lay-&gt;addWidget( aaSettingsButton );
+   lay-&gt;addStretch();
 
+   lay = new QHBoxLayout( layout, KDialog::spacingHint());
+   cbDpi = new QCheckBox( i18n( &quot;Force DPI&quot; ), this );
+   lay-&gt;addWidget( cbDpi );
+   comboDpi = new QComboBox( this );
+   comboDpi-&gt;insertItem( i18n( &quot;Normal fonts (96 DPI)&quot; ));
+   comboDpi-&gt;insertItem( i18n( &quot;Huge fonts (120 DPI)&quot; ));
+   comboDpi-&gt;setDisabled( true );
+   connect( cbDpi, SIGNAL( toggled( bool )), comboDpi, SLOT( setEnabled( bool )));
+   connect( cbDpi, SIGNAL( toggled( bool )), SLOT( changed()));
+   connect( comboDpi, SIGNAL( activated( int )), SLOT( changed()));
+   lay-&gt;addWidget( comboDpi );
+   lay-&gt;addStretch();
+
    layout-&gt;addStretch(1);
 
    aaSettings=new FontAASettings(this);
@@ -653,6 +666,7 @@
   useAA = true;
   cbAA-&gt;setChecked(useAA);
   aaSettings-&gt;defaults();
+  cbDpi-&gt;setChecked(false);
   emit changed(true);
 }
 
@@ -665,6 +679,13 @@
   kDebug(1208) &lt;&lt; &quot;AA:&quot; &lt;&lt; useAA &lt;&lt; endl;
   cbAA-&gt;setChecked(useAA);
 
+  KConfig cfgfonts(&quot;kcmfonts&quot;, true);
+  cfgfonts.setGroup(&quot;General&quot;);
+  int dpi = cfgfonts.readNumEntry( &quot;fontDPI&quot;, 0 );
+  cbDpi-&gt;setChecked( dpi == 96 || dpi == 120 );
+  comboDpi-&gt;setCurrentItem( dpi == 120 ? 1 : 0 );
+  dpi_original = dpi;
+
   emit changed(false);
 }
 
@@ -673,9 +694,18 @@
 
   for ( FontUseItem* i = fontUseList.first(); i; i = fontUseList.next() )
       i-&gt;writeFont();
-
   KGlobal::config()-&gt;sync();
 
+  KConfig cfgfonts(&quot;kcmfonts&quot;);
+  cfgfonts.setGroup(&quot;General&quot;);
+  int dpi;
+  if( !cbDpi-&gt;isChecked())
+      dpi = 0;
+  else
+      dpi = comboDpi-&gt;currentItem() == 0 ? 96 : 120;
+  cfgfonts.writeEntry( &quot;fontDPI&quot;, dpi );
+  cfgfonts.sync();
+
   // KDE-1.x support
   KSimpleConfig* config = new KSimpleConfig( QDir::homePath() + &quot;/.kderc&quot; );
   config-&gt;setGroup( &quot;General&quot; );
@@ -692,12 +722,13 @@
 
   kapp-&gt;processEvents(); // Process font change ourselves
 
-  if(aaSettings-&gt;save( useAA ) || (useAA != useAA_original) ) {
+  if(aaSettings-&gt;save( useAA ) || (useAA != useAA_original) || dpi != dpi_original) {
     KMessageBox::information(this,
       i18n(
-        &quot;&lt;p&gt;You have changed anti-aliasing related settings. This change will only affect newly started applications.&lt;/p&gt;&quot;
-      ), i18n(&quot;Anti-Aliasing Settings Changed&quot;), &quot;AAsettingsChanged&quot;, false);
+        &quot;&lt;p&gt;Some changes such as anti-aliasing or DPI settings will only affect newly started applications.&lt;/p&gt;&quot;
+      ), i18n(&quot;Font Settings Changed&quot;), &quot;FontSettingsChanged&quot;, false);
     useAA_original = useAA;
+    dpi_original = dpi;
   }
 
   runRdb(KRdbExportXftSettings);
--- trunk/KDE/kdebase/workspace/kcontrol/fonts/fonts.h #542497:542498
@@ -111,7 +111,10 @@
 
 private:
     bool useAA, useAA_original;
+    int dpi_original;
     QCheckBox *cbAA;
+    QCheckBox *cbDpi;
+    QComboBox* comboDpi;
     Q3PtrList &lt;FontUseItem&gt; fontUseList;
     FontAASettings *aaSettings;
 };
--- trunk/KDE/kdebase/workspace/kcontrol/krdb/krdb.cpp #542497:542498
@@ -38,7 +38,7 @@
 #include &lt;kdebug.h&gt;
 #include &lt;kglobalsettings.h&gt;
 #include &lt;kstandarddirs.h&gt;
-#include &lt;kprocess.h&gt;
+#include &lt;kprocio.h&gt;
 #include &lt;ksavefile.h&gt;
 #include &lt;ktempfile.h&gt;
 #include &lt;klocale.h&gt;
@@ -543,6 +543,18 @@
     }
     if(!subPixel.isEmpty())
       contents += &quot;Xft.rgba: &quot; + subPixel + &apos;\n&apos;;
+    KConfig cfgfonts(&quot;kcmfonts&quot;, true);
+    cfgfonts.setGroup(&quot;General&quot;);
+    if( cfgfonts.readNumEntry( &quot;fontDPI&quot;, 0 ) != 0 )
+      contents += &quot;Xft.dpi: &quot; + cfgfonts.readEntry( &quot;fontDPI&quot; ) + &apos;\n&apos;;
+    else
+    {
+      KProcIO proc;
+      proc &lt;&lt; &quot;xrdb&quot; &lt;&lt; &quot;-quiet&quot; &lt;&lt; &quot;-remove&quot; &lt;&lt; &quot;-nocpp&quot;;
+      proc.writeStdin( QByteArray( &quot;Xft.dpi&quot; ), true );
+      proc.closeWhenDone();
+      proc.start( KProcess::Block );
+    }
   }
 
   if (contents.length() &gt; 0)
--- trunk/KDE/kdebase/workspace/startkde #542497:542498
@@ -72,6 +72,7 @@
 kcmrandrrc [Screen1]
 kcmrandrrc [Screen2]
 kcmrandrrc [Screen3]
+kcmfonts General fontDPI 0
 EOF
 kstartupconfig
 if test $? -ne 0; then
@@ -136,6 +137,16 @@
     done
 fi
 
+if test &quot;$kcmfonts_general_fontdpi&quot; -eq 120; then
+    xrdb -quiet -merge -nocpp &lt;&lt;EOF
+Xft.dpi: 120
+EOF
+elif test &quot;$kcmfonts_general_fontdpi&quot; -eq 96; then
+    xrdb -quiet -merge -nocpp &lt;&lt;EOF
+Xft.dpi: 96
+EOF
+fi
+
 # Source scripts found in &lt;localprefix&gt;/env/*.sh and &lt;prefixes&gt;/env/*.sh
 # (where &lt;localprefix&gt; is $KDEHOME or ~/.kde, and &lt;prefixes&gt; is where KDE is installed)
 #
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>470478</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Hahler">kde-bugzilla</who>
    <bug_when>2006-09-17 04:23:27 +0000</bug_when>
    <thetext>IMHO this is not really &quot;RESOLVED&quot;: you can now only change between 96, 120 or &quot;NULL&quot;.

It would be far better to (additionally?) allow a custom value/number.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475312</commentid>
    <comment_count>5</comment_count>
    <who name="Viking do Cerrado">vikingdocerrado</who>
    <bug_when>2006-10-07 17:33:54 +0000</bug_when>
    <thetext>IMHO dAniel hAhler is right.

And maybe having a box for setting it inside
KDE Control Center\Appearance &amp; Themes\Fonts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485811</commentid>
    <comment_count>6</comment_count>
    <who name="Jon Ringle">mandrake</who>
    <bug_when>2006-11-11 08:23:33 +0000</bug_when>
    <thetext>When using KDE inside of a VMware virtual machine with the vmware-tools installed, and you resize the VMWare application then something recalculates the DPI with the assumption that the &quot;physical&quot; monitor dimensions is static. In a virtual machine, this does not hold true, since there is a virtual monitor that changes size in proportion to a change in resolution and the DPI in this case should remain constant. It would be nice if KDE would offer a means of forcing a DPI no matter what resolution is currently being used.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>