Attached is small lisp program and a screenshot of the output. From the screenshot itself it is visible that for string with large non-default font-size the reported width is erroneous. It should be close to frame/window size in this particular example, but reported size is missing ~500 pixels. For small sizes it seems to report relatively ok. The clock is ~70 pixels according to Gimp's measure tool, +/- some, so it is more visible with big sizes.