Comments (2)
Below is some code that demonstrates the issue just at the level of pict
and racket/gui
.
I see that changing the weight does change the output of the pict in the REPL but not in the PDF file so I wonder if the recent changes to racket/draw need more changes?
That is, replacing the definition of p
with this:
(define p (text "READ WRITE" (cons (cons 'weight 'heavy) "Source Code Pro")))
exaggerates the difference between the PDF version and the repl version.
#lang racket
(require pict racket/gui/base)
(define p (text "READ WRITE" "Source Code Pro"))
p
(define ps-setup (make-object ps-setup%))
(send ps-setup copy-from (current-ps-setup))
(send ps-setup set-file "commonlang.pdf")
(send ps-setup set-mode 'file)
(define ps/pdf-dc
(parameterize ([current-ps-setup ps-setup])
(make-object pdf-dc% #f #f)))
(parameterize ([dc-for-text-size ps/pdf-dc])
(send ps/pdf-dc start-doc "x")
(send ps/pdf-dc start-page)
(draw-pict p ps/pdf-dc 0 0)
(send ps/pdf-dc end-page)
(send ps/pdf-dc end-doc))
from redex.
Here's a version that eliminates the pict
library from the dependencies.
#lang racket
(require racket/gui/base)
;; changing this doesn't seem to affect the PDF output
;; but it does affect the window output
(define weight 500)
(define (write-it f)
(define ps-setup (make-object ps-setup%))
(send ps-setup copy-from (current-ps-setup))
(send ps-setup set-file "commonlang.pdf")
(send ps-setup set-mode 'file)
(define ps/pdf-dc
(parameterize ([current-ps-setup ps-setup])
(make-object pdf-dc% #f #f)))
(send ps/pdf-dc start-doc "x")
(send ps/pdf-dc start-page)
(f ps/pdf-dc)
(send ps/pdf-dc end-page)
(send ps/pdf-dc end-doc))
(define (draw dc)
(define font (send dc get-font))
(send dc set-font
(send the-font-list find-or-create-font 12 "Source Code Pro"
'default 'normal weight
#f 'default #t 'unaligned))
(send dc draw-text "READ WRITE" 10 10)
(send dc set-font font))
(write-it draw)
(define f (new frame% [label ""] [width 200] [height 200]))
(define c (new canvas% [parent f] [paint-callback (λ (c dc) (draw dc))]))
(send f show #t)
from redex.
Related Issues (20)
- Defining mutually recursvie judgments/meta-functions HOT 2
- Feature request: tag-with-names for apply-reduction-relation* HOT 2
- test-->>∃ #:steps n passes test if n > than the number of actual reduction steps for a term. HOT 4
- `traces` doesn't draw arrows after "fix layout" HOT 5
- `stepper` doesn't display whole term... unless I *narrow* its box?
- Feature Request: `stepper` with judgment-form use rule names
- Feature request: adjust font for `stepper` HOT 3
- Redex rejects literals at different ellipsis depths in binding form declarations HOT 1
- Generating random expressions sometimes results in an infinite loop
- where/error failures give no information about source of error HOT 6
- where/error failures don't tell you what failed to match
- using judgment-holds within define-relation HOT 1
- Redex's reduction graph windows sneakily hide part of term reductions HOT 1
- where/error doesn't report errors sometimes HOT 8
- define-metafunction does not check type signature on LHS HOT 3
- Docs missing a word I can't fill in. HOT 1
- `derivation/ps` always causes an error by calling a non-existent method HOT 1
- Default rendering font changed between Racket v8.8 and v8.9? HOT 4
- Reduce space between rendered rules of a judgement form HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redex.