On Sun, Jan 12, 2020 at 07:24:52PM +0100, Juan Francisco Cantero Hurtado wrote:
> On Sat, Jan 11, 2020 at 08:59:32PM -0500, rsiddharth wrote:
> > Hi,
> > 
> > Racket's 2htdp/image's `text`[1] function is having troubling rendering
> > text:
> > 
> >         https://ricketyspace.net/tmp/racket-2htdp-image-text-issue.png
> >         (In Emacs Racket-REPL via racket-mode[2])
> > 
> >         https://ricketyspace.net/tmp/racket-drracket-text-issue.png
> >         (In DrRacket)
> > 
> >         https://ricketyspace.net/tmp/racket-fontrendering-issue.mkv
> >         (Video demonstration of the issue)
> > 
> > [1]: 
> > https://docs.racket-lang.org/teachpack/2htdpimage.html?q=text#%28def._%28%28lib._2htdp%2Fimage..rkt%29._text%29%29
> > [2]: https://github.com/greghendershott/racket-mode
> > 
> > I've been using racket-minimal on OpenBSD for the last 6 months and I've
> > not had this issue before.
> > 
> > My OpenBSD system info:
> > 
> >    cygnus$ uname -a
> >    OpenBSD cygnus.ricketyspace.net 6.6 GENERIC.MP#597 amd64
> > 
> >    cygnus$ pkg_info -A  | grep racket 
> >    racket-minimal-7.5  multi-paradigm programming language
> > 
> >    Running OpenBSD snapshot (2020-01-11) with racket-minimal version
> >    7.5 installed.
> > 
> > I tried using the 2htdp/image's `text`[1] function on Ubuntu 19.10 with
> > Racket version 7.5. It works there. So, this issue seems to be specific
> > to OpenBSD.
> > 
> > I'm guessing this issue might be related to upgrades to[3]:
> > 
> >     libXfont2 2.0.4.
> >     font/util 1.3.2.
> >     font/encodings 1.0.5.
> > 
> > [3]: https://www.openbsd.org/plus.html
> > 
> > I'm wondering if the racket-minimal package needs to re-compiled?
> > 
> > Steps to replicate this issue:
> > 
> >       # pkg_add racket-minimal
> > 
> >       $ raco pkg install --jobs $(sysctl -n hw.ncpuonline) \
> >              --auto drracket
> > 
> >       $ curl https://ricketyspace.net/tmp/text.rkt > /tmp/text.rkt
> > 
> >       $ $HOME/.racket/7.5/bin/drracket
> > 
> >         File -> Open -> /tmp/text.rkt
> > 
> >         To run the text.rkt file -> hit Ctrl+R or click "Run" button in
> >         the top right.
> > 
> >         In the REPL that opens at the bottom, do:
> > 
> >         (hello)
> > 
> > It would be great if this issue can be fixed in OpenBSD.
> > 
> > Let me know if more information is needed from my end.
> 
> Thanks for the report. I will take a look.

Your code works for me.

solene@ and I tested this code and worked for us:

#lang racket

(require 2htdp/image)

(define (hello)
  (text/font "Hello World 42" 24 "black"
             "Luxi Sans" 'roman 'normal 'normal #f))

(save-image (hello) "test.png")

In the video, I see font rendering problems in the DrRacket REPL, which
is quite weird because the code editor and the menu work fine. So, you
have missing fonts, a broken config which renders erroneously some
glyphs or a broken lib. htdp uses the draw lib and it uses cairo. If we
had cairo/pango broken, we would see missing glyphs everywhere. Racket
doesn't use low level libs.

Try this:
- Change /etc/installurl to https://cdn.openbsd.org/pub/OpenBSD
- sysupgrade -f -s
- pkg_add -Dinstalled -Viu
- pkg_delete -a

That should reinstall everything and remove old libraries.



-- 
Juan Francisco Cantero Hurtado http://juanfra.info

Reply via email to