qres  

Vector deformation

This demo shows how to use advanced vector techniques to draw text using a QPainterPath.

We define a vector deformation field in the shape of a lens and apply this to all points in a path. This means that what is rendered on screen is not pixel manipulation, but modified vector representations of the glyphs themselves. This is visible from the high quality of the antialiased edges for the deformed glyphs.

To get a fairly complex path we allow the user to type in text and convert the text to paths. This is done using the QPainterPath::addText() function.

The lens is drawn using a single call to drawEllipse(), using a QRadialGradient to fill it with a specialized color table, giving the effect of the Sun's reflection and a drop shadow. The lens is cached as a pixmap for better performance.

x=ksȑ+P,W\$m]\dΊǭjłP(\N߯{=/v%g5=====dE* [oʪM՛w(9[ŕ,x,q]gq::+PmFk^۵;qtq(}.neYz/vn9{"npg_ƾe:ܺ_kZ4Veu`(ɞk=TK/fԝyb$ $)QPV݂hDJKPzF_6qduxabCx*,ySi]d: w|ժr&Yx5f%[}9Z8z5c8tʍlC_|t?d$u7zE5S򹞭V)q'Kp>JC>o[>M5 Kw3|u<|Yh覙* 6s=uj&H+#ax2(Љ y7ӅAnt4LӦ@},A8:L#&~4N,YF,uC7)_3JQW2i OdB:[YmʥJYߗJ4BKzH!Dֳ݉wT~JJS.qyr{"j!DӞQ }Ur)nd"bkb,ZγZˮcQf- -C(?5gy_`.E\]g?$h`:LMOx]0RL!bP?:1 <=L ξN%D9vM!S_rgܐ1O ߲J>ՔOIQ 2&.!q5X{M:A s7[ʖM_|pnNFYMtC6a#(4|t<1n*Of{FIs+{W#e!mK_K4c:R;OBg(Ph3vi'6iDDl9e k91:… r6^s[4+!Vbw@5Fh 30%ٯHG o6C<753ngeXkE{RwoqV|ir]˔B85/A`&>r>j̪[MSeW&ظx:Gа*75zP4*Q,eVsT}R)SoVwUrMg? :a[ wU=XuP؈<9A='mp~`{(x=?߹YMtUv`S~#,f`k 9,`2(s&pN WѾgNyPĶG{'zYO8- \4-N}GǜY'Ovu0A/h;GPs*61;5/ASa o>UY o%|8n@#Yw_d"ɯxa{\p0ⷄޒр䓅 zcîXT}, r`.b@I;,s܂3!y3ݔ*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