void blf_font_width_and_height( FontBLF *font, const char *str, size_t len, float *r_width, float *r_height, struct ResultBLF *r_info) { float xa, ya; rctf box; if (font->flags & BLF_ASPECT) { xa = font->aspect[0]; ya = font->aspect[1]; } else { xa = 1.0f; ya = 1.0f; } if (font->flags & BLF_WORD_WRAP) { blf_font_boundbox__wrap(font, str, len, &box, r_info); } else { blf_font_boundbox(font, str, len, &box, r_info); } *r_width = (BLI_rctf_size_x(&box) * xa); *r_height = (BLI_rctf_size_y(&box) * ya); }
void BLF_boundbox(int fontid, const char *str, rctf *box) { FontBLF *font; font= BLF_get(fontid); if (font) blf_font_boundbox(font, str, box); }
void BLF_boundbox(int fontid, const char *str, size_t len, rctf *box) { FontBLF *font = blf_get(fontid); if (font) { blf_font_boundbox(font, str, len, box); } }
float blf_font_height(FontBLF *font, const char *str, size_t len) { float ya; rctf box; if (font->flags & BLF_ASPECT) ya = font->aspect[1]; else ya = 1.0f; blf_font_boundbox(font, str, len, &box); return BLI_rctf_size_y(&box) * ya; }
float blf_font_width(FontBLF *font, const char *str, size_t len) { float xa; rctf box; if (font->flags & BLF_ASPECT) xa = font->aspect[0]; else xa = 1.0f; blf_font_boundbox(font, str, len, &box); return BLI_rctf_size_x(&box) * xa; }
float blf_font_height(FontBLF *font, const char *str) { float ya; rctf box; if (font->flags & BLF_ASPECT) ya = font->aspect[1]; else ya = 1.0f; blf_font_boundbox(font, str, &box); return (box.ymax - box.ymin) * ya; }
float blf_font_width(FontBLF *font, const char *str) { float xa; rctf box; if (font->flags & BLF_ASPECT) xa = font->aspect[0]; else xa = 1.0f; blf_font_boundbox(font, str, &box); return (box.xmax - box.xmin) * xa; }
void BLF_boundbox_ex( int fontid, const char *str, size_t len, rctf *r_box, struct ResultBLF *r_info) { FontBLF *font = blf_get(fontid); BLF_RESULT_CHECK_INIT(r_info); if (font) { if (font->flags & BLF_WORD_WRAP) { blf_font_boundbox__wrap(font, str, len, r_box, r_info); } else { blf_font_boundbox(font, str, len, r_box, r_info); } } }
void blf_font_width_and_height(FontBLF *font, const char *str, size_t len, float *width, float *height) { float xa, ya; rctf box; if (font->flags & BLF_ASPECT) { xa = font->aspect[0]; ya = font->aspect[1]; } else { xa = 1.0f; ya = 1.0f; } blf_font_boundbox(font, str, len, &box); *width = (BLI_rctf_size_x(&box) * xa); *height = (BLI_rctf_size_y(&box) * ya); }
float blf_font_height(FontBLF *font, const char *str, size_t len, struct ResultBLF *r_info) { float ya; rctf box; if (font->flags & BLF_ASPECT) ya = font->aspect[1]; else ya = 1.0f; if (font->flags & BLF_WORD_WRAP) { blf_font_boundbox__wrap(font, str, len, &box, r_info); } else { blf_font_boundbox(font, str, len, &box, r_info); } return BLI_rctf_size_y(&box) * ya; }
float blf_font_width(FontBLF *font, const char *str, size_t len, struct ResultBLF *r_info) { float xa; rctf box; if (font->flags & BLF_ASPECT) xa = font->aspect[0]; else xa = 1.0f; if (font->flags & BLF_WORD_WRAP) { blf_font_boundbox__wrap(font, str, len, &box, r_info); } else { blf_font_boundbox(font, str, len, &box, r_info); } return BLI_rctf_size_x(&box) * xa; }
void blf_font_width_and_height(FontBLF *font, const char *str, float *width, float *height) { float xa, ya; rctf box; if (font->flags & BLF_ASPECT) { xa = font->aspect[0]; ya = font->aspect[1]; } else { xa = 1.0f; ya = 1.0f; } blf_font_boundbox(font, str, &box); *width = ((box.xmax - box.xmin) * xa); *height = ((box.ymax - box.ymin) * ya); }