AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 44 |
r3wp | 965 |
total: | 1009 |
results window for this page: [start: 101 end: 200]
world-name: r3wp
Group: !AltME ... Discussion about AltME [web-public] | ||
BrianW: 15-Oct-2005 | silly question - is there a way to increase display font size in AltME? | |
Terry: 28-Feb-2006 | Ok, after all my complaints about font sizes in Altme on newer monitors, it looks like the next windows will deal with this... a quote.. Don't you hate it how, when you increase the resolution of your desktop, everything gets smaller? With widescreen LCD monitors sporting resolutions of 1920x1200, and even laptops with screens that high-res, the icons and text on your PC can become absolutely tiny when you run at the native resolution. Enabling large fonts and trying to scale your desktop icons in WinXP only sort-of works, and it breaks as many things as it fixes. With Vista, your plug-and-play monitor can tell your PC what size and resolution it is, and then Vista can scale everything appropriately. 12-point fonts will actually be 12 points, regardless of whether you're using a 1280x1024 19 LCD or an ultra-high-res laptop." | |
PeterWood: 7-Sep-2006 | The text size in minute even with the large font selected. Any hints? | |
yeksoon: 7-Sep-2006 | is it a font issue? | |
Group: RAMBO ... The REBOL bug and enhancement database [web-public] | ||
DideC: 17-May-2005 | I wonder what font AGG use ? None of the ASCII 128+ char are displayed, except 251 that show "OBJ" in a box !! | |
Cyphre: 18-May-2005 | Vincent, DideC: thanks for the report. I'll try to investigate more. But remember the current font handling in Rebol/AGG will be removed for the 1.3 version. (AA and vectorial fonts will be added once we found good crossplatform solution for it) | |
Gabriele: 18-May-2005 | maxim: it isn't just AA. font support is not multiplatform right now so it can't be left in. i'm sure we'll find a solution to this... | |
[unknown: 10]: 10-Aug-2005 | Linux 1.3 Beta -> When running this script and pressing the window im getting the following error -> view make face [ offset: 100x100 size: 300x100 edge: none pane: reduce [ make face [ offset: 0x0 size: 300x100 color: water edge: none text: "Modified Font Object Settings" font: make font [ name: "times" size: 20 style: 'bold color: white align: 'center valign: 'middle space: 4x4 shadow: 2x2 ] ] ] ] --- ERROR --- although its not a displayed event i think that it still should not dropout.. ** Script Error: Invalid path value: dirty? ** Where: evt-func ** Near: if all [ system/view/focal-face event/type = 'down not within? event/offset win-offset? system/view/focal-face system/view/focal-face/size system/view/focal-face/dirty? ] [ fac: system/view/focal-face unfocus if flag-face? fac on-unfocus [ do-face fac none fac/dirty?: none ] ] event >> | |
Henrik: 22-Oct-2006 | I accidentally put a string in the font size, like this: view layout [area font [size: "m"]] Windows gives me a small font, which seems right. On OSX I either get screen trashing inside the text area, hanging or a segmentation fault. | |
Volker: 24-Oct-2006 | font is smaller | |
Rebolek: 24-Oct-2006 | Actually, I see quite the opposite. Using following code: view layout [text "MIQXA" text "MIQXA" font [size: "m"]] the second line is bigger .I'm trying this on xubuntu 6.06 (using area has same results, but area is much bigger than text so it's harder to notice). I'm rebooting to Win to see the difference. | |
Rebolek: 24-Oct-2006 | so I tried on Win and the second line is so small so it's unreadable (font size 1 or something like that) | |
Anton: 9-Nov-2006 | [ if :action [feel: svvf/hot saved-area: true] if all [not flag-face? self as-is string? text] [trim/lines text] if none? text [text: copy ""] change font/colors font/color if none? size [size: -1x-1] xy: size if any [size/x < 0 size/y < 0] [ state: max 1x1 pane-size * 9 / 10 - offset if size/x < 0 [size/x: state/x] if size/y < 0 [size/y: state/y] size: (size-text self) + (edge-size? self) + (to-pair all [para (to-pair para/margin) + to-pair para/origin]) ] if xy/x > 0 [size/x: xy/x] if xy/y > 0 [size/y: xy/y] ] | |
Group: View ... discuss view related issues [web-public] | ||
Graham: 5-Jan-2005 | rebol [] newtimer: does [ inform layout [ timer2: info "00:00:00" 60 font [] rate 1 feel [ engage: func [face action event] [ if action = 'time [ timer2/text: now/time show timer2 ] ] ] ] ] view layout [ timer1: info "00:00:00" 60 font [] rate 1 feel [ engage: func [face action event] [ if action = 'time [ timer1/text: now/time show timer1 ] ] ] button "New timer" [newtimer] ] | |
Pekr: 8-Jan-2005 | btw - I don't like current face object structure at all! Imo we could have kind of graphics face, where subobjects like para, text, font would be removed, and then more rich face, for text ... but in terms of rich text, font, para and text are useless too, as they allow only one style per face, kind of ZX Spectrum to me, which allowed only one color per 8x8 pixel ;-) | |
Geomol: 12-Jan-2005 | Maybe a box like this: >> l: layout [b: box white font [size: 12 style: none shadow: none color: black] "text text text text text text text text"] >> b/size/y: second (size-text b) + 4x4 == 34 >> view l | |
DideC: 27-Jan-2005 | For the 'text flag, I have found. It is used by multi/color to dispatch tuple! values to face/font/color or face/color. | |
Group: Make-doc ... moving forward [web-public] | ||
eFishAnt: 29-Jan-2005 | a few more keystrokes for font than the old nroff / troff stuff. | |
Group: Linux ... [web-public] group for linux REBOL users | ||
Graham: 11-Dec-2006 | Also, the AGG font demos on the desktop appear to be broken. | |
Graham: 11-Dec-2006 | when you specify a font, you need to specifiy the abs path to that font ? | |
Gabriele: 11-Dec-2006 | Linux does not have any api to get to the ttf from the font name. | |
Graham: 11-Dec-2006 | so, for vectorial text, you specify the font with the absolute path. | |
Chris: 9-May-2007 | This may have been covered before, what is the status of font management on Linux? Particularly used with Wine? | |
Graham: 23-Feb-2008 | Gabriele .. are these bugs ( and the lack of scalable font support in draw ) being addressed in 2.7.6 ? | |
Group: !Readmail ... a Rebol mail client [web-public] | ||
Fabrice: 20-May-2005 | Received: from web26108.mail.ukl.yahoo.com ([217.12.10.232]) by mail.prosygma-asp.com (Merak 7.5.2) with SMTP id 1TI26716 for <[me-:-you-:-com]>; Tue, 26 Apr 2005 04:58:31 +0200 Received: (qmail 67900 invoked by uid 60001); 26 Apr 2005 02:58:30 -0000 Message-ID: <[20050426025830-:-67898-:-qmail-:-web26108-:-mail-:-ukl-:-yahoo-:-com]> Received: from [81.248.68.164] by web26108.mail.ukl.yahoo.com via HTTP; Tue, 26 Apr 2005 04:58:29 CEST Date: Tue, 26 Apr 2005 04:58:29 +0200 (CEST) From: Rodrigue <[you-:-me-:-com]> Subject: Re: Erreur lors de l'enregistrement d'une news To: Admin Rebol <[me-:-you-:-com]> In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-370637848-1114484309=:67141" Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 0517-0, 25/04/2005), Inbound message X-Antivirus-Status: Clean --0-370637848-1114484309=:67141 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Salut Fabrice, Peux tu me redire sous quel format je dois envoyer les photos Rodrigue Admin Rebol <[me-:-you-:-com]> wrote: Bonjour Rodrigue, >Salut Fabrice, >contrairement à ce que je t'expliquais hier soir, les news ne s'enregistrent pas. >voilà le message d'erreur : Peux-tu m'envoyer ce que tu veux mettre en ligne par @ ? Je vérifierais directement avec tes données car il n'y a pas de problème de mon côté pour ajouter les news. Merci. -- Fabrice --------------------------------- Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail --0-370637848-1114484309=:67141 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit <DIV>Salut Fabrice,</DIV> <DIV> </DIV> <DIV>Peux tu me redire sous quel format je dois envoyer les photos<BR></DIV> <DIV>Rodrigue</DIV> <DIV><BR><B><I>Admin Rebol <[me-:-you-:-com]></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Bonjour Rodrigue,<BR><BR>>Salut Fabrice,<BR>>contrairement à ce que je t'expliquais hier soir, les news ne s'enregistrent pas.<BR>>voilà le message d'erreur : <BR><BR>Peux-tu m'envoyer ce que tu veux mettre en ligne par @ ?<BR>Je vérifierais directement avec tes données car il n'y a pas de problème de mon côté pour ajouter les news.<BR><BR>Merci.<BR><BR>-- <BR>Fabrice<BR></BLOCKQUOTE><p> <hr size=1> Découvrez le nouveau Yahoo! Mail : <font color="red">250 Mo d'espace</font> de stockage pour vos mails !<br><a href="http://fr.rd.yahoo.com/mail/taglines/*http://us.rd.yahoo.com/evt=25917/*http://us.rd.yahoo.com/mail_fr/mail_campaigns/splash/taglines_250/default/*http://fr.promotions.yahoo.com/mail/creer28.html">Créez votre Yahoo! Mail</a> --0-370637848-1114484309=:67141-- | |
Group: Dialects ... Questions about how to create dialects [web-public] | ||
DideC: 12-Jan-2005 | It's the principle used by VID but by a function, not with 'parse (see grow-facets func in SVV) But it can't solve the datatype order : you can't passed Maxlength without Size ! But you can add another keyword to handle this case, like : ['maxlength set p integer! (maxlength: p)] It's what VID does : tuple! can be color or font color (depends the style you use). To be sure it's font color, you have the 'font-color keyword. | |
Pekr: 24-Aug-2009 | >> view layout [b: button "OK" red [probe reduce [b/color b/font/colors b/effect]]] [255.0.0 [255.255.255 255.180.75] [gradient 0x-1 255.32.32 223.0.0]] | |
Pekr: 24-Aug-2009 | hmm, seems b/color is the red color. b/font colors is font colors - normal and over, b/effect - dunno ... | |
Pekr: 24-Aug-2009 | >> view layout [b: button "OK" [probe reduce [b/color b/font/colors b/effect b/effects]]] [44.80.132 [255.255.255 255.180.75] [gradient 0x-1 66.120.192 44.80.132] [ [gradient 0x1 66.120.192 44.80.132] [gradient 0x-1 66.120.192 44.80.132] ] ] | |
Group: !RebGUI ... A lightweight alternative to VID [web-public] | ||
Vincent: 4-Mar-2005 | progress: make face [ effect: copy [draw [pen blue fill-pen blue box 0x0 0x0]] data: 0 font: none para: none feel: make feel [ redraw: func [face act pos] [ if act = 'show [ face/data: min 1 max 0 face/data face/effect/draw/box: to-pair reduce [to-integer face/size/x * face/data face/size/y] ] ] ] ] | |
Vincent: 5-Mar-2005 | anim: make face [ image: none rate: 1 edge: none font: none feel: make feel [ engage: func [face act event] [ if event/type = 'time [ face/image: first face/data face/data: either tail? next face/data [head face/data][next face/data] show face ] ] ] ] | |
shadwolf: 6-Mar-2005 | progress: make face [ effect: copy [draw [pen blue fill-pen blue box 0x0 0x0]] ; is copy needed? data: 0 font: none para: none feel: make feel [ redraw: func [face act pos] [ if act = 'show [ face/effect/draw/box: to pair! reduce [ to integer! face/size/x * face/data: min 1 max 0 face/data face/size/y ] recycle ] ] ] ] | |
shadwolf: 6-Mar-2005 | anim: make face [ edge: none font: none para: none feel: make feel [ engage: func [face act event] [ if event/type = 'time [ face/image: first face/data face/data: either tail? next face/data [head face/data] [next face/data] show face recycle ] ] ] rate: 1 ] | |
shadwolf: 29-Mar-2005 | insert tail sub/pane make item-f [;menu item type: 'item text: itm offset: oft root: sub font-colors: either dis? [[172.168.153 172.168.153]] [font-colors] font: make font [align: 'left color: font-colors/2] para: make para [wrap?: false origin: 22x1 + (lineh * 1x0)] size: 0x2 + get-tsize/fnt itm font | |
Ashley: 3-Apr-2005 | Latest build available at: http://www.dobeash.com/files/RebGUI-018.zip Highlights include: - New pwd-field widget - Updated tab-panel & radio-group widgets - Timer widget removed - Added Ctrl+Left & Ctrl+Right (word left / right) to edit feel - Display User's Guide updated to reflect previous changes - Menu widget and tabbing deferred until 0.1.9 Note that face edge, font, para and feel now default to none. Use default-* objects if your widgets need these attributes (this brings these attributes in line with the RebGUI philosophy of "absent unless specified"; and removes all the attribute: none assignments). | |
Ashley: 3-Apr-2005 | Just noticed some cursor placement issues with the new pwd-field widget. Add these two lines to fix: font: make default-font [name: font-fixed space: 2x0] para: make default-para [origin: 5x2] | |
shadwolf: 11-Apr-2005 | tab-panel: make face [ color: none pane: [] l-arw: none r-arw: none dir-buttons: false feel: make default-feel [ redraw: function [face act pos] [test-size test-wid] [ if act = 'show [face/pane/1/size: face/size - 0x20 ; ; test-wid: face/pane/1 ; test-size: test-wid/size/x ; if greater? test-size face/size/x [ ; either not dir-buttons [ ; dir-buttons: true ; insert tail face/pane face/l-arw: make arrow [ ; size: 20x20 ; offset: as-pair (face/size/x - 40) 0 ; data: 'left ; action: [print "you clicked left" ] ; ] do face/l-arw/init ; insert tail face/pane face/r-arw: make arrow [ ; size: 20x20 ; offset: as-pair (face/size/x - 20) 0 ; action: [print "you clicked right" ] ; data: 'right ; ] do face/r-arw/init ; ][ ; face/r-arw/offset: as-pair (face/size/x - 20) 0 ; face/l-arw/offset: as-pair (face/size/x - 40) 0 ; ] ; ] ; print "la liste des bouttn est plus grande que ce que l'on voit!!!" ] ] ] init: has [tab-offset last-tab] [ ; create main display area insert pane make face [ offset: 0x20 edge: default-edge] ; add tabs tab-offset: 0x0 insert tail pane make face [ offset: 0x0 pane: [] color: none ] container: last pane insert container/pane make face [ offset: 0x0 pane: [] color: none] foreach [title spec] data [ insert tail container/pane/1/pane make face [ offset: tab-offset size: 1x20 pane: [] text: title effect: reduce ['round edge-color 5 'draw copy []] resize: none font: make default-font [align: 'center valign: 'bottom] para: default-para feel: make default-feel [ over: func [face act pos] [ either act [ insert face/effect/draw compose [ ; compose required for AGG betas pen over-color line 3x1 (as-pair face/size/x - 4 1) line 2x2 (as-pair face/size/x - 3 2) line 1x3 (as-pair face/size/x - 2 3) ] show face ][ if face/parent-face/parent-face/parent-face/pane/1/pane <> face/data [ ; clear unless selected clear face/effect/draw show face ] ] ] engage: function [face act event] [pf old-face] [ if event/type = 'down [ pf: face/parent-face pf3: pf/parent-face/parent-face if pf3/pane/1/pane = face/data [return] ; has a new tab been selected? clear face/effect/draw old-face: pick pf/pane pf3/data ; find previous tab old-face/resize: pf3/size ; remember last size old-face/size: old-face/size - 0x1 ; deflag old clear old-face/effect/draw face/size: face/size + 0x1 ; flag new face/feel/over face true 0x0 pf3/data: index? find pf/pane face ; set new pane# pf3/pane/1/pane: face/data ; init tab panel if pf3/size <> face/resize [ ; recursive resize span-resize pf3/pane/1 pf3/size - face/resize face/resize: pf3/size ] show pf3 ] ] ] ] last-tab: last container/pane/1/pane last-tab/size/x: 10 + first size-text last-tab ; set tab title width display/layout "" spec last-tab ; generate tab spec into tab pane last-tab/data: last-tab/pane ; swap pane into data last-tab/pane: none ; clear pane last-tab/resize: size ; original panel size tab-offset/x: tab-offset/x + last-tab/size/x ; set offset for next tab title ] print "size et countainer a la con !!" probe size/x container/size: as-pair size/x 20 probe container/size/x container/pane/1/size: container/size container/pane/1/pane/1/size: container/pane/1/pane/1/size + 0x1 ; flag 1st tab data: 1 ; set pane# pane/1/pane: container/pane/1/pane/1/data ; init tab panel container/pane/1/pane/1/feel/over container/pane/1/pane/1 true 0x0 ; flag first as active ] ] | |
Group: SVG Renderer ... SVG rendering in Draw AGG [web-public] | ||
shadwolf: 23-Jun-2005 | REBOL [ Title: "SVG Demo" Owner: "Ashley G. Trüter" Version: 0.0.1 Date: 21-Jun-2005 Purpose: "Loads and displays a resizeable SVG file." History: { 0.0.1 Initial release } Notes: { Tested on very simple SVG icons Only a few basic styles / attributes / commands supported Does not handle sizes in units other than pixels (e.g. pt, in, cm, mm, etc) SVG path has an optional close command, "z" ... AGG shape equivalent auto-closes load-svg function needs to be totally refactored / optimized ... *sample only* } ] ; The following commands are available for path data: ; ; M = moveto ; L = lineto ; H = horizontal lineto ; V = vertical lineto ; C = curveto ; S = smooth curveto ; Q = quadratic Belzier curve ; T = smooth quadratic Belzier curveto ; A = elliptical Arc ; Z = closepath ;print: none ; comment out this line to enable debug messages load-svg: function [svg-file [file! string!] size [pair!]] [ id defs x y to-color to-byte draw-blk append-style svg-size scale-x scale-y ][ xml: either string? svg-file [parse-xml svg-file] [ unless %.svg = suffix? svg-file [to error! "File has an invalid suffix!"] parse-xml read svg-file ] unless xml/3/1/1 = "svg" [to error! "Could not find SVG header!"] ;unless find ["id" "xmlns"] xml/3/1/2/1 [to error! "Could not find ID header!"] ;unless xml/3/1/3/1/1 = "defs" [to error! "Could not find DEFS header!"] id: xml/3/1/2 defs: xml/3/1/3 ; ; --- Parse SVG id ; svg-size: either find ["32pt" "48pt" "72pt"] select id "width" [ switch select id "width" [ "72pt" [120x120] "48pt" [80x80] "32pt" [60x60] ] ][ as-pair to integer! any [select id "width" "100"] to integer! any [select id "height" "100"] ] x: to integer! any [select id "x" "0"] y: to integer! any [select id "y" "0"] scale-x: size/x / svg-size/x scale-y: size/y / svg-size/y ; ; --- Helper functions ; to-color: func [s [string!]] [ ; converts a string in the form "#FFFFFF" to a 4-byte tuple to tuple! load rejoin ["#{" next s "00}"] ] to-byte: func [s [string!]] [ ; converts a string with a value 0-1 to an inverted byte 255 - to integer! 255 * to decimal! s ] ; ; --- Parse SVG defs ; draw-blk: copy [] append-style: function [ command [string!] blk [block!] ][ x xy pen-color fill-color line-width mode size radius shape closed? matrix transf-command ][ xy: 0x0 size: 0x0 line-width: 1 matrice: make block! [] radius: none transf-command: none foreach [attr val] blk [ switch attr [ "transform" [print "tranform have been found" ;probe val halt val: parse val "()," transf-command: first val probe transf-command switch transf-command [ "matrix" [ foreach word val [ if not find word "matrix" [ insert tail matrice to-decimal word ] ] ] ] ] "style" [ foreach [attr val] parse val ":;" [ switch/default attr [ "font-size" [ ] "stroke" [ switch/default first val [ #"#" [pen-color: to-color val] #"n" [pen-color: none] ][ print ["Unknown stroke:" val] ] ] "stroke-width" [line-width: to decimal! val] "fill" [ fill-color: switch/default first val [ #"#" [to-color val] #"n" [none] ][ print ["Unknown fill value:" val] none ] ] "fill-rule" [ mode: switch/default val [ "evenodd" ['even-odd] ][ print ["Unknown fill-rule value:" val] none ] ] "stroke-opacity" [pen-color: any [pen-color 0.0.0.0] pen-color/4: to-byte val] "fill-opacity" [fill-color: any [fill-color 0.0.0.0] fill-color/4: to-byte val] "stroke-linejoin" [ insert tail draw-blk switch/default val [ "miter" [compose [line-join miter]] "round" [compose [line-join round]] "bevel" [compose [line-join bevel]] ][ print ["Unknown stroke-linejoin value:" val] none ] ] "stroke-linecap" [ insert tail draw-blk 'line-cap insert tail draw-blk to word! val ] ][ print ["Unknown style:" attr] ] ] ] "x" [xy/x: scale-x * val] "y" [xy/y: scale-y * val] "width" [size/x: scale-x * val] "height" [size/y: scale-y * val] "rx" [print "rx"] "ry" [radius: to decimal! val] "d" [ shape: copy [] x: none closed?: false foreach token load val [ switch/default token [ M [insert tail shape 'move] C [insert tail shape 'curve] L [insert tail shape 'line] z [closed?: true] ][ unless number? token [print ["Unknown path command:" token]] either x [insert tail shape as-pair x scale-y * token x: none] [x: scale-x * token] ] ] ] ] ] insert tail draw-blk compose [ pen (pen-color) fill-pen (fill-color) fill-rule (mode) line-width (line-width * min scale-x scale-y) ] switch command [ "rect" [ insert tail draw-blk compose [box (xy) (xy + size)] if radius [insert tail draw-blk radius] ] "path" [ unless closed? [print "Path closed"] either transf-command <> none [ switch transf-command [ "matrix" [insert tail draw-blk compose/only [ (to-word transf-command) (matrice) shape (shape) reset-matrix]] ] ][ insert tail draw-blk compose/only [shape (shape)] ] ] "g" [ print "Write here how to handle G insertion to Draw block" insert tail draw-blk probe compose/only [reset-matrix (to-word transf-command) (matrice)] ] ] ] probe defs foreach blk defs [ switch first blk [ "rect" [append-style first blk second blk] "path" [append-style first blk second blk] "g" [ print "key word" probe first blk print "matrix and style in G" probe second blk append-style first blk second blk ;print "what to draw in G" probe third blk foreach blk2 third blk [ probe blk2 switch first blk2[ "path" [append-style first blk2 second blk2] ] ] ] ] ] probe draw-blk draw-blk ] view make face [ offset: 100x100 size: 200x200 action: request-file/filter/only "*.svg" text: rejoin ["SVG Demo [" last split-path action "]"] data: read action color: white effect: compose/only [draw (load-svg data size)] edge: font: para: none feel: make feel [ detect: func [face event] [ if event/type = 'resize [ insert clear face/effect/draw load-svg face/data face/size show face ] if event/type = 'close [quit] ] ] options: [resize] ] | |
shadwolf: 23-Jun-2005 | REBOL [ Title: "SVG Demo" Owner: "Ashley G. Trüter" Version: 0.0.1 Date: 21-Jun-2005 Purpose: "Loads and displays a resizeable SVG file." History: { 0.0.1 Initial release } Notes: { Tested on very simple SVG icons Only a few basic styles / attributes / commands supported Does not handle sizes in units other than pixels (e.g. pt, in, cm, mm, etc) SVG path has an optional close command, "z" ... AGG shape equivalent auto-closes load-svg function needs to be totally refactored / optimized ... *sample only* } ] ; The following commands are available for path data: ; ; M = moveto ; L = lineto ; H = horizontal lineto ; V = vertical lineto ; C = curveto ; S = smooth curveto ; Q = quadratic Belzier curve ; T = smooth quadratic Belzier curveto ; A = elliptical Arc ; Z = closepath ;print: none ; comment out this line to enable debug messages load-svg: function [svg-file [file! string!] size [pair!]] [ id defs x y to-color to-byte draw-blk append-style svg-size scale-x scale-y ][ xml: either string? svg-file [parse-xml svg-file] [ unless %.svg = suffix? svg-file [to error! "File has an invalid suffix!"] parse-xml read svg-file ] unless xml/3/1/1 = "svg" [to error! "Could not find SVG header!"] ;unless find ["id" "xmlns"] xml/3/1/2/1 [to error! "Could not find ID header!"] ;unless xml/3/1/3/1/1 = "defs" [to error! "Could not find DEFS header!"] id: xml/3/1/2 defs: xml/3/1/3 ; ; --- Parse SVG id ; svg-size: either find ["32pt" "48pt" "72pt"] select id "width" [ switch select id "width" [ "72pt" [120x120] "48pt" [80x80] "32pt" [60x60] ] ][ as-pair to integer! any [select id "width" "100"] to integer! any [select id "height" "100"] ] x: to integer! any [select id "x" "0"] y: to integer! any [select id "y" "0"] scale-x: size/x / svg-size/x scale-y: size/y / svg-size/y ; ; --- Helper functions ; to-color: func [s [string!]] [ ; converts a string in the form "#FFFFFF" to a 4-byte tuple to tuple! load rejoin ["#{" next s "00}"] ] to-byte: func [s [string!]] [ ; converts a string with a value 0-1 to an inverted byte 255 - to integer! 255 * to decimal! s ] ; ; --- Parse SVG defs ; draw-blk: copy [] append-style: function [ command [string!] blk [block!] ][ x xy pen-color fill-color line-width mode size radius shape closed? matrix transf-command ][ xy: 0x0 size: 0x0 line-width: 1 matrice: make block! [] radius: none transf-command: none foreach [attr val] blk [ switch attr [ "transform" [print "tranform have been found" ;probe val halt val: parse val "()," transf-command: first val probe transf-command switch transf-command [ "matrix" [ foreach word val [ if not find word "matrix" [ insert tail matrice to-decimal word ] ] ] ] ] "style" [ foreach [attr val] parse val ":;" [ switch/default attr [ "font-size" [ ] "stroke" [ switch/default first val [ #"#" [pen-color: to-color val] #"n" [pen-color: none] ][ print ["Unknown stroke:" val] ] ] "stroke-width" [line-width: to decimal! val] "fill" [ fill-color: switch/default first val [ #"#" [to-color val] #"n" [none] ][ print ["Unknown fill value:" val] none ] ] "fill-rule" [ mode: switch/default val [ "evenodd" ['even-odd] ][ print ["Unknown fill-rule value:" val] none ] ] "stroke-opacity" [pen-color: any [pen-color 0.0.0.0] pen-color/4: to-byte val] "fill-opacity" [fill-color: any [fill-color 0.0.0.0] fill-color/4: to-byte val] "stroke-linejoin" [ insert tail draw-blk switch/default val [ "miter" [compose [line-join miter]] "round" [compose [line-join round]] "bevel" [compose [line-join bevel]] ][ print ["Unknown stroke-linejoin value:" val] none ] ] "stroke-linecap" [ insert tail draw-blk 'line-cap insert tail draw-blk to word! val ] ][ print ["Unknown style:" attr] ] ] ] "x" [xy/x: scale-x * val] "y" [xy/y: scale-y * val] "width" [size/x: scale-x * val] "height" [size/y: scale-y * val] "rx" [print "rx"] "ry" [radius: to decimal! val] "d" [ shape: copy [] x: none closed?: false foreach token load val [ switch/default token [ M [insert tail shape 'move] C [insert tail shape 'curve] S [insert tail shape 'curv] L [insert tail shape 'line] Q [insert tail shape 'qcurve] T [insert tail shape 'qcurv] z [closed?: true] H [insert tail shape 'hline] V [insert tail shape 'vline] A [insert tail shape 'arc] ][ unless number? token [print ["Unknown path command:" token]] either x [insert tail shape as-pair x scale-y * token x: none] [x: scale-x * token] ] ] ] ] ] insert tail draw-blk compose [ pen (pen-color) fill-pen (fill-color) fill-rule (mode) line-width (line-width * min scale-x scale-y) ] switch command [ "rect" [ insert tail draw-blk compose [box (xy) (xy + size)] if radius [insert tail draw-blk radius] ] "path" [ unless closed? [print "Path closed"] either transf-command <> none [ switch transf-command [ "matrix" [insert tail draw-blk compose/only [ (to-word transf-command) (matrice) shape (shape) reset-matrix]] ] ][ insert tail draw-blk compose/only [shape (shape)] ] ] "g" [ print "Write here how to handle G insertion to Draw block" insert tail draw-blk probe compose/only [reset-matrix (to-word transf-command) (matrice)] ] ] ] probe defs foreach blk defs [ switch first blk [ "rect" [append-style first blk second blk] "path" [append-style first blk second blk] "g" [ print "key word" probe first blk print "matrix and style in G" probe second blk append-style first blk second blk ;print "what to draw in G" probe third blk foreach blk2 third blk [ probe blk2 switch first blk2[ "path" [append-style first blk2 second blk2] ] ] ] ] ] probe draw-blk draw-blk ] view make face [ offset: 100x100 size: 200x200 action: request-file/filter/only "*.svg" text: rejoin ["SVG Demo [" last split-path action "]"] data: read action color: white effect: compose/only [draw (load-svg data size)] edge: font: para: none feel: make feel [ detect: func [face event] [ if event/type = 'resize [ insert clear face/effect/draw load-svg face/data face/size show face ] if event/type = 'close [quit] ] ] options: [resize] ] | |
shadwolf: 23-Jun-2005 | REBOL [ Title: "SVG Demo" Owner: "Ashley G. Trüter" Version: 0.0.1 Date: 21-Jun-2005 Purpose: "Loads and displays a resizeable SVG file." History: { 0.0.1 Initial release } Notes: { Tested on very simple SVG icons Only a few basic styles / attributes / commands supported Does not handle sizes in units other than pixels (e.g. pt, in, cm, mm, etc) SVG path has an optional close command, "z" ... AGG shape equivalent auto-closes load-svg function needs to be totally refactored / optimized ... *sample only* } ] ; The following commands are available for path data: ; ; M = moveto ; L = lineto ; H = horizontal lineto ; V = vertical lineto ; C = curveto ; S = smooth curveto ; Q = quadratic Belzier curve ; T = smooth quadratic Belzier curveto ; A = elliptical Arc ; Z = closepath ;print: none ; comment out this line to enable debug messages load-svg: function [svg-file [file! string!] size [pair!]] [ id defs x y to-color to-byte draw-blk append-style svg-size scale-x scale-y ][ xml: either string? svg-file [parse-xml svg-file] [ unless %.svg = suffix? svg-file [to error! "File has an invalid suffix!"] parse-xml read svg-file ] unless xml/3/1/1 = "svg" [to error! "Could not find SVG header!"] ;unless find ["id" "xmlns"] xml/3/1/2/1 [to error! "Could not find ID header!"] ;unless xml/3/1/3/1/1 = "defs" [to error! "Could not find DEFS header!"] id: xml/3/1/2 defs: xml/3/1/3 ; ; --- Parse SVG id ; svg-size: either find ["32pt" "48pt" "72pt"] select id "width" [ switch select id "width" [ "72pt" [120x120] "48pt" [80x80] "32pt" [60x60] ] ][ as-pair to integer! any [select id "width" "100"] to integer! any [select id "height" "100"] ] x: to integer! any [select id "x" "0"] y: to integer! any [select id "y" "0"] scale-x: size/x / svg-size/x scale-y: size/y / svg-size/y ; ; --- Helper functions ; to-color: func [s [string!]] [ ; converts a string in the form "#FFFFFF" to a 4-byte tuple to tuple! load rejoin ["#{" next s "00}"] ] to-byte: func [s [string!]] [ ; converts a string with a value 0-1 to an inverted byte 255 - to integer! 255 * to decimal! s ] ; ; --- Parse SVG defs ; draw-blk: copy [] append-style: function [ command [string!] blk [block!] ][ x xy pen-color fill-color line-width mode size radius shape closed? matrix transf-command ][ xy: 0x0 size: 0x0 line-width: 1 matrice: make block! [] radius: none transf-command: none foreach [attr val] blk [ switch attr [ "transform" [print "tranform have been found" ;probe val halt val: parse val "()," transf-command: first val probe transf-command switch transf-command [ "matrix" [ foreach word val [ if not find word "matrix" [ insert tail matrice to-decimal word ] ] ] ] ] "style" [ foreach [attr val] parse val ":;" [ switch/default attr [ "font-size" [ ] "stroke" [ switch/default first val [ #"#" [pen-color: to-color val] #"n" [pen-color: none] ][ print ["Unknown stroke:" val] ] ] "stroke-width" [line-width: to decimal! val] "fill" [ fill-color: switch/default first val [ #"#" [to-color val] #"n" [none] ][ print ["Unknown fill value:" val] none ] ] "fill-rule" [ mode: switch/default val [ "evenodd" ['even-odd] ][ print ["Unknown fill-rule value:" val] none ] ] "stroke-opacity" [pen-color: any [pen-color 0.0.0.0] pen-color/4: to-byte val] "fill-opacity" [fill-color: any [fill-color 0.0.0.0] fill-color/4: to-byte val] "stroke-linejoin" [ insert tail draw-blk switch/default val [ "miter" [compose [line-join miter]] "round" [compose [line-join round]] "bevel" [compose [line-join bevel]] ][ print ["Unknown stroke-linejoin value:" val] none ] ] "stroke-linecap" [ insert tail draw-blk 'line-cap insert tail draw-blk to word! val ] ][ print ["Unknown style:" attr] ] ] ] "x" [xy/x: scale-x * val] "y" [xy/y: scale-y * val] "width" [size/x: scale-x * val] "height" [size/y: scale-y * val] "rx" [print "rx"] "ry" [radius: to decimal! val] "d" [ shape: copy [] x: none closed?: false if all [x not number? token] [ insert tail shape x * either token = 'V [scale-y][scale-x] x: none ] foreach token load val [ switch/default token [ M [insert tail shape 'move] C [insert tail shape 'curve] S [insert tail shape 'curv] L [insert tail shape 'line] Q [insert tail shape 'qcurve] T [insert tail shape 'qcurv] z [closed?: true] H [insert tail shape 'hline] V [insert tail shape 'vline] A [insert tail shape 'arc] ][ unless number? token [print ["Unknown path command:" token]] either x [insert tail shape as-pair x scale-y * token x: none] [x: scale-x * token] ] ] ] ] ] insert tail draw-blk compose [ pen (pen-color) fill-pen (fill-color) fill-rule (mode) line-width (line-width * min scale-x scale-y) ] switch command [ "rect" [ insert tail draw-blk compose [box (xy) (xy + size)] if radius [insert tail draw-blk radius] ] "path" [ unless closed? [print "Path closed"] either transf-command <> none [ switch transf-command [ "matrix" [insert tail draw-blk compose/only [ (to-word transf-command) (matrice) shape (shape) reset-matrix]] ] ][ insert tail draw-blk compose/only [shape (shape)] ] ] "g" [ print "Write here how to handle G insertion to Draw block" insert tail draw-blk probe compose/only [reset-matrix (to-word transf-command) (matrice)] ] ] ] probe defs foreach blk defs [ switch first blk [ "rect" [append-style first blk second blk] "path" [append-style first blk second blk] "g" [ print "key word" probe first blk print "matrix and style in G" probe second blk append-style first blk second blk ;print "what to draw in G" probe third blk foreach blk2 third blk [ probe blk2 switch first blk2[ "path" [append-style first blk2 second blk2] ] ] ] ] ] probe draw-blk draw-blk ] view make face [ offset: 100x100 size: 200x200 action: request-file/filter/only "*.svg" text: rejoin ["SVG Demo [" last split-path action "]"] data: read action color: white effect: compose/only [draw (load-svg data size)] edge: font: para: none feel: make feel [ detect: func [face event] [ if event/type = 'resize [ insert clear face/effect/draw load-svg face/data face/size show face ] if event/type = 'close [quit] ] ] options: [resize] ] | |
Group: AltWeb ... AltME Web Mirror [web-public] | ||
Alek_K: 9-Jul-2005 | why not use styles? <td valign="top"><font color="#7878E6"><b></b></font></td> - instead can be <td class="person"></td>? I think it could take off about 30% of code. | |
Group: Rebol School ... Rebol School [web-public] | ||
Vladimir: 26-Oct-2007 | What could be problem with this script? set-net [[user-:-mail-:-com] smtp.mail.com pop3.mail.com] today: now/date view center-face layout [ size 340x120 button "Send mail" font [size: 26] 300x80 [ send/attach/subject [user-:-mail-:-com] "" %"/c/file.xls" reduce [join "Today " :danas] quit ] ] I get this error: ** User Error: Server error: tcp 554 5.7.1 <[user-:-mail-:-com]>: Relay access denied ** Near: insert smtp-port reduce [from reduce [addr] message] Could it be some security issue? It worked with previous internet provider... A week ago we changed it and now this happens... Should I contact my provider to change some security settings or should I change something in the script? | |
Group: Windows/COM Support ... [web-public] | ||
PeterWood: 17-Sep-2006 | The drug list is in the HTML: <select name="drugList" id="drugList" size="8" style="width:280px; font-family: verdana; font-size:10pt;" onDblClick="addDrugToList();"> <option value="4055" title="2-Amino-2-Deoxyglucose">2-Amino-2-Deoxyglucose</option> <option..... | |
Group: AJAX ... Web Development Using AJAX [web-public] | ||
Terry: 8-Dec-2005 | Tahoma is a nice font. | |
Group: Tech News ... Interesting technology [web-public] | ||
Oldes: 13-Jun-2006 | and correct font | |
Group: SQLite ... C library embeddable DB [web-public]. | ||
Louis: 16-Nov-2006 | What am I doing wrong here: rebol [] do %sqlite.r do %rebgui.r if not exists? %id.txt [write %id.txt 1] db: %indodex.db either not exists? db [ CONNECT/create/flat/direct/format db SQL "create table base (id, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota)" SQL "create table birthdays (id, Nama, Jenis, Hubungan, Tgl_Lahir, Agama, Nota)" ][ CONNECT/flat/direct/format db ] unless value? 'ctx-rebgui [ either exists? %rebgui-ctx.r [do %rebgui-ctx.r] [do %rebgui.r] ] set-colors tab-size: 120x55 fonts: reduce [font-sans-serif font-fixed font-serif "verdana"] do show-cc: make function! [] [ display "IndoDex Ver. 1.0.1" [ tab-panel #HW data [ "Add" [ label "Title:" priority: drop-list 30 #W "Pak" data ["Pak" "Ibu" "Sdr." "Sdri." "Drs." "Dr." "Tuan" "Nyonya"] 20x5 return label "Nama:" nama: field return label "Alamat:" alamat: area 50x30 return label "Telefon" telefon: field return label "Handfon" handfon: field return label "Fax:" fax: field return label "E-Mail:" email: field return label "Nota:" nota: area 50x30 return button "Save" [ (id: to-integer read %id.txt) SQL/flat/direct {insert into base values (id, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota)} (write %id.txt id) show-text ex-status "Saved"] ] "Edit" [ ] "Search" [ ] ] ] ] do-events | |
Louis: 16-Nov-2006 | Here's the latest version: rebol [] do %sqlite.r do %rebgui.r unless value? 'ctx-rebgui [ either exists? %rebgui-ctx.r [do %rebgui-ctx.r] [do %rebgui.r] ] set-colors tab-size: 120x55 fonts: reduce [font-sans-serif font-fixed font-serif "verdana"] if not exists? %id.txt [write %id.txt 1] i: to-integer read %id.txt i: i - 1 either not exists? %indodex.db [ CONNECT/create %indodex.db SQL "create table base (ID, Title, Nama, Alamat, Telefon, Handfon, Fax, Email, Tgl_Nikah, Nota)" SQL "create table birthdays (ID, Nama, Jenis, Hubungan, Tgl_Lahir, Agama, Nota)" ][ CONNECT %indodex.db ] do show-cc: make function! [] [ set-colors display "IndoDex Ver. 1.0.1" [ label 16 "ID:" id: text (to-string i) return label 16 "Title:" title: drop-list 30 #W "Pak" data ["Pak" "Ibu" "Sdr." "Sdri." "Drs." "Dr." "Tuan" "Nyonya"] 20x5 return label 16 "Nama:" nama: field return label 16 "Alamat:" alamat: area 50x30 return label 16 "Telefon:" telefon: field return label 16 "Handfon:" handfon: field return label 16 "Fax:" fax: fax: field return label 16 "E-Mail:" email: field return label 16 "Nota:" nota: area 50x30 return button "Save" [ ;UNCOMMENT THE FOLLOWING LINES AND YOU WILL SEE THEY DON'T WORK. ANYBODY KNOW WHAT IS WRONG? ;SQL reduce ["insert into base values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" id/text, title/text, nama/text, alamat/text, telefon/text, handfon/text, fax/text, email/text, tgl_nikah/text, nota/text] ;SQL {insert into base values ('Pak' 'Ibu' 'Sdr.' 'Sdri.' 'Drs.' 'Dr.' 'Tuan' 'Nyonya' 'Jonew')} (i: to-integer i) (i: i + 1) (write %id.txt i) (i: to-string i) ] button "GUI Info [ print [id/text " " title/text " " nama/text " " alamat/text newline] ] button "DB Info" [ print TABLES SQLite/col-info?: true print SQL "select * from base" print SQLite/columns ] button "Halt" [ halt ] button "Quit" [ quit ] ] ] do-events | |
Group: !REBOL3-OLD1 ... [web-public] | ||
Maxim: 31-Mar-2006 | word wrap queries (like in the old amiga api) within AGG draw would be cool too... as in, what would the size of this text (or any gfx element, for that matter) be with current font/drawing settings. and how many letters from a string fit within this box ? wrapped or not. | |
Group: Postscript ... Emitting Postscript from REBOL [web-public] | ||
Geomol: 7-Apr-2006 | PostScript dialect test ready. Try this: do http://home.tiscali.dk/postscript/postscript.r s: postscript [font ["Times-Roman" 20] ["Hello World!"]] s is now the PostScript output, that can be saved to a PS-file or sent to a printer. | |
Geomol: 7-Apr-2006 | Oh, misunderstood. Try: s: postscript [font ["Times-Roman" 20] [at 72x72 "Hello World!"]] | |
Geomol: 7-Apr-2006 | So far, you can specify font, set position and print text. | |
Geomol: 7-Apr-2006 | Desitions have to be made about the dialect structure. Should the outer block consist of font-specifications and pages, or isn't that structure the best for PS? A better understanding of PS is needed to answer. | |
Graham: 7-Apr-2006 | at 72x72 font Helvetica-Bold 6.0 "Hello World!" | |
Geomol: 7-Apr-2006 | Would it be normal in PS to define the font before anything else, and then describe pages with paths? Is that the structure? | |
Geomol: 7-Apr-2006 | New version. The postscript block consists of font definitions and pages. A page consists of paths and transformations. Try: do http://home.tiscali.dk/john.niclasen/postscript/postscript.r print postscript [font [Times-Roman 20] page [path [at 72x72 rotate 45 "Hello World!"]]] | |
Geomol: 7-Apr-2006 | The "page" and "path" words are optional, so this'll give same result: print postscript [font [Times-Roman 20] [[at 72x72 rotate 45 "Hello World!"]]] | |
Geomol: 7-Apr-2006 | setcm seems to influence font size. Try: do http://home.tiscali.dk/john.niclasen/postscript/postscript.r write %test.ps postscript [page [font [Times-Roman 1] setcm linewidth 0.5 path [setgray 0.5 at 2.5 2 box 8 12] path [at 5x8 rotate 45 "Hello World!"]]] | |
Geomol: 8-Apr-2006 | Another example: write %test.ps postscript [page [font [Times-Roman 40] linewidth 0 path [at 72x720 "REBOL PostScript Dialect"] path [line 72x716 520x716] font [Times-Roman 16] path [at 96x680 "With this dialect it's possible to easily produce PostScript output."] font [Helvetica-Oblique 12] [at 72x72 "PostScript is copyright Adobe."]]] | |
Geomol: 8-Apr-2006 | Example with different fonts: write %test.ps postscript [[font [Verdana 20][at 72x700 "Verdana"] font [Helvetica 20] [at 72x650 "Helvetica"] font [Times-Roman 20] [at 72x600 "Times"]]] I guess, it looks at the fonts installed on the system. I'm not sure, how 'clever' it is to guess the names. | |
[unknown: 9]: 8-Apr-2006 | Yeah, in QML we ran into the same font problem. So what we did was make Times, Helv, and Courier forced to be the defaults, then allowed any font name to be called as bassed to a variable as the real name of the font. On windows you can have font names with spaces "Times New Roman" for example. By have the top three just be one simple word everyone can remember I figured it would make people happy. | |
Graham: 13-Apr-2006 | test: form ps [ font Times-Roman 40 linewidth 0 at 72x720 "REBOL PostScript Dialect" at 72x716 line 520x716 font Times-Roman 16 at 96x680 "With this dialect it's possible to easily produce PostScript output." font Courier 24 at 96x600 "You can use different fonts." font Times-Roman 16 gsave at 120x550 rotate -30 "Make" grestore gsave at 160x450 rotate 30 scale 2 4 "transformations" grestore at 96x400 "And do graphics:" at 100x320 box 200x40 stroke gsave at 180x240 rotate 20 setgray .6 box 100x80 fill grestore at 150x250 line 200x290 180x305 194x340 font Helvetica-Oblique 12 at 72x72 "Postscript is copyright Adobe." ] | |
Graham: 13-Apr-2006 | ps/header [ newpage "Title" at 72x72 font Times-Roman 12 "page 1" showpage newpage "Body" at 144x144 "page 2" showpage ] | |
Geomol: 15-Apr-2006 | Looks good, Graham. I hope to get time one of the comming days to investigate PS a little more, so the dialect can be more complete. I like your idea about getting rid of blocks, and I hope to make a consistent version with few blocks, maybe only for font. | |
Graham: 15-Apr-2006 | text: [err: set txt string! ( fontcount: fontcount + 1 set to-word join "font" fontcount make face/font compose [ size: (fontsize) name: (fontname) color: (rgb) ] pos/y: pos/y - fontsize repend output [ 'font (to-word join "font" fontcount) 'pen rgb 'text 'vectorial txt pos ] ) ] | |
Graham: 15-Apr-2006 | Can someone check these to see if they are correctly matched ? The left hand is the postscript font, and the right hand is the true type font | |
Maxim: 15-Apr-2006 | I always thought arial was wider than Helvetica in aspect... but I've never really compared them to see if they are really the same font... | |
Anton: 18-Apr-2006 | No, I mean all the different text strings disappear and reappear at different times as you drag the slider. Something to do with font size ? | |
Anton: 18-Apr-2006 | Maybe scale-draw creates a font object with a size which is not supported ? | |
Anton: 18-Apr-2006 | font1: make object! [ name: "Nimbus Roman No9 L" style: none size: 33 color: 255.0.0 offset: 2x2 space: 0x0 align: 'center valign: 'center shadow: none ] font2: make object! [ name: "Nimbus Roman No9 L" style: none size: 13 color: 0.0.0 offset: 2x2 space: 0x0 align: 'center valign: 'center shadow: none ] view layout [box 500x700 white effect [draw [ box 0x0 493x698 fill-pen none box 0x0 493x698 line-width 0 font font1 pen 255.0.0 text vectorial "REBOL PostScript Dialect" 59x68 pen 0.0.0 line 59x104 431x104 font font2 pen 0.0.0 text vectorial {With this dialect it's possible to easily produce PostScript output.} 79x121 ]]] | |
Anton: 18-Apr-2006 | but it does when font/size is at 15 instead of 13..... | |
Graham: 18-Apr-2006 | Anton, did you download that font pack I pointed to ? | |
Graham: 18-Apr-2006 | and where do you get the hint data from? Is it read from the font somehow? | |
Anton: 18-Apr-2006 | Good idea to put a link to the font pack into the ps2draw.r header. | |
Gabriele: 18-Apr-2006 | Graham: yes, and data is parsed from the Adobe Font Metrics file and included in pdf-maker.r for the 14 standard postscript fonts. | |
Graham: 18-Apr-2006 | Gabriele, do you have a reference on how to use this font metric data ? | |
Graham: 18-Apr-2006 | >> layout [ a: text "this is a line" font [ size: 20 ]] >> line-list: make system/view/line-info [] >> textinfo a line-list 0 >> probe line-list make object! [ start: "this is a line" num-chars: 14 offset: 2x2 size: 104x23 ] >> layout [ a: text "this is a line" font [ size: 12 ]] >> textinfo a line-list 0 >> probe line-list make object! [ start: "this is a line" num-chars: 14 offset: 2x2 size: 68x15 ] | |
Henrik: 18-Apr-2006 | throw in a font definition | |
Henrik: 18-Apr-2006 | center: func [text width font] [ width / 2 - second size-text make face compose [ text: (text) font: (font) ] ] | |
Henrik: 18-Apr-2006 | center: func [text width font] [ (width / 2) - (first size-text make face compose copy [ text: (text) font: (font) size: (as-pair width 100) ]) ] | |
Henrik: 18-Apr-2006 | center: func [text size font] [ (size/x / 2) - (first size-text make face compose copy [ text: (text) font: (font) size: (size) ]) ] | |
Henrik: 18-Apr-2006 | center: func [text size font] [ divide subtract size/x first size-text make face compose copy [ text: (text) font: (font) size: (size) ] 2 ] | |
Henrik: 18-Apr-2006 | the offset gets bigger when using a larger font.. wonder what causes it | |
Henrik: 18-Apr-2006 | anyhoo: img: draw make image! 297x210 compose [pen red font (make face/font [size: 30]) text (as-pair center "BOOM!" 297x210 make face/font [size: 30] 20) "BOOM!"] view layout [image img] | |
Henrik: 19-Apr-2006 | http://www.hmkdesign.dk/run14.png<--- the offset can be seen at the bottom. I haven't tested, but maybe the kerning between the VID and DRAW font rendering isn't the same. | |
Graham: 19-Apr-2006 | If you look at my layout examples above, you can see that the font size is not the same as the point size used in View. | |
Henrik: 19-Apr-2006 | that's right. the font points are of a smaller dpi than the coordinate system it seems | |
Henrik: 19-Apr-2006 | I think the font size is bound to the screen resolution | |
Graham: 20-Apr-2006 | font. | |
Henrik: 20-Apr-2006 | it'll have to be worked around for now. if the size deviation is proportional to the size of the font, it could be fixed with a coefficient on the font size of the DRAW text | |
Graham: 20-Apr-2006 | Is this indicative of the current problem? >> foreach typeface ["arial" "times new roman" "verdana" "trebuchet ms"][ [ layout [tx: text font [name: typeface size: 10] do [probe second size-text tx]] [ ] 13 12 12 15 | |
Henrik: 22-Apr-2006 | because of the stupid differences in font sizes | |
Henrik: 22-Apr-2006 | yes, at least in a clear way to make sure that the postscript is like it should be: that centered output really is centered, font size is completely accurate and such | |
Group: !Liquid ... any questions about liquid dataflow core. [web-public] | ||
Maxim: 13-Mar-2009 | glue now has a plug that returns gfx text size given any value and a font :-) | |
Maxim: 13-Mar-2009 | ------------------------------------------------- NOTE: FROM NOW ON, every usable !plug definition that I post will be in black, to make it easy to differentiate from test code, and copy in your own libs. ------------------------------------------------- ;- glue-proc-face: glue-proc-face: make face [size: 100x100] ;----------------- ;- !gfx-text-area ;----------------- ; this class returns the area which a value, when represented as a string, occupies. ; ; returns: a pair representing width and height ; ; usage: ; linked only, unlabeled. (filling this node will permanently freeze it) ; ; inputs: ; (1) [any!] value ; the first input is formed to a string, or set to "" ; ; (2) [object!:font] font to use ; the test will be run with this font, irrelevant of what font is currently set in the face. ; ; <TO DO>: add explicit support for /para facet ;----------------- !gfx-text-area: make !plug [ liquid: 0x0 ;----------------- ;- frozen?() ;----------------- ; plug won't do anything until you have proper linkage done. ;----------------- frozen?: func [ ][ vin ["" self/valve/type {/frozen?()}] vout (2 <> length? subordinates) ] valve: make valve [ ;----------------- ;- process() ;----------------- process: func [ plug data ][ vin ["" self/valve/type {/process()}] plug/liquid: 0x0 glue-proc-face/font: data/2 glue-proc-face/size: 1000x1000 glue-proc-face/text: any [ attempt [to-string data/1] "" ] plug/liquid: size-text glue-proc-face vout ] ] ] | |
Group: gfx math ... Graphics or geometry related math discussion [web-public] | ||
Maxim: 24-Feb-2010 | the same problem is the basis for poor font aliasing. | |
Group: DevCon2008 (post-chatter) ... DevCon2008 [web-public] | ||
Reichart: 17-Dec-2008 | ================== Current video list ================== - Times Roman font is ugly - Welcome page needs a better looking welcome page (put it in a nice standard box) - Stealing Vista UI on video is a copyright infringement. - Bottom controls (just under 3 video frames) were hidden when I first came in (I needed to pull the iframe down). - "Who is online" needs to be a list on the left side. - The chance to send video took about 3 minutes, so I did not see how to do this. The video box should say it will do this for you at some point. - Chat box shows "viewer n" as opposed to <name> - Each iframe seems to come up too small. - Chat buffer is too small (and allows too few characters. - Echo is a big problem (Other systems have this problem, but TeamSpeak less than others). | |
Reichart: 17-Dec-2008 | ================== Current video list (ver 2) ================== - What is the actual architecture here? - Times Roman font is ugly - Welcome page needs a better looking welcome page (put it in a nice standard box) - Stealing Vista UI on video is a copyright infringement. - Bottom controls (just under 3 video frames) were hidden when I first came in (I needed to pull the iframe down). - "Who is online" needs to be a list on the left side. - The chance to send video took about 3 minutes, so I did not see how to do this. The video box should say it will do this for you at some point. - Chat box shows "viewer n" as opposed to <name> - Each iframe seems to come up too small. - Chat buffer is too small (and allows too few characters. - Echo is a big problem (Other systems have this problem, but TeamSpeak less than others). = Screen shot capture = - Change [Download screen sender] to [Download Windows Screen Sender]. Or just ad Windows icon. - Add icons to all functions at bottom, like an upload icon for Upload. - Rename [RockFactory] to same name as it thinks it is PNGShot.exe. My virus catcher was NOT happy about this program running. | |
Reichart: 18-Dec-2008 | Yes, better...neeeds Helv font everywhere. | |
Group: Printing ... [web-public] | ||
Dockimbel: 4-Sep-2008 | Quite well so far. I currently only supports the following Draw commands : text, line, box, font, pen | |
Graham: 29-Sep-2008 | pagesize A4 font Times-BoldItalic 30 linewidth 1 at 190x750 My-Name color (black) font Times-Roman 12 newpath at 75x725 line1 at 75x715 line2 at 75x705 line3 at 445x715 "Ph: " at 465x715 ph at 445x705 "Fx: " at 465x705 fx at 438x680 "Date:" font Times-Bold at 465x680 consult-date font Times-Roman 11 newpath at 75x740 line 530x740 newpath at 75x700 line 530x700 at 75x680 Provider-Template at 75x600 "Dear " at 100x600 Provider flow-translate 0x0 flowbox 75x150 540x590 float 20 flow-translate 0x0 flowbox 75x150 540x720 gonzo flow consult gonzo flow-translate 0x0 flowbox 75x150 540x720 float 10 flow-translate 0x0 flowbox 75x72 540x720 float 50 showpage |
101 / 1009 | 1 | [2] | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |