I've pushed a repair for `text-outline` in the "draw-lib" package.
The implementation of `text-outline` used a small bitmap to accumulate the path, and Cairo apparently discards paths that are far enough outside the bitmap's region. The revised implementation uses a recording surface, instead, to avoid losing paths. At Thu, 28 May 2015 00:24:32 -0700 (PDT), Tim Brown wrote: > Folks, > > I am trying to place a string on a dc-path% with text-outline. > > --------------------------------------------------------------------- > #lang racket > (require pict racket/draw) > (define f (make-object font% 30 'default)) > (dc > (λ (d dx dy) > (define p (new dc-path%)) > (define old-brush (send d get-brush)) > (define old-pen (send d get-pen)) > (send* d > (set-pen (new pen% [width 1])) > (set-brush (new brush% [color "magenta"]))) > (send p text-outline f "abcd efgh XX 1234 qwerty" 10 20) > (send d draw-path p dx dy) > (displayln > (call-with-values > (λ () (send d get-path-bounding-box p 'path)) > list)) > > (send* d (set-brush old-brush) (set-pen old-pen))) > 800 200) > --------------------------------------------------------------------- > > When this is rendered, only the string "abcd efgh XX 1234 qwe" is shown. > The output from DrRacket is: > > ----------------------------------------------------------------- > Welcome to DrRacket, version 6.2.0.3--2015-05-02(6e8fb57/a) [3m]. > Language: racket [custom]; memory limit: 512 MB. > (10.746711244880203 30.399644209101325 418.0 38.0) > (11.0546875 30.5 418.4453125 38.0) > ------------------------------------------------------------------ > > Extending the string beyond "..qwerty", i.e. "..qwerty xxxx" does not cause > the truncation to move to the right; nor does it change the 418.0 calculated > width from get-path-bounding-box. > > These results are from Windows 8; but the issue first caused me concern on > Linux x86-64. > > Can anyone help? > > Tim Brown -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.