9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] p9p on Retina Macs
@ 2013-08-16 17:05 marius eriksen
  2013-08-16 21:35 ` Rob Pike
  0 siblings, 1 reply; 6+ messages in thread
From: marius eriksen @ 2013-08-16 17:05 UTC (permalink / raw)
  To: 9fans

I know there’s been some work on this; how well does it work? Since the default fonts are bit-mapped, does it require the use of fontsrv, or are there scaled-up versions of the fonts?

-m.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] p9p on Retina Macs
  2013-08-16 17:05 [9fans] p9p on Retina Macs marius eriksen
@ 2013-08-16 21:35 ` Rob Pike
  2013-09-06  3:32   ` marius a. eriksen
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Pike @ 2013-08-16 21:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Russ added a couple of helper things to the library. There's now a
'dpi' field in Display and helpers for scaling. I don't remember the
details but a little digging with that pointer should do it. I vaguely
remember you can also specify a scaling integer in the value of $font.
I write a little subfont scaler that he used to generate upscaled
fonts. Have a look around and report back.

-rob



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] p9p on Retina Macs
  2013-08-16 21:35 ` Rob Pike
@ 2013-09-06  3:32   ` marius a. eriksen
  2013-09-06  4:14     ` Russ Cox
  0 siblings, 1 reply; 6+ messages in thread
From: marius a. eriksen @ 2013-09-06  3:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks for the pointers.

I finally did some sleuthing and experimentation.

Indeed, devdraw now knows about a display’s DPI, and launching a devdraw app with environment devdrawretina=1 enables detection of retina displays, and setting the current DPI accordingly.

DPI seems to affect a few things:

1. computing geometries of fixed-sized UI elements like scroll bars
2. computing scroll “ticks”

⌘-R toggles the current DPI from “retina” (220 DPI) to “non-retina” (110 DPI).

There doesn’t seem to be any sort of built-in font scaling at the moment. So when you launch, say, acme on a retina machine, you’ll have to supply your own (larger) font. I ended up using fontsrv with system fonts:

	% devdrawretina=1 acme -f /mnt/font/HelveticaNeue-Medium/24a/font -F /mnt/font/Menlo-Regular/22a/font 

seems to work pretty well.

-m.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] p9p on Retina Macs
  2013-09-06  3:32   ` marius a. eriksen
@ 2013-09-06  4:14     ` Russ Cox
  2013-09-06  4:18       ` marius eriksen
  2013-09-06 11:24       ` James A. Robinson
  0 siblings, 2 replies; 6+ messages in thread
From: Russ Cox @ 2013-09-06  4:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1402 bytes --]

What Marius wrote is mostly accurate. If you set devdrawretina=1 you get
tinier pixels; acme, sam, and 9term know to draw thicker lines in response;
other programs do not.

If you want fonts that look somewhat like the Plan 9 bitmaps, I use this
with acme:

#!/bin/bash
export devdrawretina=1
/usr/local/plan9/bin/acme -f /mnt/font/LucidaGrande/25a/font -F
/mnt/font/Menlo-Regular/25a/font "$@"

It would be nice if acme, sam, 9term adjusted the font size to match the
display DPI accordingly. I have code that does this (I lied above; I
actually start acme with size 15a fonts and it scales to decide to use the
25a fonts), but I am not happy enough with it yet. The main thing that is
missing is that if the window changes from retina to non-retina or vice
versa (for example, you use a retina laptop with an external monitor and
drag a window from one screen to the other), acme and sam know to redraw
with thicker or thinner lines but I don't quite have to font adjustment
during resize correct.

The lack of on-the-fly font resizing is a continual source of pain for me
(I end up having to restart acme a lot), and at some point I will finish
it. Ideally I want to get to the point where devdrawretina=1 acme (no other
arguments) just works.

For fun, try 'devdrawretina=1 9term -f /mnt/font/Menlo-Regular/80a/font'
and then in that window run 'unicode fffe'.

Russ

[-- Attachment #2: Type: text/html, Size: 1608 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] p9p on Retina Macs
  2013-09-06  4:14     ` Russ Cox
@ 2013-09-06  4:18       ` marius eriksen
  2013-09-06 11:24       ` James A. Robinson
  1 sibling, 0 replies; 6+ messages in thread
From: marius eriksen @ 2013-09-06  4:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]


On Sep 5, 2013, at 9:14 PM, Russ Cox <rsc@swtch.com> wrote:

> For fun, try 'devdrawretina=1 9term -f /mnt/font/Menlo-Regular/80a/font' and then in that window run 'unicode fffe’.

Oh yes. I have been enjoying the pjw stare.

-m.


[-- Attachment #2: Type: text/html, Size: 992 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] p9p on Retina Macs
  2013-09-06  4:14     ` Russ Cox
  2013-09-06  4:18       ` marius eriksen
@ 2013-09-06 11:24       ` James A. Robinson
  1 sibling, 0 replies; 6+ messages in thread
From: James A. Robinson @ 2013-09-06 11:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

On Thu, Sep 5, 2013 at 9:14 PM, Russ Cox <rsc@swtch.com> wrote:

> The lack of on-the-fly font resizing is a continual source of pain for me
> (I end up having to restart acme a lot), and at some point I will finish
> it. Ideally I want to get to the point where devdrawretina=1 acme (no other
> arguments) just works.
>

Interesting!  I had asked earlier about simulating events and sending
them to acme from external programs because I had wanted to create
a Font+ and Font- set of commands to increase and decrease the
font size.

It's easy enough to get a list of the font sizes available for the current
font using fontsrv(1), and then select the previous or following size,
but I couldn't see any way to actually send that font path into the Font
command of the target window via the external program.

Jim

[-- Attachment #2: Type: text/html, Size: 1484 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-06 11:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-16 17:05 [9fans] p9p on Retina Macs marius eriksen
2013-08-16 21:35 ` Rob Pike
2013-09-06  3:32   ` marius a. eriksen
2013-09-06  4:14     ` Russ Cox
2013-09-06  4:18       ` marius eriksen
2013-09-06 11:24       ` James A. Robinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).