The horizontal and vertical motion quanta from a device's DESC file are exposed via the `.H` and `.V` registers, respectively. But the device resolution is not.
This seems like it would be a useful thing to have, so that a document could dynamically adapt to it. There is a somewhat sleazy way to get this information; your document can read the `.o` (page offset) register, which _conventionally_ is set to 1 inch, so that will give you the number of basic units per inch, which is the definition of device resolution. However, this technique will fail with the following, for instance: groff -rO0.5i -mm The mm(7) package allows the page offset to be overridden by the `O` register on the command-line, so by the time a document can query the `.o` register, it's too late--and the user could have set it to any old thing. Also, the page offset is usually zero on terminal devices, though admittedly these output devices are so inflexible in positioning that having resolution information might not enable much. But perhaps my imagination is too limited here. If nobody has a good answer I'm strongly tempted to add a new read-only register, `.res`. Regards, Branden
signature.asc
Description: PGP signature