Bug 50962

Summary: size of country code string in flag is resolution dependant
Product: kcontrol Reporter: Magnus Kessler <magnus.kessler>
Component: kcmkeyboardAssignee: Patrick Dowler <dowler>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch for drawing the country code string with a fixed pixel size

Description Magnus Kessler 2002-11-20 02:23:37 UTC
Version:           2.0 (using KDE 3.1.0 (KDE 3.1 RC4))
Installed from:    compiled sources
Compiler:          gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
OS:          Linux (i686) release 2.4.19-16mdk

The size of the country code string in the kxkb control module and the system tray is resolution dependant. On a high resolution display (e.g. 133 dpi) the letters are much bigger than the available space in the fixed sized flag. The country code should be drawn in a font set to a PIXEL size not a POINT size. I will attach a patch to fix this issue.

Magnus
Comment 1 Magnus Kessler 2002-11-20 02:25:24 UTC
Created attachment 489 [details]
Patch for drawing the country code string with a fixed pixel size

since the flag has a fixed pixel size, so should the string displayed on it
Comment 2 Daniel Molkentin 2003-04-26 01:31:56 UTC
Subject: kdebase/kxkb

CVS commit by danimo: 

Applying suggested fix for 50962 by Magnus Kessler 

Fixes "size of country code string in flag is resolution dependant" (kicker applet)

CCMAIL:50962-done@bugs.kde.org


  M +8 -2      pixmap.cpp   1.27


--- kdebase/kxkb/pixmap.cpp  #1.26:1.27
@@ -74,5 +74,8 @@ const QPixmap& findPixmap(const QString&
         || code_ == "dvorak" ) {
     code = code.left(3);
-    p.setFont(QFont("helvetica", 9, QFont::Bold));
+    QFont font("sans");
+    font.setPixelSize(10);
+    font.setWeight(QFont::Bold);
+    p.setFont(font);
     p.setPen(Qt::black);
     p.drawText(2, 1, pm->width(), pm->height()-2, Qt::AlignCenter, code);
@@ -82,5 +85,8 @@ const QPixmap& findPixmap(const QString&
   else {
     code = code.left(pos).right(3);
-    p.setFont(QFont("helvetica", 10, QFont::Bold));
+    QFont font("sans");
+    font.setPixelSize(10);
+    font.setWeight(QFont::Bold);
+    p.setFont(font);
     p.setPen(Qt::black);
     p.drawText(1, 1, pm->width(), pm->height()-2, Qt::AlignCenter, code);