Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-02-03 Thread rsiddharth
Juan Francisco Cantero Hurtado  writes:

> Here is a simple workaround:
>
> # cd /etc/fonts/conf.d
> # cat 71-no-ghostscript.conf
> 
> 
> 
> 
> 
> /usr/local/share/fonts/ghostscript/*
> 
> 
> 
> #
>

Thanks for the work around! It works.

- rsiddharth.



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-02-03 Thread Juan Francisco Cantero Hurtado
On Sun, Feb 02, 2020 at 11:50:12PM -0500, rsiddharth wrote:
> I found a reliable way to replicate the issue on OpenBSD snapshot #628:
> 
>   0. $ uname -a
> 
>  OpenBSD cygnus.ricketyspace.net 6.6 GENERIC.MP#628 amd64
> 
>   1. $ raco pkg install --jobs $(sysctl -n hw.ncpuonline) --auto drracket
> 
>  1.1. $ $HOME/.racket/7.5/bin/drracket
> 
>   The text in the REPL renders correctly.
> 
>   Also, this https://ricketyspace.net/tmp/text.rkt program
>   renders "Hello World 42" correctly.
> 
>  1.2. Quit DrRacket.
> 
>   2. # pkg_add ghostscript
> 
>Choose "ghostscript-9.07p7".
> 
>   3. $HOME/.racket/7.5/bin/drracket
> 
>   The text in the REPL does not display correctly.
> 
>   The text.rkt program does not render the "Hello World 42"
>   correctly.
> 
>   4. Quit DrRacket.
> 
> 
>   5. # pkg_delete ghostscript
> 
> 
>   6. # pkg_delete -a
> 
> 
>   7. $HOME/.racket/7.5/bin/drracket
> 
>   The text in the REPL renders correctly.
> 
>   The text.rkt program renders the "Hello World 42"
>   correctly.
> 
> 
> Installing the "ghostscript" package seems to cause the issue.
> 
> Also, installing "texlive_texmf-full-2019" causes the issue (because it
> installs "ghostscript"?).
> 
> I'm unable to explain why this is happening. It would be great if
> someone looks into this.

Here is a simple workaround:

# cd /etc/fonts/conf.d
# cat 71-no-ghostscript.conf





/usr/local/share/fonts/ghostscript/*



#

Create that file and your program should work again.

Thanks for your patience!.


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



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-02-03 Thread Stuart Henderson

No.

--
Sent from a phone, apologies for poor formatting.

On 3 February 2020 10:28:41 rsiddharth  wrote:


Stuart Henderson  writes:


It's because new pango doesn't support type1 or pcf bitmap fonts, such
as the ones pulled in by installing ghostscript.


So, is this an upstream issue that needs to be reported to racket
developers?






Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-02-03 Thread rsiddharth
Stuart Henderson  writes:

> It's because new pango doesn't support type1 or pcf bitmap fonts, such
> as the ones pulled in by installing ghostscript.

So, is this an upstream issue that needs to be reported to racket
developers?



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-02-03 Thread Stuart Henderson
It's because new pango doesn't support type1 or pcf bitmap fonts, such as 
the ones pulled in by installing ghostscript.


--
Sent from a phone, apologies for poor formatting.

On 3 February 2020 04:51:14 rsiddharth  wrote:


I found a reliable way to replicate the issue on OpenBSD snapshot #628:

 0. $ uname -a

OpenBSD cygnus.ricketyspace.net 6.6 GENERIC.MP#628 amd64

 1. $ raco pkg install --jobs $(sysctl -n hw.ncpuonline) --auto drracket

1.1. $ $HOME/.racket/7.5/bin/drracket

 The text in the REPL renders correctly.

 Also, this https://ricketyspace.net/tmp/text.rkt program
 renders "Hello World 42" correctly.

1.2. Quit DrRacket.

 2. # pkg_add ghostscript

  Choose "ghostscript-9.07p7".

 3. $HOME/.racket/7.5/bin/drracket

 The text in the REPL does not display correctly.

 The text.rkt program does not render the "Hello World 42"
 correctly.

 4. Quit DrRacket.


 5. # pkg_delete ghostscript


 6. # pkg_delete -a


 7. $HOME/.racket/7.5/bin/drracket

 The text in the REPL renders correctly.

 The text.rkt program renders the "Hello World 42"
 correctly.


Installing the "ghostscript" package seems to cause the issue.

Also, installing "texlive_texmf-full-2019" causes the issue (because it
installs "ghostscript"?).

I'm unable to explain why this is happening. It would be great if
someone looks into this.

- rsiddharth.






Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-02-02 Thread rsiddharth
I found a reliable way to replicate the issue on OpenBSD snapshot #628:

  0. $ uname -a

 OpenBSD cygnus.ricketyspace.net 6.6 GENERIC.MP#628 amd64

  1. $ raco pkg install --jobs $(sysctl -n hw.ncpuonline) --auto drracket

 1.1. $ $HOME/.racket/7.5/bin/drracket

  The text in the REPL renders correctly.

  Also, this https://ricketyspace.net/tmp/text.rkt program
  renders "Hello World 42" correctly.

 1.2. Quit DrRacket.

  2. # pkg_add ghostscript

   Choose "ghostscript-9.07p7".

  3. $HOME/.racket/7.5/bin/drracket

  The text in the REPL does not display correctly.

  The text.rkt program does not render the "Hello World 42"
  correctly.

  4. Quit DrRacket.


  5. # pkg_delete ghostscript


  6. # pkg_delete -a


  7. $HOME/.racket/7.5/bin/drracket

  The text in the REPL renders correctly.

  The text.rkt program renders the "Hello World 42"
  correctly.


Installing the "ghostscript" package seems to cause the issue.

Also, installing "texlive_texmf-full-2019" causes the issue (because it
installs "ghostscript"?).

I'm unable to explain why this is happening. It would be great if
someone looks into this.

- rsiddharth.



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-14 Thread Juan Francisco Cantero Hurtado
On Tue, 14 Jan 2020 22:34:38 +
Stuart Henderson  wrote:

> On 2020/01/12 23:59, Juan Francisco Cantero Hurtado wrote:
> > 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.  
> 
> I don't know Racket but given the mention of cairo/pango, pango 1.44+
> drops support for old-style bitmap (pcf) or type 1 fonts, which may
> be involved.

I though the same but deleting the config and font directories, and
restoring the user and global defaults, should fix the problem in that
case. He created a new user account and still had the same results, so
the problems are something global but I can't imagine where.


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



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-14 Thread Stuart Henderson
On 2020/01/12 23:59, Juan Francisco Cantero Hurtado wrote:
> 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.

I don't know Racket but given the mention of cairo/pango, pango 1.44+
drops support for old-style bitmap (pcf) or type 1 fonts, which may be involved.



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-14 Thread rsiddharth
rsiddharth  writes:

>  I tried creating a new user (via adduser(8)) and ran DrRacket as
>  the new user; the text did rendered properly in the REPL and for my
>  version of the hello function[1].
>
>  [1]: https://ricketyspace.net/tmp/text.rkt

Oops, typo. It is "...the text did _not render_ properly in the
REPL...".

- rsiddharth.



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-14 Thread rsiddharth
Juan Francisco Cantero Hurtado  writes:

> Start the computer but don't log in as a regular user using xenodm or
> startx. Change to a different virtual console with Ctrl + Alt + F2 and
> log in as root.
>
> Delete (saving a copy of /etc or $HOME if you want)
> /var/cache/fontconfig, /etc/fonts and $HOME/.cache/fontconfig from
> every user. Delete every file or directory starting with ".font*" in
> $HOME and starting with "font" in $HOME/.config and $HOME/.cache. 
>
> Run sysmerge (it will restore the default config for fonts) and reboot. 
>
> If you didn't change the default XDG directories, then that should
> remove everything related to cairo font rendering (fontconfig).
>
> I don't have more ideas for your problem.

I tried the above recipe. It doesn't seem to solve the issue.

Since, the issue seems to be specific to my current installation, I'm
going to re-install OpenBSD over the weekend. That will most probably
solve the issue.

Thank you very much for your help Juan. I appreciate it.

- rsiddharth.



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-14 Thread rsiddharth
Juan Francisco Cantero Hurtado  writes:

> 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")

The `text/font` function works for me too:

https://ricketyspace.net/tmp/racket-drracket-text_font-works.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.

Yes, I forgot to point out that the text in the DrRacket REPL has
the same rendering issue too.

> 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.

Thanks. I tried the above recipe; it doesn't seem to fix the issue.

When I did:

 $ pkg_add -Dinstalled -Viu

 It asked me to update the font path:

 --- +ghostscript-fonts-8.11p3 ---
 You may wish to update your font path for 
/usr/local/share/fonts/ghostscript
 --- +liberation-fonts-2.00.1p1 ---
 You may wish to update your font path for /usr/local/share/fonts/Liberation
 --- +noto-cjk-2.001 ---
 You may wish to update your font path for /usr/local/share/fonts/noto
 --- +noto-emoji-20180810 ---
 You may wish to update your font path for /usr/local/share/fonts/noto
 --- +noto-fonts-20171024 ---
 You may wish to update your font path for /usr/local/share/fonts/noto
 --- +terminus-font-4.47p0 ---
 You may wish to update your font path for /usr/local/share/fonts/terminus

 I did:

 $ xset fp+ /usr/local/share/fonts/ghostscript
 $ xset fp+ /usr/local/share/fonts/Liberation
 .
 .
 $ xset fp+ /usr/local/share/fonts/terminus

 Then tried DrRacket; it didn't fix the issue.

 I did (both as a user and as root):

 $ fc-cache -fv

 # fc-cache -fv

 Didn't help.

 I tried creating a new user (via adduser(8)) and ran DrRacket as
 the new user; the text did rendered properly in the REPL and for my
 version of the hello function[1].

 [1]: https://ricketyspace.net/tmp/text.rkt

I'm not sure if I'm missing a font that DrRacket is looking for.

Here's the output of:

 $ fc-list

 https://ricketyspace.net/tmp/cygnus.fc-list

Output of:

 $ pkg_info

 https://ricketyspace.net/tmp/cygnus.pkgs

Packages diff generated by daily insecurity output after I had ran the
`pkg_add -Dinstalled -Viu` and `pkg_delete -a` you suggested:

 https://ricketyspace.net/tmp/cygnus.pkgs.diff

 The diff tells adobe-source-code-pro and cantarell-fonts were
 removed. I added them back and did `xset fp+ ...` and `fc-cache
 -fv` both as root and as a user. It didn't seem to solve the issue.

- rsiddharth



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-12 Thread Juan Francisco Cantero Hurtado
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



Re: [lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-12 Thread Juan Francisco Cantero Hurtado
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.


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



[lang/racket-minimal-7.5] Racket has issues rendering text via 2htdp/image

2020-01-11 Thread rsiddharth
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.

- rsiddharth