Q: profile text outlines

Lubomir I. Ivanov neolit123 at gmail.com
Fri Jun 28 06:40:08 PDT 2013


On 28 June 2013 15:43, Tomaz Canabrava <tcanabrava at kde.org> wrote:
> On Fri, Jun 28, 2013 at 9:34 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>> On 28 June 2013 15:27, Tomaz Canabrava <tcanabrava at kde.org> wrote:
>>> On Fri, Jun 28, 2013 at 9:11 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>>>> in cairo we had text outlines such as a slight white glow, which
>>>> prevented blending with colored background items such as plot lines.
>>>> we also had the that when printing a colored or b/w profile. now, i've
>>>> tried to do the same with QGraphicsSimpleTextItem::setPen() (ref.
>>>> ProfileGraphicsView::plot_text) but the problem is that the outline is
>>>> positioned on top of the text fill and it does not look that good as
>>>> it decreases the size of the fill. to my knowledge it's not possible
>>>> to position the outline _below_ the fill or start the outline
>>>> _outside_ of the fill instead of strictly on top of it i.e. centered?
>>>>
>>>> as an alternative, i've tried using QPainterPath::addText,
>>>> QPainterPathStroker (which does what is described above) and making
>>>> ProfileGraphicsView::plot_text use QGraphicsPathItem instead, but this
>>>> ends to no avail as i cannot understand how to paint said items then.
>>>>
>>>> does anyone has suggestions on this topic?
>>>
>>> to plot anything on a QGraphicsView, you need to:
>>> 1 - position it on the scene, using scene coordinates
>>>
>>> item->setPos(  10, 20);
>>>
>>> 2 - put the item on the canvas
>>>
>>> scene()->addItem ( myPathItem );
>>
>> i think i'm aware of that, but the problem is particular to the text
>> outlining relative to style.
>> we need the white outline to start outside of the text fill or be
>> bellow it, so that it doesn't cover portions of it.
>
> lubomir, I don't know too - sorry,
> I searched a bit http://qt-project.org/forums/viewthread/1321
> but I usually used QGraphicsSimpleTextItem with outlines and didn't
> got problems with it.
> what's the problem with that aproach?
>

just sent a patch for that:
[PATCH] Profile: add white outline to all text

the profile uses bold text now, which kinda solves the issue in a
possibly more efficient way than using QPainterPathStroker.
of course if anyone has better suggestions, please go ahead...

lubomir
--


More information about the subsurface mailing list