Skip to content

Commit

Permalink
Windows|Client|libgui: Adjusted fonts and font rasterizing
Browse files Browse the repository at this point in the history
The text rasterization bitmap's width was one pixel too small. Also changed
the default Windows font.
  • Loading branch information
skyjake committed Jun 5, 2013
1 parent 46890ee commit 1584a52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/data/defaultstyle.pack/fonts.dei
Expand Up @@ -7,7 +7,7 @@
script { import Version, gui }

font default condition "Version.OS == 'windows'" {
family: Verdana
family: Segoe UI
size: 12pt
weight: normal
style: normal
Expand Down
7 changes: 6 additions & 1 deletion doomsday/libgui/src/font.cpp
Expand Up @@ -471,14 +471,19 @@ QImage Font::rasterize(String const &textLine,
QColor fgColor(foreground.x, foreground.y, foreground.z, foreground.w);
QColor bgColor(background.x, background.y, background.z, background.w);

QImage img(QSize(bounds.width(),
QImage img(QSize(bounds.width() + 1,
de::max(duint(d->metrics->height()), bounds.height()) + 1),
QImage::Format_ARGB32);
img.fill(bgColor.rgba());

QPainter painter(&img);
painter.setCompositionMode(QPainter::CompositionMode_Source);

/*#ifdef WIN32
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::TextAntialiasing);
#endif*/

int advance = 0;
RichFormat::Iterator iter(format);
while(iter.hasNext())
Expand Down

0 comments on commit 1584a52

Please sign in to comment.