Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| if (fstyle->kerning == 1) { | if (fstyle->kerning == 1) { | ||||
| /* for BLF_width */ | /* for BLF_width */ | ||||
| BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT); | BLF_enable(fstyle->uifont_id, BLF_KERNING_DEFAULT); | ||||
| } | } | ||||
| strwidth = BLF_width(fstyle->uifont_id, str, max_len); | strwidth = BLF_width(fstyle->uifont_id, str, max_len); | ||||
| if ((okwidth > 0.0f) && (strwidth > okwidth)) { | if ((okwidth > 0.0f) && (strwidth > okwidth)) { | ||||
| /* utf8 two-dots leader '..' (shorter than ellipsis '...'), | /* Ellipsis. Some compilers complain with real literal string. */ | ||||
| * some compilers complain with real literal string. */ | const char sep[] = {0xe2, 0x80, 0xA6, 0x0}; | ||||
| const char sep[] = {0xe2, 0x80, 0xA5, 0x0}; | |||||
| const int sep_len = sizeof(sep) - 1; | const int sep_len = sizeof(sep) - 1; | ||||
| const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1); | const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1); | ||||
| float parts_strwidth; | float parts_strwidth; | ||||
| size_t l_end; | size_t l_end; | ||||
| char *rpart = NULL, rpart_buf[UI_MAX_DRAW_STR]; | char *rpart = NULL, rpart_buf[UI_MAX_DRAW_STR]; | ||||
| float rpart_width = 0.0f; | float rpart_width = 0.0f; | ||||
| size_t rpart_len = 0; | size_t rpart_len = 0; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||