[Interest] how to change thickness of text stroke in QML ?

Gunnar Sletta gunnar at sletta.org
Thu Mar 5 09:01:47 CET 2015


> On 05 Mar 2015, at 08:43, Alexander Ivash <elderorb at gmail.com> wrote:
> 
> Thank you, but unfortunately such approach disallows changing stroke thickness independently of font itself. I'd like to keep font 'normal' and get 5 pixel stroke around it. 

You could use http://doc.qt.io/qt-5/qml-qtquick-text.html#style-prop which gives you a 1 pixel outline. If you want to expand the outline further, you need to resort to blurring. http://doc.qt.io/qt-5/qml-qtgraphicaleffects-glow.html will do the job for you.

Keep in mind that blurring is very costly to perform at runtime though, so you want to keep the number of items with effects to a minimum and the area they span small to keep performance good.

cheers,
Gunnar

> 
> 2015-03-04 18:54 GMT+03:00 Portale Alessandro <Alessandro.Portale at theqtcompany.com>:
> font.weight
> 
> 
> Von: interest-bounces+alessandro.portale=theqtcompany.com at qt-project.org <interest-bounces+alessandro.portale=theqtcompany.com at qt-project.org> im Auftrag von Alexander Ivash <elderorb at gmail.com>
> Gesendet: Dienstag, 3. März 2015 19:45
> An: interest at qt-project.org
> Betreff: [Interest] how to change thickness of text stroke in QML ?
>  
> subj
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list