The problem I am trying to solve is determining how many columns of the current buffer are hidden due to horizontal scrolling. The documentation states:
The horizontal scroll position is measured in units of the normal character width, which is the width of space in the default font. Thus, if the value is 5, that means the window contents are scrolled left by 5 times the normal character width. How many characters actually disappear off to the left depends on their width, and could vary from line to line.
Thus, when the font in the buffer is the default font and the latter is mono-space, the number of hidden columns is given by
(window-hscroll). In my case, the buffer's font, although mono-space, differs from the default font. So, how can I get something more relevant than
(window-hscroll) in this case? Or, alternatively, can I trick
window-hscroll or, even better, the functions that perform the actual scrolling into considering the buffer's font to be the default?
EDIT: SOME BACKGROUND
I use the buffer to display a large graph produced by Graph::Easy. I need to be able to scroll the window so as to make a given node visible and centered. The lines have been padded with spaces from both ends, so that all lines are of the same (and sufficient) length. Also, the font is mono-space, so it does not matter which line to pick for the calculation.