From: Keith.S.Thompson+u@gmail.com   
      
   bart writes:   
   > On 03/12/2025 19:01, James Kuyper wrote:   
   [...]   
   >> I find it confusing that this is supposed to "work perfectly"   
   >> "across   
   >> diverse OSs". The amount of space that a character takes up varies   
   >> depending upon the installed fonts, especially on whether the font is   
   >> monospaced or proportional. Those fonts can be different for display on   
   >> screen or on a printer. I don't see any query to determine even what the   
   >> current font is, much less what it's characteristics are. I don't know   
   >> of any OS-independent way of collecting such information. Does this   
   >> solution "work perfectly" only for your own particular favorite font?   
   >   
   > This looks like a solution for a fixed-pitch font. I get this output   
   > for a Windows console display (with - used for space):   
   [...]   
      
   I think bart is right that this is specific to fixed-width fonts.   
   For a variable width font, 'W' is going to be wider than '|'.   
      
   See also the POSIX `int wcwidth(wchar_t wc)` function, which returns   
   the "number of column positions of a wide-character code". It does   
   depend on the current locale.   
      
   The assumption seems to be that fixed-width fonts are expected to be   
   consistent about the widths of characters.   
      
   --   
   Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com   
   void Void(void) { Void(); } /* The recursive call of the void */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|