Mercurial > projects > mde
comparison mde/resource/font.d @ 49:bca7e2342d77
Enabled getting the size of a text block (before or after rendering).
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 31 May 2008 13:10:06 +0100 |
parents | a98ffb64f066 |
children | f68ae1d667f9 |
comparison
equal
deleted
inserted
replaced
48:a98ffb64f066 | 49:bca7e2342d77 |
---|---|
202 fontTex.updateCache (face, str, cache); | 202 fontTex.updateCache (face, str, cache); |
203 } | 203 } |
204 | 204 |
205 /** Draw a block of text (may inlcude new-lines). | 205 /** Draw a block of text (may inlcude new-lines). |
206 * | 206 * |
207 * The text block is drawn with top-left corner at x,y. To put the text's baseline at a given | |
208 * y coordinate would require some changes. Line height is currently variable, depending on the | |
209 * highest glyph in the line. | |
210 * | |
207 * As a CPU-side code optimisation, store a TextBlock (unique to str) and pass a reference as | 211 * As a CPU-side code optimisation, store a TextBlock (unique to str) and pass a reference as |
208 * the cache argument. This is the recommended method, although for one-time calls when you | 212 * the cache argument. This is the recommended method, although for one-time calls when you |
209 * don't need to know the size, the other version of textBlock may be used. | 213 * don't need to know the size, the other version of textBlock may be used. |
210 * --------------------------------- | 214 * --------------------------------- |
211 * char[] str; | 215 * char[] str; |