doc_columns()

Return the man page width in columns that fills width_px of screen.

Usage

doc_columns(width_px)

Rounded down to a multiple of five so dragging the window edge re-renders a handful of times rather than once per pixel, and clamped because a man page set much below 60 columns loses its indentation and much above 220 is too wide a line to read.