| 974 | } |
| 975 | |
| 976 | void MakeQFont(obs_data_t *font_obj, QFont &font, bool limit = false) |
| 977 | { |
| 978 | const char *face = obs_data_get_string(font_obj, "face"); |
| 979 | const char *style = obs_data_get_string(font_obj, "style"); |
| 980 | int size = (int)obs_data_get_int(font_obj, "size"); |
| 981 | uint32_t flags = (uint32_t)obs_data_get_int(font_obj, "flags"); |
| 982 | |
| 983 | if (face) { |
| 984 | font.setFamily(face); |
| 985 | font.setStyleName(style); |
| 986 | } |
| 987 | |
| 988 | if (size) { |
| 989 | if (limit) { |
| 990 | int max_size = font.pointSize(); |
| 991 | if (max_size < 28) |
| 992 | max_size = 28; |
| 993 | if (size > max_size) |
| 994 | size = max_size; |
| 995 | } |
| 996 | font.setPointSize(size); |
| 997 | } |
| 998 | |
| 999 | if (flags & OBS_FONT_BOLD) |
| 1000 | font.setBold(true); |
| 1001 | if (flags & OBS_FONT_ITALIC) |
| 1002 | font.setItalic(true); |
| 1003 | if (flags & OBS_FONT_UNDERLINE) |
| 1004 | font.setUnderline(true); |
| 1005 | if (flags & OBS_FONT_STRIKEOUT) |
| 1006 | font.setStrikeOut(true); |
| 1007 | } |
| 1008 | |
| 1009 | void OBSPropertiesView::AddFont(obs_property_t *prop, QFormLayout *layout, |
| 1010 | QLabel *&label) |
no outgoing calls
no test coverage detected