[PATCH] Profile: add white outline to all text

Lubomir I. Ivanov neolit123 at gmail.com
Tue Jul 2 14:37:00 PDT 2013


dirk, i think you applied my previous patch where you didn't liked the outline?

the commit message for the better one was:
--------
To draw the white outline around profile text we trace a text path
using QPainterPath::addText() and then create a couple of
QGraphicsPathItem objects. One of the objects is outlined using
QPainterPathStroker and is placed at the bottom of a QGraphicsItemGroup
with a white brush. The other object holds the standard colored text
and is placed on top.

Notes:
- possibly quite expensive on older machines
- ProfileGraphicsView::plot_text() now returns a QGraphicsItemGroup
- QGraphicsSimpleTextItem uses a top-left baseline anchor
while QPainterPath::addText() uses a bottom-left baseline
which is a bit mysterious, requires the -3 offset for a match
and is possibly non-portable across fonts and sizes.

--------

lubomir
--


More information about the subsurface mailing list