Re: [racket-users] Sandbox + 2htdp/image

2020-05-28 Thread Stephen Foster
Ooooh, okay.  That explanation helps a lot.  Both of these paths seem
workable.  I'll see what I can do.

Thanks, Robby!

On Thu, May 28, 2020 at 3:17 PM Robby Findler 
wrote:

> Just in case, the general phenomenon happening here is that you've got two
> instantiations of the image library (I believe that mrlib/image-core is the
> essential one that's getting duplicated in this case) so there are two
> different sets of structs for the representation of images and the one
> doesn't recognize the other.
>
> There are two basic approaches, I guess: you could run everything
> image-related inside the sandbox (including, I suppose, turning it into a
> bitmap or svg or something) and then getting it out of the sandbox, or you
> could share the implementation of the image library between the inside and
> outside of the sandbox. The former approach is more secure but maybe less
> convenient; the latter is the other way around.
>
> If you wanted to share the implementation you'd have to set up the sandbox
> not with a fresh namespace, but with a namespace that already has the same
> instantiation of mrlib/image-core as the one you want to use outside the
> sandbox.
>
> Robby
>
>
> On Thu, May 28, 2020 at 5:03 PM Stephen Foster 
> wrote:
>
>> I was using the image? predicate as an arbitrary example of something
>> you might want to do with an image after extracting it from the sandbox.
>> What if I wanted to pass the result along to beside or overlay?
>>
>> In all cases, these functions don't recognize the result as an image:
>>
>> beside: expects an image as first argument, given (object:image% #f #f #f
>> #f 1 0 (object:image-snipclass% #f "((lib \"image-core.ss\" \"mrlib\") (lib
>> \"image-core-wxme.rkt\" \"mrlib\"))" 1) #0=(object:style% (object:color% 0
>> 0 0 1.0 #f) (object:color% 255 255 255 1.0 #f) (object:font% #f 'aligned
>> '#(12...
>>
>> On Tue, May 26, 2020 at 4:58 PM Robby Findler 
>> wrote:
>>
>>> It might be easiest to just use the `image?` predicate from inside the
>>> sandbox. Get it out the same way you got the image itself out.
>>>
>>> Robby
>>>
>>>
>>> On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
>>> wrote:
>>>
 The following returns #f and #t.  How can I get it to return #t and #t?

 Context: I want to allow students to run Racket code on my server. But
 when I sandbox their code, I am getting back something that doesn't behave
 like a 2htdp/image object.  I'm not exactly sure what it is.

 #lang racket

 (require racket/sandbox 2htdp/image)

 (sandbox-path-permissions
   (list
 '(exists
"/usr/lib/ssl/cert.pem")
 '(exists
"/usr/lib/ssl/certs")))

 (define user-code '(circle 40 'solid 'red))

 (define circle1
   ((make-evaluator 'racket
`(define f
   (let ()
 ,user-code))
#:requires
'(2htdp/image))
'f))

 (define circle2
   (circle 40 'solid 'red))

 (image? circle1) ;#f but I want it to be #t
 (image? circle2) ;#t


 If it helps, when I print out the above values with ~a, I get:

 "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse
 80 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"

 "#(struct:object:image% ...)"

 --
 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.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/racket-users/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com
 
 .

>>>
>>
>> --
>>
>>
>> Stephen Foster
>> ThoughtSTEM Co-Founder
>> 318-792-2035
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/CA%2BzSu29untSJzX0yuyzbOuCiz_xewsgkXBkYHZVnLeHBkwT1mg%40mail.gmail.com
>> 
>> .
>>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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.
To view this discussion on the web visit 

Re: [racket-users] Sandbox + 2htdp/image

2020-05-28 Thread Robby Findler
Just in case, the general phenomenon happening here is that you've got two
instantiations of the image library (I believe that mrlib/image-core is the
essential one that's getting duplicated in this case) so there are two
different sets of structs for the representation of images and the one
doesn't recognize the other.

There are two basic approaches, I guess: you could run everything
image-related inside the sandbox (including, I suppose, turning it into a
bitmap or svg or something) and then getting it out of the sandbox, or you
could share the implementation of the image library between the inside and
outside of the sandbox. The former approach is more secure but maybe less
convenient; the latter is the other way around.

If you wanted to share the implementation you'd have to set up the sandbox
not with a fresh namespace, but with a namespace that already has the same
instantiation of mrlib/image-core as the one you want to use outside the
sandbox.

Robby


On Thu, May 28, 2020 at 5:03 PM Stephen Foster 
wrote:

> I was using the image? predicate as an arbitrary example of something you
> might want to do with an image after extracting it from the sandbox.  What
> if I wanted to pass the result along to beside or overlay?
>
> In all cases, these functions don't recognize the result as an image:
>
> beside: expects an image as first argument, given (object:image% #f #f #f
> #f 1 0 (object:image-snipclass% #f "((lib \"image-core.ss\" \"mrlib\") (lib
> \"image-core-wxme.rkt\" \"mrlib\"))" 1) #0=(object:style% (object:color% 0
> 0 0 1.0 #f) (object:color% 255 255 255 1.0 #f) (object:font% #f 'aligned
> '#(12...
>
> On Tue, May 26, 2020 at 4:58 PM Robby Findler 
> wrote:
>
>> It might be easiest to just use the `image?` predicate from inside the
>> sandbox. Get it out the same way you got the image itself out.
>>
>> Robby
>>
>>
>> On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
>> wrote:
>>
>>> The following returns #f and #t.  How can I get it to return #t and #t?
>>>
>>> Context: I want to allow students to run Racket code on my server. But
>>> when I sandbox their code, I am getting back something that doesn't behave
>>> like a 2htdp/image object.  I'm not exactly sure what it is.
>>>
>>> #lang racket
>>>
>>> (require racket/sandbox 2htdp/image)
>>>
>>> (sandbox-path-permissions
>>>   (list
>>> '(exists
>>>"/usr/lib/ssl/cert.pem")
>>> '(exists
>>>"/usr/lib/ssl/certs")))
>>>
>>> (define user-code '(circle 40 'solid 'red))
>>>
>>> (define circle1
>>>   ((make-evaluator 'racket
>>>`(define f
>>>   (let ()
>>> ,user-code))
>>>#:requires
>>>'(2htdp/image))
>>>'f))
>>>
>>> (define circle2
>>>   (circle 40 'solid 'red))
>>>
>>> (image? circle1) ;#f but I want it to be #t
>>> (image? circle2) ;#t
>>>
>>>
>>> If it helps, when I print out the above values with ~a, I get:
>>>
>>> "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse 80
>>> 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"
>>>
>>> "#(struct:object:image% ...)"
>>>
>>> --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/racket-users/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com
>>> 
>>> .
>>>
>>
>
> --
>
>
> Stephen Foster
> ThoughtSTEM Co-Founder
> 318-792-2035
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CA%2BzSu29untSJzX0yuyzbOuCiz_xewsgkXBkYHZVnLeHBkwT1mg%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdON9G6n1GAL0e7FA-vGaD_U3Z72KzKHSW1FUoQti44b76w%40mail.gmail.com.


Re: [racket-users] Sandbox + 2htdp/image

2020-05-28 Thread Stephen Foster
I was using the image? predicate as an arbitrary example of something you
might want to do with an image after extracting it from the sandbox.  What
if I wanted to pass the result along to beside or overlay?

In all cases, these functions don't recognize the result as an image:

beside: expects an image as first argument, given (object:image% #f #f #f
#f 1 0 (object:image-snipclass% #f "((lib \"image-core.ss\" \"mrlib\") (lib
\"image-core-wxme.rkt\" \"mrlib\"))" 1) #0=(object:style% (object:color% 0
0 0 1.0 #f) (object:color% 255 255 255 1.0 #f) (object:font% #f 'aligned
'#(12...

On Tue, May 26, 2020 at 4:58 PM Robby Findler 
wrote:

> It might be easiest to just use the `image?` predicate from inside the
> sandbox. Get it out the same way you got the image itself out.
>
> Robby
>
>
> On Tue, May 26, 2020 at 6:22 PM Stephen Foster 
> wrote:
>
>> The following returns #f and #t.  How can I get it to return #t and #t?
>>
>> Context: I want to allow students to run Racket code on my server. But
>> when I sandbox their code, I am getting back something that doesn't behave
>> like a 2htdp/image object.  I'm not exactly sure what it is.
>>
>> #lang racket
>>
>> (require racket/sandbox 2htdp/image)
>>
>> (sandbox-path-permissions
>>   (list
>> '(exists
>>"/usr/lib/ssl/cert.pem")
>> '(exists
>>"/usr/lib/ssl/certs")))
>>
>> (define user-code '(circle 40 'solid 'red))
>>
>> (define circle1
>>   ((make-evaluator 'racket
>>`(define f
>>   (let ()
>> ,user-code))
>>#:requires
>>'(2htdp/image))
>>'f))
>>
>> (define circle2
>>   (circle 40 'solid 'red))
>>
>> (image? circle1) ;#f but I want it to be #t
>> (image? circle2) ;#t
>>
>>
>> If it helps, when I print out the above values with ~a, I get:
>>
>> "#(struct:object:image% ... #(struct:translate 40 40 #(struct:ellipse 80
>> 80 0 255 red)) #(struct:bb 80 80 80) #f #f #f #f #t)"
>>
>> "#(struct:object:image% ...)"
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/ebf8bf84-23d6-45f3-9b1d-6bb6bf592b8e%40googlegroups.com
>> 
>> .
>>
>

-- 


Stephen Foster
ThoughtSTEM Co-Founder
318-792-2035

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CA%2BzSu29untSJzX0yuyzbOuCiz_xewsgkXBkYHZVnLeHBkwT1mg%40mail.gmail.com.


Re: [racket-users] What is the purpose of "compact" code paths in print.c?

2020-05-28 Thread Thomas Dickerson
Perfect, thanks for insight =)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CA%2BHWosVZGa1aOEbznUnAi535a%2BcqrX_zDGfZNejaiOeCnTgCyQ%40mail.gmail.com.


Re: [racket-users] What is the purpose of "compact" code paths in print.c?

2020-05-28 Thread Ryan Culpepper
Based on a quick look, I believe it has to do with serializing compiled
code, including quoted values embedded in compiled code. Serializing
compiled code uses the same entry point as the other printing functions.
For example, try this:

(write (compile '(quote (1 2 3

and compare the output against the contents of some .zo file.

You probably don't want to make any changes that affect the behavior when
compact is true, unless you're trying to add support for a new quotable and
readable data type. In that case, ask Matthew for help :)

Ryan


On Thu, May 28, 2020 at 8:01 PM Thomas Dickerson <
thomas_dicker...@alumni.brown.edu> wrote:

> I'm working on an enhancement for write/print/display, and thought I had
> it all implemented in io/print/main.rkt before realizing that code is only
> used for Racket-CS.
>
> Now I'm working on making equivalent changes in print.c for the
> traditional implementation, and that code is substantially more complex.
> Among other things, print has a bunch of checks against a variable called
> "compact", but I can't find any comments (either in the source or in the
> git log) as to what its for / when its used.
> Can anyone comment?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/1a2b4d7d-bdf7-4cbb-bf9e-6565c7bfec28%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CANy33qnYbuqks3NKbPXj0y6F_68nAp2bouHa386bqzHNmc07FA%40mail.gmail.com.


Re: [racket-users] Finite state machine

2020-05-28 Thread 'John Clements' via Racket Users
Good to hear from you!

Unfortunately, it’s going to be really hard to help you without more 
information.

Can you give us some context on what your goal is, here? Is this part of a 
class? Your problem seems very under-specified.

John

> On May 27, 2020, at 8:53 PM, Med Ra  wrote:
> 
> Dear All, i'm a new member in the group and also a debutante in racket 
> programming and i will be happy if you read and understand what i'm asking .
> 
> I want create a finite state machine to represent an hotel room booking 
> system.
> 
> first , i have created the FSM Scheme as the following :
> 
> about Rooms ---> (state (available) (unavailble))
> two inputs ---> Time: T = 1 if some room will be available in the required 
> entering date in future.
>   Full Of F = 1if all the rooms are full at the moment.
> 
> I just want some help about how create this on drracket coding, And please 
> forgive my ignorance !
> 
> Thanks for attention.
> 
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/ee6807b0-8b02-40c1-8eeb-f41a01fa31d6%40googlegroups.com.



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/a6463687-9c43-4592-b0f1-a5914d47972a%40mtasv.net.


[racket-users] What is the purpose of "compact" code paths in print.c?

2020-05-28 Thread Thomas Dickerson
I'm working on an enhancement for write/print/display, and thought I had it 
all implemented in io/print/main.rkt before realizing that code is only 
used for Racket-CS.

Now I'm working on making equivalent changes in print.c for the traditional 
implementation, and that code is substantially more complex.
Among other things, print has a bunch of checks against a variable called 
"compact", but I can't find any comments (either in the source or in the 
git log) as to what its for / when its used.
Can anyone comment?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1a2b4d7d-bdf7-4cbb-bf9e-6565c7bfec28%40googlegroups.com.


Re: [racket-users] Re: Typing lag with DrRacket on Linux

2020-05-28 Thread evdubs
I suppose that may be helpful, but this performance issue extends to any 
other Racket GUI application on Linux, including the simple editor example 
from earlier in this thread. Maybe printing something to a console could 
help, but it would be better if there was some fix to improve fractional 
scaling performance :)

Evan

On Thursday, May 28, 2020 at 2:37:49 AM UTC-10, Jens Axel Søgaard wrote:
>
> Slack users confirm the problem when the backing scale is 1.5.
>
> Should DrRacket give a warning dialog on Linux, when started with a 
> non-integer backing scale?
>
> /Jens Axel
>
>
> Den ons. 13. maj 2020 kl. 05.48 skrev evdubs  >:
>
>> I did some more digging and found locations in racket/draw that control 
>> antialiasing. I tried changing them around, and saw no impact on 
>> performance.
>>
>> However, I eventually stumbled upon the environment variable 
>> PLT_DISPLAY_BACKING_SCALE. By using an integer value for this variable, 
>> performance is nice and smooth (I tried 1 and 2; trying 1.25 and 1.5 hurt 
>> performance). In Ubuntu, I do not have my display set to a fractional 
>> scaling value, but I do have "Large Text" enabled. I am unsure if this 
>> setting interferes with whatever PLT_DISPLAY_BACKING_SCALE defaults to.
>>
>> If you're having typing lag issues on Linux within Dr Racket or other 
>> Racket GUI applications, you may want to try PLT_DISPLAY_BACKING_SCALE=1 to 
>> see if that affects performance.
>>
>> Evan
>>
>> On Monday, May 11, 2020 at 2:05:06 PM UTC-10, evdubs wrote:
>>>
>>> I think what I have seen previously with setting the canvas style to 
>>> 'transparent ultimately is turning off antialiasing in Cairo.
>>>
>>> Using the sample text editor from this thread, I ran the following:
>>>
>>> $ cairo-trace racket text-editor.rkt
>>> $ cairo-trace racket text-editor-transparent.rkt
>>>
>>> In the non-transparent version, we see these two lines:
>>>
>>> 16 0 0 16 0 0 matrix 2 0 0 2 0 0 matrix << /antialias 
>>> //ANTIALIAS_SUBPIXEL /subpixel-order //SUBPIXEL_ORDER_RGB /hint-style 
>>> //HINT_STYLE_SLIGHT /hint-metrics //HINT_METRICS_ON >> scaled-font /sf0 
>>> exch def
>>> f0 32 0 0 32 0 0 matrix 2 0 0 2 0 0 matrix << /antialias 
>>> //ANTIALIAS_SUBPIXEL /subpixel-order //SUBPIXEL_ORDER_RGB /hint-style 
>>> //HINT_STYLE_SLIGHT /hint-metrics //HINT_METRICS_ON >> scaled-font /sf1 
>>> exch def
>>>
>>> These lines look like this in the transparent version:
>>>
>>> 16 0 0 16 0 0 matrix 2 0 0 2 0 0 matrix << /hint-metrics 
>>> //HINT_METRICS_ON >> scaled-font /sf0 exch def
>>> f0 32 0 0 32 0 0 matrix 2 0 0 2 0 0 matrix << /hint-metrics 
>>> //HINT_METRICS_ON >> scaled-font /sf1 exch def
>>>
>>> I am not really sure how this initialization is happening. Can someone 
>>> help me poke through the code to see how I might disable antialiasing? 
>>> Should I try to make changes to gui-lib/mred/private/wx/gtk/gcwin.rkt?
>>>
>>> Evan
>>>
>>> On Friday, March 29, 2019 at 12:29:11 AM UTC-10, Bryan Lee wrote:

 I’m facing the same issues, and I came across an interesting 
 observation. 

 It seems that DrRacket mimics scrolling behaviour by literally 
 replacing each line of code with the line above or below, and uses a 
 really 
 inefficient method of tracking which lines should go where, thereby 
 limiting how fast you can “scroll”. 

 I realised that resizing the window horizontally does nothing to 
 improve performance, but shrinking the window height significantly 
 improved 
 performance, even if the canvas area is adjusted to remain the same. 

 In addition to some function definitions in unit.rkt describing the 
 transposing of lines, that leads me to my conclusion. 

 Thoughts? 



 On Friday, 2 November 2018 10:46:29 UTC+8, evdubs  wrote: 
 > Resurrecting an old thread. 
 > 
 > 
 > I recently tried to see what would happen if I changed the 
 interactions-canvas% and definitions-canvas% to be the following: 
 > 
 > 
 >   (define interactions-canvas% 
 > (class editor-canvas% 
 >   (init [style '(transparent)]) 
 >   (super-new (style (cons 'auto-hscroll style))) 
 >   (inherit set-scroll-via-copy) 
 >   (set-scroll-via-copy #t))) 
 > 
 > 
 > 
 >   (define definitions-canvas% 
 > (class editor-canvas% 
 >   (init [style '(transparent)]) 
 >   (super-new (style (cons 'auto-hscroll style))) 
 >   (inherit set-scroll-via-copy) 
 >   (set-scroll-via-copy #t))) 
 > 
 > 
 > This seemed to work well for entering text into a blank file, but 
 opening another file still showed the same lag. I was able to remove this 
 last bit of lag by unchecking Edit / Preferences / Editing / General 
 Editing / Color syntax interactively. I can now enter text into Dr Racket 
 as smoothly as I can in most other text editors and even the example 
 'transparent 

Re: [racket-users] Re: Typing lag with DrRacket on Linux

2020-05-28 Thread Jens Axel Søgaard
Slack users confirm the problem when the backing scale is 1.5.

Should DrRacket give a warning dialog on Linux, when started with a
non-integer backing scale?

/Jens Axel


Den ons. 13. maj 2020 kl. 05.48 skrev evdubs :

> I did some more digging and found locations in racket/draw that control
> antialiasing. I tried changing them around, and saw no impact on
> performance.
>
> However, I eventually stumbled upon the environment variable
> PLT_DISPLAY_BACKING_SCALE. By using an integer value for this variable,
> performance is nice and smooth (I tried 1 and 2; trying 1.25 and 1.5 hurt
> performance). In Ubuntu, I do not have my display set to a fractional
> scaling value, but I do have "Large Text" enabled. I am unsure if this
> setting interferes with whatever PLT_DISPLAY_BACKING_SCALE defaults to.
>
> If you're having typing lag issues on Linux within Dr Racket or other
> Racket GUI applications, you may want to try PLT_DISPLAY_BACKING_SCALE=1 to
> see if that affects performance.
>
> Evan
>
> On Monday, May 11, 2020 at 2:05:06 PM UTC-10, evdubs wrote:
>>
>> I think what I have seen previously with setting the canvas style to
>> 'transparent ultimately is turning off antialiasing in Cairo.
>>
>> Using the sample text editor from this thread, I ran the following:
>>
>> $ cairo-trace racket text-editor.rkt
>> $ cairo-trace racket text-editor-transparent.rkt
>>
>> In the non-transparent version, we see these two lines:
>>
>> 16 0 0 16 0 0 matrix 2 0 0 2 0 0 matrix << /antialias
>> //ANTIALIAS_SUBPIXEL /subpixel-order //SUBPIXEL_ORDER_RGB /hint-style
>> //HINT_STYLE_SLIGHT /hint-metrics //HINT_METRICS_ON >> scaled-font /sf0
>> exch def
>> f0 32 0 0 32 0 0 matrix 2 0 0 2 0 0 matrix << /antialias
>> //ANTIALIAS_SUBPIXEL /subpixel-order //SUBPIXEL_ORDER_RGB /hint-style
>> //HINT_STYLE_SLIGHT /hint-metrics //HINT_METRICS_ON >> scaled-font /sf1
>> exch def
>>
>> These lines look like this in the transparent version:
>>
>> 16 0 0 16 0 0 matrix 2 0 0 2 0 0 matrix << /hint-metrics
>> //HINT_METRICS_ON >> scaled-font /sf0 exch def
>> f0 32 0 0 32 0 0 matrix 2 0 0 2 0 0 matrix << /hint-metrics
>> //HINT_METRICS_ON >> scaled-font /sf1 exch def
>>
>> I am not really sure how this initialization is happening. Can someone
>> help me poke through the code to see how I might disable antialiasing?
>> Should I try to make changes to gui-lib/mred/private/wx/gtk/gcwin.rkt?
>>
>> Evan
>>
>> On Friday, March 29, 2019 at 12:29:11 AM UTC-10, Bryan Lee wrote:
>>>
>>> I’m facing the same issues, and I came across an interesting
>>> observation.
>>>
>>> It seems that DrRacket mimics scrolling behaviour by literally replacing
>>> each line of code with the line above or below, and uses a really
>>> inefficient method of tracking which lines should go where, thereby
>>> limiting how fast you can “scroll”.
>>>
>>> I realised that resizing the window horizontally does nothing to improve
>>> performance, but shrinking the window height significantly improved
>>> performance, even if the canvas area is adjusted to remain the same.
>>>
>>> In addition to some function definitions in unit.rkt describing the
>>> transposing of lines, that leads me to my conclusion.
>>>
>>> Thoughts?
>>>
>>>
>>>
>>> On Friday, 2 November 2018 10:46:29 UTC+8, evdubs  wrote:
>>> > Resurrecting an old thread.
>>> >
>>> >
>>> > I recently tried to see what would happen if I changed the
>>> interactions-canvas% and definitions-canvas% to be the following:
>>> >
>>> >
>>> >   (define interactions-canvas%
>>> > (class editor-canvas%
>>> >   (init [style '(transparent)])
>>> >   (super-new (style (cons 'auto-hscroll style)))
>>> >   (inherit set-scroll-via-copy)
>>> >   (set-scroll-via-copy #t)))
>>> >
>>> >
>>> >
>>> >   (define definitions-canvas%
>>> > (class editor-canvas%
>>> >   (init [style '(transparent)])
>>> >   (super-new (style (cons 'auto-hscroll style)))
>>> >   (inherit set-scroll-via-copy)
>>> >   (set-scroll-via-copy #t)))
>>> >
>>> >
>>> > This seemed to work well for entering text into a blank file, but
>>> opening another file still showed the same lag. I was able to remove this
>>> last bit of lag by unchecking Edit / Preferences / Editing / General
>>> Editing / Color syntax interactively. I can now enter text into Dr Racket
>>> as smoothly as I can in most other text editors and even the example
>>> 'transparent editor-canvas% text editor. Background expansion can even be
>>> enabled without incurring a per-character-entered performance hit.
>>> >
>>> >
>>> >
>>> > I do not know why setting 'transparent helps the performance of
>>> editor-canvas%. Likewise, I do not know why interactive syntax coloring
>>> also incurs a noticeable performance hit. As a reminder, this is mostly a
>>> problem for large resolution displays. Shrinking the DrRacket window will
>>> improve performance at the cost of not being able to see as much of the
>>> text.
>>> >
>>> >
>>> >
>>> > If anyone has advice for why this might be