Closed riuson closed 10 years ago
From onwards....@gmail.com on August 04, 2014 20:39:34
Changed line 475 in converterhelper.cpp to: _result = im.scaled(10_im.size(),Qt::KeepAspectRatio, Qt::FastTransformation);
so can see preview image better (could a scaling control be added to the Options-Preview dialog to make it easier to see the detail?).
Seems there is plenty of antialiasing in there, but someone my LCD panel isn't showing it. Oddly, for pure Blue text it works great on the panel, but not for pure Red or Pure Green?
From riu...@gmail.com on August 04, 2014 23:10:54
Ignored bits are truncated. Bits may be ORed: ... R3 >> 8 R2 >> 7 ...
Also, try create 16-bit font image with this modification:
diff --git a/classes/data/fontdocument.cpp b/classes/data/fontdocument.cpp
index c619d53..963a6d8 100644
--- a/classes/data/fontdocument.cpp
+++ b/classes/data/fontdocument.cpp
@@ -720,7 +720,7 @@ QImage FontDocument::drawCharacter(const QChar value, const QFont &font, const Q
imageWidth = charWidth;
imageHeight = charHeight;
}
- QImage result(imageWidth, imageHeight, QImage::Format_RGB32);
+ QImage result(imageWidth, imageHeight, QImage::Format_RGB16);
QPainter painter(&result);
painter.setFont(font);
@@ -736,7 +736,8 @@ QImage FontDocument::drawCharacter(const QChar value, const QFont &font, const Q
fontMetrics.ascent(),//+4
QString(value));
- return result;
+ QImage result2 = result.convertToFormat(QImage::Format_ARGB32);
+ return result2;
}
//-----------------------------------------------------------------------------
void FontDocument::mon_container_dataChanged(bool historyStateMoved)
Scale control will be added.
Status: Accepted
Owner: riu...@gmail.com
Attachment: 2014-08-05 12:04:53.png
From riu...@gmail.com on August 07, 2014 08:15:00
Please check new preview dialog. Branch 'develop': https://code.google.com/p/lcd-image-converter/source/detail?r=c84b01aa2ad13e019e7b98d772387b1a4bf30e32&name=develop
Attachment: preview3.png
From onwards....@gmail.com on August 10, 2014 19:20:55
Fantastic - I have it all working now - thanks so much for your help! It turns out there was also an unrelated bug in my embedded code which would write a pixel as black every so often which was the main cause of the missing antialiasing pixels.
However, your suggestion to change the QImage format to RGB16 seems to create better quality antialiased fonts also so keeping on using that (still experimenting here however). The extra feature you added of being able to enlarge the image in a preview window is definitely very handy however.
From riu...@gmail.com on August 19, 2014 23:33:52
Status: Fixed
From onwards....@gmail.com on August 04, 2014 11:49:22
What steps will reproduce the problem? 1. Create 100pt (also works with range of other sizes) Arial bold font in colour with antialiasing (255red on black background)
Fantastic bit of software by the way :-)
Original issue: http://code.google.com/p/lcd-image-converter/issues/detail?id=30