Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_style.c
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2009 Blender Foundation. | * The Original Code is Copyright (C) 2009 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup edinterface | * \ingroup edinterface | ||||
| */ | */ | ||||
| #include <CLG_log.h> | |||||
| #include <limits.h> | #include <limits.h> | ||||
| #include <math.h> | #include <math.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| Show All 32 Lines | |||||
| * - default column properties, internal spacing, aligning, min/max width | * - default column properties, internal spacing, aligning, min/max width | ||||
| * - button alignment rules (for groups) | * - button alignment rules (for groups) | ||||
| * - label placement rules | * - label placement rules | ||||
| * - internal labeling or external labeling default | * - internal labeling or external labeling default | ||||
| * - default minimum widths for buttons/labels (in amount of characters) | * - default minimum widths for buttons/labels (in amount of characters) | ||||
| * - font types, styles and relative sizes for Panel titles, labels, etc. | * - font types, styles and relative sizes for Panel titles, labels, etc. | ||||
| */ | */ | ||||
| static CLG_LogRef LOG = {"interface.style"}; | |||||
| /* ********************************************** */ | /* ********************************************** */ | ||||
| static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id) | static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id) | ||||
| { | { | ||||
| uiStyle *style = MEM_callocN(sizeof(uiStyle), "new style"); | uiStyle *style = MEM_callocN(sizeof(uiStyle), "new style"); | ||||
| BLI_addtail(styles, style); | BLI_addtail(styles, style); | ||||
| BLI_strncpy(style->name, name, MAX_STYLE_NAME); | BLI_strncpy(style->name, name, MAX_STYLE_NAME); | ||||
| ▲ Show 20 Lines • Show All 396 Lines • ▼ Show 20 Lines | else { | ||||
| if (font->blf_id == -1) { | if (font->blf_id == -1) { | ||||
| font->blf_id = BLF_load_default(unique); | font->blf_id = BLF_load_default(unique); | ||||
| } | } | ||||
| } | } | ||||
| BLF_default_set(font->blf_id); | BLF_default_set(font->blf_id); | ||||
| if (font->blf_id == -1) { | if (font->blf_id == -1) { | ||||
| if (G.debug & G_DEBUG) { | CLOG_STR_ERROR(&LOG, "no fonts available"); | ||||
| printf("%s: error, no fonts available\n", __func__); | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| /* ? just for speed to initialize? | /* ? just for speed to initialize? | ||||
| * Yes, this build the glyph cache and create | * Yes, this build the glyph cache and create | ||||
| * the texture. | * the texture. | ||||
| */ | */ | ||||
| BLF_size(font->blf_id, 11 * U.pixelsize, U.dpi); | BLF_size(font->blf_id, 11 * U.pixelsize, U.dpi); | ||||
| BLF_size(font->blf_id, 12 * U.pixelsize, U.dpi); | BLF_size(font->blf_id, 12 * U.pixelsize, U.dpi); | ||||
| ▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines | |||||