Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/bmfont/BMF_Api.h')
-rw-r--r--intern/bmfont/BMF_Api.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/intern/bmfont/BMF_Api.h b/intern/bmfont/BMF_Api.h
index 001a9788920..4465242e9fa 100644
--- a/intern/bmfont/BMF_Api.h
+++ b/intern/bmfont/BMF_Api.h
@@ -89,13 +89,30 @@ int BMF_GetCharacterWidth(BMF_Font* font, char c);
int BMF_GetStringWidth(BMF_Font* font, char* str);
/**
+ * Returns the bounding box of a string of characters.
+ * @param font The font to use.
+ * @param str The string.
+ * @param llx Lower left x coord
+ * @param lly Lower left y coord
+ * @param urx Upper right x coord
+ * @param ury Upper right y coord
+ */
+void BMF_GetStringBoundingBox(BMF_Font* font, char* str, float*llx, float *lly, float *urx, float *ury);
+
+
+/**
* Returns the bounding box of the font. The width and
* height represent the bounding box of the union of
* all glyps. The minimum and maximum values of the
* box represent the extent of the font and its positioning
* about the origin.
*/
-void BMF_GetBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r);
+void BMF_GetFontBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r);
+
+/**
+ * Same as GetFontBoundingBox but only returns the height
+ */
+int BMF_GetFontHeight(BMF_Font* font);
/**
* Convert the given @a font to a texture, and return the GL texture
@@ -122,6 +139,24 @@ int BMF_GetFontTexture(BMF_Font* font);
*/
void BMF_DrawStringTexture(BMF_Font* font, char* string, float x, float y, float z);
+ /**
+ * Draw the given @a string at the point @a xpos, @a ypos using
+ * char and float buffers.
+ *
+ * @param string The c-string to draw.
+ * @param xpos The x coordinate to start drawing at.
+ * @param ypos The y coordinate to start drawing at.
+ * @param fgcol The forground color.
+ * @param bgcol The background color.
+ * @param buf Unsigned char image buffer, when NULL to not operate on it.
+ * @param fbuf float image buffer, when NULL to not operate on it.
+ * @param w image buffer width.
+ * @param h image buffer height.
+ * @param channels number of channels in the image (3 or 4 - currently)
+ */
+void BMF_DrawStringBuf(BMF_Font* font, char *str, int posx, int posy, float *col, unsigned char *buf, float *fbuf, int w, int h, int channels);
+
+
#ifdef __cplusplus
}
#endif