[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    koffice/kspread
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2007-01-14 16:16:34
Message-ID: 1168791394.512001.3302.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 623351 by nikolaus:

Painting	Use the same approach to scale for the header's font as the cells.

		Do we need to scale the font? KoZoomHandler takes the screen
		resolution into account. 100% zoom results generally not in
		factors of 1.0 (at least not at 86x86 dpi). The factors are used
		for QPainter::scale(). I tried to measure the font size on
		screen for a Arial, 72 pt font at 500 % zoom level.
		QFont::pointSize() returns the points between the lowest and the
		highest position a character extends to.
		I took 'lp' as chars, but neither the 'unscaled' nor the 'scaled'
		font gives me 72 pt (78 pt and 65 pt respectively). Do I have to
		use other characters for the measurement?

		If we have to scale, the current approach takes only the
		vertical dimension into account. Is there another way to get
		the QPainter's scaled font size outside paint events?

		Questions over questions. Any font expert around?

CCMAIL: koffice-devel@kde.org


 M  +4 -0      Border.cpp  
 M  +1 -0      CellView.cpp  


--- trunk/koffice/kspread/Border.cpp #623350:623351
@@ -553,6 +553,8 @@
 
   // fonts
   QFont normalFont( painter.font() );
+  // FIXME Stefan: Find a better way to scale the font. X- and Y-resolution may vary!
+  normalFont.setPointSizeF( normalFont.pointSizeF() / m_pCanvas->d->view->doc()->resolutionY() );
   QFont boldFont( normalFont );
   boldFont.setBold( true );
 
@@ -1261,6 +1263,8 @@
 
   // fonts
   QFont normalFont( painter.font() );
+  // FIXME Stefan: Find a better way to scale the font. X- and Y-resolution may vary!
+  normalFont.setPointSizeF( normalFont.pointSizeF() / m_pCanvas->d->view->doc()->resolutionY() );
   QFont boldFont( normalFont );
   boldFont.setBold( true );
 
--- trunk/koffice/kspread/CellView.cpp #623350:623351
@@ -1735,6 +1735,7 @@
 {
     QFont tmpFont( d->style.font() );
     // Scale the font size according to the current zoom.
+    // FIXME Stefan: Find a better way to scale the font. X- and Y-resolution may vary!
     tmpFont.setPointSizeF( tmpFont.pointSizeF() / cell->doc()->resolutionY() );
     return tmpFont;
 }
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic