sbin/wsconsctl: show more data

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

sbin/wsconsctl: show more data

Artturi Alm
Hi,

guessing i'm not the only one wondering about these sizes, as w/current
snapshot the font does seem too big for me(on 2560x1440 display, for
which radeondrm(4) has never gotten the size right(giving only 1920x1200)).

display.part of wsconsctl output w/the diff:
display.type=radeondrm
display.width=1920
display.height=1200
display.depth=32
display.emulations=vt100
display.col_x_row=120x37
display.font_wxh=16x32
display.screentypes=std
display.focus=4
display.screen_on=250
display.screen_off=0
display.vblank=off
display.kbdact=on
display.msact=on
display.outact=on

lazy(=ugly) not-so-minimal diff below.

-Artturi


diff --git a/sbin/wsconsctl/display.c b/sbin/wsconsctl/display.c
index 6f789291142..9927a9d77c5 100644
--- a/sbin/wsconsctl/display.c
+++ b/sbin/wsconsctl/display.c
@@ -42,6 +42,7 @@
 
 u_int dpytype;
 u_int width, height, depth;
+u_int cxr[2], fontwxh[2];
 int focus;
 struct field_pc brightness, contrast, backlight;
 int burnon, burnoff, vblank, kbdact, msact, outact;
@@ -55,6 +56,8 @@ struct field display_field_tab[] = {
     { "height", &height, FMT_UINT, FLG_RDONLY },
     { "depth", &depth, FMT_UINT, FLG_RDONLY },
     { "emulations", &emuls, FMT_EMUL, FLG_RDONLY },
+    { "col_x_row", &cxr, FMT_UINTX, FLG_RDONLY },
+    { "font_wxh", &fontwxh, FMT_UINTX, FLG_RDONLY },
     { "screentypes", &screens, FMT_SCREEN, FLG_RDONLY },
     { "focus", &focus, FMT_INT, FLG_NORDBACK },
     { "brightness", &brightness, FMT_PC, FLG_MODIFY|FLG_INIT },
@@ -85,6 +88,7 @@ display_get_values(int fd)
  void *ptr;
  unsigned long cmd;
  int bon = 0, fbon = 0;
+ int fson = 0;
 
  focus = gscr.idx = -1;
  for (pf = display_field_tab; pf->name; pf++) {
@@ -102,6 +106,10 @@ display_get_values(int fd)
  } else if (ptr == &emuls) {
  fillioctl(WSDISPLAYIO_GETEMULTYPE);
  emuls.idx=0;
+ } else if (ptr == &cxr || ptr == &fontwxh) {
+ fillioctl(WSDISPLAYIO_GETSCREENTYPE);
+ ptr = &screens;
+ screens.idx = 0;
  } else if (ptr == &screens) {
  fillioctl(WSDISPLAYIO_GETSCREENTYPE);
  screens.idx=0;
@@ -168,6 +176,13 @@ display_get_values(int fd)
  emuls.idx=fd;
  } else if (ptr == &screens) {
  screens.idx=fd;
+ if (!fson) {
+ cxr[0] = screens.ncols;
+ cxr[1] = screens.nrows;
+ fontwxh[0] = screens.fontwidth;
+ fontwxh[1] = screens.fontheight;
+ }
+ fson++;
  } else if (ptr == &param) {
  struct field_pc *pc = pf->valp;
 
diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c
index b0ac4b3e23f..071baf31f85 100644
--- a/sbin/wsconsctl/util.c
+++ b/sbin/wsconsctl/util.c
@@ -186,6 +186,7 @@ int name2int(char *, const struct nameint *, int);
 void print_kmap(struct wskbd_map_data *);
 void print_emul(struct wsdisplay_emultype *);
 void print_screen(struct wsdisplay_screentype *);
+void print_uintx(u_int *);
 
 struct field *
 field_by_name(struct field *field_tab, char *name)
@@ -316,6 +317,9 @@ pr_field(const char *pre, struct field *f, const char *sep)
  case FMT_CFG:
  mousecfg_pr_field((struct wsmouse_parameters *) f->valp);
  break;
+ case FMT_UINTX:
+ print_uintx((u_int *) f->valp);
+ break;
  default:
  errx(1, "internal error: pr_field: no format %d", f->format);
  break;
@@ -551,3 +555,9 @@ print_screen(struct wsdisplay_screentype *screens)
  i = ioctl(fd, WSDISPLAYIO_GETSCREENTYPE, &s);
  }
 }
+
+void
+print_uintx(u_int *ux)
+{
+ printf("%ux%u", ux[0], ux[1]);
+}
diff --git a/sbin/wsconsctl/wsconsctl.h b/sbin/wsconsctl/wsconsctl.h
index 3a6e38d67e2..93d42ed600a 100644
--- a/sbin/wsconsctl/wsconsctl.h
+++ b/sbin/wsconsctl/wsconsctl.h
@@ -49,6 +49,7 @@ struct field {
 #define FMT_SCREEN 108 /* wsdisplay screen types */
 #define FMT_STRING 109 /* free string */
 #define FMT_CFG 201 /* wsmouse parameters */
+#define FMT_UINTX 202 /* u_int x u_int */
  int format;
 #define FLG_RDONLY 0x0001 /* variable cannot be modified */
 #define FLG_WRONLY 0x0002 /* variable cannot be displayed */

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Artturi Alm
On Sat, Jan 05, 2019 at 01:50:22AM +0200, Artturi Alm wrote:

> Hi,
>
> guessing i'm not the only one wondering about these sizes, as w/current
> snapshot the font does seem too big for me(on 2560x1440 display, for
> which radeondrm(4) has never gotten the size right(giving only 1920x1200)).
>
> display.part of wsconsctl output w/the diff:
> display.type=radeondrm
> display.width=1920
> display.height=1200
> display.depth=32
> display.emulations=vt100
> display.col_x_row=120x37
> display.font_wxh=16x32
> display.screentypes=std
> display.focus=4
> display.screen_on=250
> display.screen_off=0
> display.vblank=off
> display.kbdact=on
> display.msact=on
> display.outact=on
>
> lazy(=ugly) not-so-minimal diff below.
>
> -Artturi
>

fwiw., what i have w/o spleen:
display.type=radeondrm
display.width=1920
display.height=1200
display.depth=32
display.emulations=vt100
display.col_x_row=160x54
display.font_wxh=12x22
display.screentypes=std

which is usable, and the wrong width/height doesn't matter so much.
i suppose i should have written to bugs@ at this point, with picture
showing the size of gaps around 'i', effectively making "libxxx" read
like "l i bxxx".

-Artturi

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Theo de Raadt-2
You are failing to provide a proper bug report that has details,
instead, it we got a convoluted diff and an extremely vague description
that makes no sense.

that makes it very hard to care.

> On Sat, Jan 05, 2019 at 01:50:22AM +0200, Artturi Alm wrote:
> > Hi,
> >
> > guessing i'm not the only one wondering about these sizes, as w/current
> > snapshot the font does seem too big for me(on 2560x1440 display, for
> > which radeondrm(4) has never gotten the size right(giving only 1920x1200)).
> >
> > display.part of wsconsctl output w/the diff:
> > display.type=radeondrm
> > display.width=1920
> > display.height=1200
> > display.depth=32
> > display.emulations=vt100
> > display.col_x_row=120x37
> > display.font_wxh=16x32
> > display.screentypes=std
> > display.focus=4
> > display.screen_on=250
> > display.screen_off=0
> > display.vblank=off
> > display.kbdact=on
> > display.msact=on
> > display.outact=on
> >
> > lazy(=ugly) not-so-minimal diff below.
> >
> > -Artturi
> >
>
> fwiw., what i have w/o spleen:
> display.type=radeondrm
> display.width=1920
> display.height=1200
> display.depth=32
> display.emulations=vt100
> display.col_x_row=160x54
> display.font_wxh=12x22
> display.screentypes=std
>
> which is usable, and the wrong width/height doesn't matter so much.
> i suppose i should have written to bugs@ at this point, with picture
> showing the size of gaps around 'i', effectively making "libxxx" read
> like "l i bxxx".
>
> -Artturi
>

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

lists-2
In reply to this post by Artturi Alm
Hi Frederic, tech@,

This 16x32 font looks both wasteful in screen estate, and difficult to
read on both desktop and laptop screens of average 100 PPI (2010-2020)

Can we actually (do better and) show more data, for example try using:

1) Default font size that is as close to minimum (and NOT maximum)
   as possible pixels per character?

2) Default typeface that is similar to (a subset of) misc from
   the X fonts (for future Unicode)?

3) Thin legible fonts on laptop / desktop screens (work) at one arm
   length (or at least pick this as default) instead of (NOT) big
   rectangular fonts for phone / tablet at nose distance (play)?

4) Tunables for user preference when the above do not align in this
   2-years' resident font carver aesthetics / mood / vision quality?

5) Changes in direction of book fonts, NOT geoglyphs (alien road signs)?

6) Usable information display as higher priority over selected typeface?

I do NOT like this idea of being stuck with that for the next 10 years.

OpenBSD on 19-27" desktop is a very important use case for many people.

I can make compromise and not care much for the font face, but the size
as screen waste and lack of Unicode path really really annoys me a lot.

Kind regards,
Anton Lazarov

Sat, 5 Jan 2019 01:50:22 +0200 Artturi Alm <[hidden email]>

> Hi,
>
> guessing i'm not the only one wondering about these sizes, as w/current
> snapshot the font does seem too big for me(on 2560x1440 display, for
> which radeondrm(4) has never gotten the size right(giving only 1920x1200)).
>
> display.part of wsconsctl output w/the diff:
> display.type=radeondrm
> display.width=1920
> display.height=1200
> display.depth=32
> display.emulations=vt100
> display.col_x_row=120x37
> display.font_wxh=16x32
> display.screentypes=std
> display.focus=4
> display.screen_on=250
> display.screen_off=0
> display.vblank=off
> display.kbdact=on
> display.msact=on
> display.outact=on
>
> lazy(=ugly) not-so-minimal diff below.
>
> -Artturi
>
>
> diff --git a/sbin/wsconsctl/display.c b/sbin/wsconsctl/display.c
> index 6f789291142..9927a9d77c5 100644
> --- a/sbin/wsconsctl/display.c
> +++ b/sbin/wsconsctl/display.c
> @@ -42,6 +42,7 @@
>  
>  u_int dpytype;
>  u_int width, height, depth;
> +u_int cxr[2], fontwxh[2];
>  int focus;
>  struct field_pc brightness, contrast, backlight;
>  int burnon, burnoff, vblank, kbdact, msact, outact;
> @@ -55,6 +56,8 @@ struct field display_field_tab[] = {
>      { "height", &height, FMT_UINT, FLG_RDONLY },
>      { "depth", &depth, FMT_UINT, FLG_RDONLY },
>      { "emulations", &emuls, FMT_EMUL, FLG_RDONLY },
> +    { "col_x_row", &cxr, FMT_UINTX, FLG_RDONLY },
> +    { "font_wxh", &fontwxh, FMT_UINTX, FLG_RDONLY },
>      { "screentypes", &screens, FMT_SCREEN, FLG_RDONLY },
>      { "focus", &focus, FMT_INT, FLG_NORDBACK },
>      { "brightness", &brightness, FMT_PC, FLG_MODIFY|FLG_INIT },
> @@ -85,6 +88,7 @@ display_get_values(int fd)
>   void *ptr;
>   unsigned long cmd;
>   int bon = 0, fbon = 0;
> + int fson = 0;
>  
>   focus = gscr.idx = -1;
>   for (pf = display_field_tab; pf->name; pf++) {
> @@ -102,6 +106,10 @@ display_get_values(int fd)
>   } else if (ptr == &emuls) {
>   fillioctl(WSDISPLAYIO_GETEMULTYPE);
>   emuls.idx=0;
> + } else if (ptr == &cxr || ptr == &fontwxh) {
> + fillioctl(WSDISPLAYIO_GETSCREENTYPE);
> + ptr = &screens;
> + screens.idx = 0;
>   } else if (ptr == &screens) {
>   fillioctl(WSDISPLAYIO_GETSCREENTYPE);
>   screens.idx=0;
> @@ -168,6 +176,13 @@ display_get_values(int fd)
>   emuls.idx=fd;
>   } else if (ptr == &screens) {
>   screens.idx=fd;
> + if (!fson) {
> + cxr[0] = screens.ncols;
> + cxr[1] = screens.nrows;
> + fontwxh[0] = screens.fontwidth;
> + fontwxh[1] = screens.fontheight;
> + }
> + fson++;
>   } else if (ptr == &param) {
>   struct field_pc *pc = pf->valp;
>  
> diff --git a/sbin/wsconsctl/util.c b/sbin/wsconsctl/util.c
> index b0ac4b3e23f..071baf31f85 100644
> --- a/sbin/wsconsctl/util.c
> +++ b/sbin/wsconsctl/util.c
> @@ -186,6 +186,7 @@ int name2int(char *, const struct nameint *, int);
>  void print_kmap(struct wskbd_map_data *);
>  void print_emul(struct wsdisplay_emultype *);
>  void print_screen(struct wsdisplay_screentype *);
> +void print_uintx(u_int *);
>  
>  struct field *
>  field_by_name(struct field *field_tab, char *name)
> @@ -316,6 +317,9 @@ pr_field(const char *pre, struct field *f, const char *sep)
>   case FMT_CFG:
>   mousecfg_pr_field((struct wsmouse_parameters *) f->valp);
>   break;
> + case FMT_UINTX:
> + print_uintx((u_int *) f->valp);
> + break;
>   default:
>   errx(1, "internal error: pr_field: no format %d", f->format);
>   break;
> @@ -551,3 +555,9 @@ print_screen(struct wsdisplay_screentype *screens)
>   i = ioctl(fd, WSDISPLAYIO_GETSCREENTYPE, &s);
>   }
>  }
> +
> +void
> +print_uintx(u_int *ux)
> +{
> + printf("%ux%u", ux[0], ux[1]);
> +}
> diff --git a/sbin/wsconsctl/wsconsctl.h b/sbin/wsconsctl/wsconsctl.h
> index 3a6e38d67e2..93d42ed600a 100644
> --- a/sbin/wsconsctl/wsconsctl.h
> +++ b/sbin/wsconsctl/wsconsctl.h
> @@ -49,6 +49,7 @@ struct field {
>  #define FMT_SCREEN 108 /* wsdisplay screen types */
>  #define FMT_STRING 109 /* free string */
>  #define FMT_CFG 201 /* wsmouse parameters */
> +#define FMT_UINTX 202 /* u_int x u_int */
>   int format;
>  #define FLG_RDONLY 0x0001 /* variable cannot be modified */
>  #define FLG_WRONLY 0x0002 /* variable cannot be displayed */
>

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Theo de Raadt-2
> I do NOT like this idea of being stuck with that for the next 10 years.

when do make statements like that, why do you continue to believe any
of us care about any of your opinions?

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

lists-2
Just need a manual page and a tunable at some point, didn't much before.
Still needed more text lines on the console and utf8 options previously.

Got less chars now, so console is a regression in data thus readability.
Also, mention of direction in change log / commit message would be nice.

On 27" 2560x1440 panel, usable res was 1920x1200 160x54 and then 160x65.
Topic: show more data, now 160x45 (spleen 16x32) << 425x110 (misc 6x13).

2010-2020, stuck at about 50 lines at 100 PPI is a huge waste of pixels.

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Paul de Weerd
In reply to this post by lists-2
Lots of negativity here, so I just wanted to chime in - really love
the new console font!  Crisp and easily readable letters, big enough
to be readable, with a reasonable number of letters per line
(${COLUMNS}) en lines per screen (${LINES}).  It does mean pretty big
characters on big screens when in console mode, but on big screens I
want to run X anyway, so it's all good.  What I understand of the
algorithm to pick the font size makes a lot of sense to me.

Thank you Frederic for all the effort you put into this font and
making it happen on the console and in X through the fonts/spleen
port!

Cheers,

Paul 'WEiRD' de Weerd

--
>++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
+++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
                 http://www.weirdnet.nl/                 

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Mischa-2
I have to concur with Paul!
Saw the new font yesterday and was pleasantly surprised. Very nice!

Mischa

--

> On 6 Jan 2019, at 15:51, Paul de Weerd <[hidden email]> wrote:
>
> Lots of negativity here, so I just wanted to chime in - really love
> the new console font!  Crisp and easily readable letters, big enough
> to be readable, with a reasonable number of letters per line
> (${COLUMNS}) en lines per screen (${LINES}).  It does mean pretty big
> characters on big screens when in console mode, but on big screens I
> want to run X anyway, so it's all good.  What I understand of the
> algorithm to pick the font size makes a lot of sense to me.
>
> Thank you Frederic for all the effort you put into this font and
> making it happen on the console and in X through the fonts/spleen
> port!
>
> Cheers,
>
> Paul 'WEiRD' de Weerd
>
> --
>> ++++++++[<++++++++++>-]<+++++++.>+++[<------>-]<.>+++[<+
> +++++++++++>-]<.>++[<------------>-]<+.--------------.[-]
>                 http://www.weirdnet.nl/                 
>

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Robert Curry
In reply to this post by Paul de Weerd
Thank you Frederic for the new console font.  I agree with Mischa and
Paul and find it very clean and readable, a definite improvement.

--
Robert W. Curry

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Ted Unangst-6
In reply to this post by Artturi Alm
Artturi Alm wrote:
> display.width=1920
> display.height=1200
> display.depth=32
> display.emulations=vt100
> display.col_x_row=120x37
> display.font_wxh=16x32

now that we've all had a chance to weigh in on the font, why are you adding
this weird x format? speaking of ugly... it should print columns and rows just
like width and height.

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Theo de Raadt-2
Ted Unangst <[hidden email]> wrote:

> Artturi Alm wrote:
> > display.width=1920
> > display.height=1200
> > display.depth=32
> > display.emulations=vt100
> > display.col_x_row=120x37
> > display.font_wxh=16x32
>
> now that we've all had a chance to weigh in on the font, why are you adding
> this weird x format? speaking of ugly... it should print columns and rows just
> like width and height.

it is a waste of kernel and userland code since another mechanism already exists

use stty -a

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

lists-2
Mon, 07 Jan 2019 16:27:46 -0700 "Theo de Raadt" <[hidden email]>
>
> use stty -a
>

Also, probably complementary methods could be considered:

$ tput co li
$ wsfontload -l

Reply | Threaded
Open this post in threaded view
|

Re: sbin/wsconsctl: show more data

Artturi Alm
In reply to this post by lists-2
On Sat, Jan 05, 2019 at 10:39:46PM +0200, [hidden email] wrote:

> Just need a manual page and a tunable at some point, didn't much before.
> Still needed more text lines on the console and utf8 options previously.
>
> Got less chars now, so console is a regression in data thus readability.
> Also, mention of direction in change log / commit message would be nice.
>
> On 27" 2560x1440 panel, usable res was 1920x1200 160x54 and then 160x65.
> Topic: show more data, now 160x45 (spleen 16x32) << 425x110 (misc 6x13).
>
> 2010-2020, stuck at about 50 lines at 100 PPI is a huge waste of pixels.
>

if you're going to jsut complain w/o a diff,
you should do it at the source of it[0]; or just patch and move on.

-Artturi

[0]: https://bugzilla.kernel.org/show_bug.cgi?id=172421