Can R3's�0„2Draw Dialect handle characters?

Started by Rex on 22-Sep-2014/11:10:09-7:00
Is there a way to add some letters to the picture I draw with the draw dialect? e.g. draw a circle and add "rex" to the center of it.
Hi Rex -1st example- R E B O L [] do %r3-gui.r3 ;gui view [ -drawing [ --anti-alias on --fill-pen red --circle viewport-box/center 120 --text (as-pair 0 viewport-box/center/y) [ ---center ---bold size 20 "Rex" --] -] 320x320 ] -2nd example- R E B O L [] do %r3-gui.r3 ;image img-size: 320x320 save/all %image.png do draw make image! reduce [img-size white 0] to-draw reduce [ -'anti-alias on -'fill-pen red -'circle (img-size / 2) 120 -'text as-pair 0 (img-size/y / 2) [ --center --bold size 20 "Rex" -] ] copy []
-3rd example- R E B O L [] do %r3-gui.r3 size: 320x320 ;gui use para view [ -drawing (reduce [ --'anti-alias on --'fill-pen red --'circle 'viewport-box/center (size/x / 2) --'text 0x0 reduce [ ---'para make system/standard/para [ ----valign: 'middle ---] ---'center ---'bold 'size 20 "Rex" --] -]) size ] -4th example- R E B O L [] do %r3-gui.r3 ;image use para img-size: 320x320 save/all %image.png do draw make image! reduce [img-size white 0] to-draw reduce [ -'anti-alias on -'fill-pen red -'circle (img-size / 2) (img-size/x / 2) -'text 0x0 reduce [ --'para make system/standard/para [ ---valign: 'middle --] --'center --'bold 'size 20 "Rex" -] ] copy []
Draw document and example: http://rebol.net/wiki/Draw
I also looked for a way to do this, but didn't find anything.
Thanks, Linh. The technique is quite complicated, and I'll need some time to digest it. But I am very glad when I know this is indeed possible.

Reply