Summary: | Label prints using too small a font size | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Andrew Walker
2006-05-11 18:03:32 UTC
The problem here is that the non-"auto resize for text" label has a constant font size. This is marginally acceptable for display on the screen, but clearly collapses when exporting or printing. If we make the font size scale for printing and exporting then things would be greatly improved (though probably still a ways off from WYSIWYG). The (better) alternative would be to have the font size scale for screen display also (as they do in axes labels, legends, etc). SVN commit 544461 by arwalker: BUG:127148 Scale the font size correctly when printing or exporting labels. M +8 -2 kstviewlabel.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kstviewlabel.cpp #544460:544461 @@ -69,7 +69,7 @@ _justify = justify; _fontName = KstApp::inst()->defaultFont(); _fontSize = 0; - _absFontSize = _fontSize+KstSettings::globalSettings()->plotFontSize; + _absFontSize = _fontSize + KstSettings::globalSettings()->plotFontSize; _standardActions |= Delete | Edit; _parsed = 0L; _labelMargin = 0; @@ -95,7 +95,7 @@ _justify = 0L; _fontName = KstApp::inst()->defaultFont(); _fontSize = 0; - _absFontSize = _fontSize+KstSettings::globalSettings()->plotFontSize; + _absFontSize = _fontSize + KstSettings::globalSettings()->plotFontSize; _standardActions |= Delete | Edit; _parsed = 0L; reparse(); @@ -409,9 +409,13 @@ void KstViewLabel::paintSelf(KstPainter& p, const QRegion& bounds) { p.save(); if (p.type() == KstPainter::P_PRINT || p.type() == KstPainter::P_EXPORT) { + int absFontSizeOld = _absFontSize; + if (_autoResize) { adjustSizeForText(_parent->geometry()); } else { + _absFontSize = int( double(absFontSizeOld) * ( double(_geom.width() + _geom.height()) / + double(_geomOld.width() + _geomOld.height()) ) ); computeTextSize(_parsed); } KstBorderedViewObject::paintSelf(p, bounds); @@ -424,6 +428,8 @@ } drawToPainter(_parsed, p); + + _absFontSize = absFontSizeOld; } else { if (p.makingMask()) { p.setRasterOp(Qt::SetROP); |