bounding box of n glyphs, given individual bboxes and advances <p>For specific reasons, I'm implementing my own font rendering, and an algorithm to compute the bounding box of a text by using bounding boxes of single glyphs, together with the respective advance, is needed. For clarification see <a href="http://www.freetype.org/freetype2/docs/glyphs/Image3.png" rel="nofollow noreferrer">this illustration</a>:</p> <p><img src="https://i.stack.imgur.com/xWaoq.png" alt="enter image description here"></p> <p>For every of these <em>N</em> glyphs is given the relative bbox relative to the origin (xmin, xmax, ymin, ymax), and the advance (pseudocode):</p> <pre><code>int xmin[N], xmax[N], ymin[N], ymax[N], adv[N]; </code></pre> <p>I will give the answer myself if noone bites.</p>