diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-21 20:08:23 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-08-21 20:08:23 +0300 |
commit | 596c3368f4b09bdeec46e7b44abfc8bcb7ba8fcf (patch) | |
tree | 09a8d4af2f134db67579577d38ad78fa667afede | |
parent | 794836c8f17a2feaa43d31d23982fa41e3f953a4 (diff) | |
parent | 34029fc71a3cc7e69f977462d4b3f09eb10ccca2 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 6 | ||||
-rw-r--r-- | build_files/build_environment/cmake/osl.cmake | 20 | ||||
-rw-r--r-- | build_files/build_environment/cmake/pugixml.cmake | 21 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 7 | ||||
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 8 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 21 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 25 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 15 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 3 |
10 files changed, 94 insertions, 39 deletions
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 44349f78db6..57b76fdd1bd 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -54,8 +54,6 @@ if(BUILD_MODE STREQUAL Release) # tiff ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ && - # Osl - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/osl/ ${HARVEST_TARGET}/osl && # BlendThumb ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb64/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb64.dll && ${CMAKE_COMMAND} -E copy ${LIBDIR}/BlendThumb32/bin/blendthumb.dll ${HARVEST_TARGET}/ThumbHandler/lib/BlendThumb.dll && @@ -72,10 +70,6 @@ if(BUILD_MODE STREQUAL Debug) # OpenImageIO COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib && ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib && - # osl - ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib && - ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib && - ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib && # python ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/python/ ${HARVEST_TARGET}/python/ && # hdf5 diff --git a/build_files/build_environment/cmake/osl.cmake b/build_files/build_environment/cmake/osl.cmake index 73e62f73cf2..e73a4041405 100644 --- a/build_files/build_environment/cmake/osl.cmake +++ b/build_files/build_environment/cmake/osl.cmake @@ -101,3 +101,23 @@ add_dependencies( external_openimageio external_pugixml ) + +if(WIN32) + if(BUILD_MODE STREQUAL Release) + ExternalProject_Add_Step(external_osl after_install + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/osl/ ${HARVEST_TARGET}/osl + DEPENDEES install + ) + endif() + if(BUILD_MODE STREQUAL Debug) + ExternalProject_Add_Step(external_osl after_install + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib + DEPENDEES install + ) + endif() +endif() + + + diff --git a/build_files/build_environment/cmake/pugixml.cmake b/build_files/build_environment/cmake/pugixml.cmake index bb1cb985e37..fe5a77efa33 100644 --- a/build_files/build_environment/cmake/pugixml.cmake +++ b/build_files/build_environment/cmake/pugixml.cmake @@ -27,10 +27,17 @@ ExternalProject_Add(external_pugixml CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pugixml ${DEFAULT_CMAKE_FLAGS} ${PUGIXML_EXTRA_ARGS} INSTALL_DIR ${LIBDIR}/pugixml ) - -#if(BUILD_MODE STREQUAL Release AND WIN32) - #ExternalProject_Add_Step(external_freetype after_install - # COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype - # DEPENDEES install - #) -#endif() +if(WIN32) + if(BUILD_MODE STREQUAL Release) + ExternalProject_Add_Step(external_pugixml after_install + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml.lib + DEPENDEES install + ) + endif() + if(BUILD_MODE STREQUAL Debug) + ExternalProject_Add_Step(external_pugixml after_install + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib + DEPENDEES install + ) + endif() +endif()
\ No newline at end of file diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index ddcc19a3781..4e12dcc75d4 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -533,9 +533,10 @@ class USERPREF_PT_system(Panel): col.separator() col.label(text="Text Draw Options:") - col.prop(system, "use_text_antialiasing") - if system.use_text_antialiasing: - col.prop(system, "use_text_hinting") + col.prop(system, "use_text_antialiasing", text="Anti-aliasing") + sub = col.column() + sub.active = system.use_text_antialiasing + sub.prop(system, "text_hinting", text="Hinting") # 3. Column column = split.column() diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 5a0ade1069e..8a3728574f3 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -230,9 +230,11 @@ void BLF_state_print(int fontid); #define BLF_KERNING_DEFAULT (1 << 3) #define BLF_MATRIX (1 << 4) #define BLF_ASPECT (1 << 5) -#define BLF_HINTING (1 << 6) -#define BLF_WORD_WRAP (1 << 7) -#define BLF_MONOCHROME (1 << 8) /* no-AA */ +#define BLF_WORD_WRAP (1 << 6) +#define BLF_MONOCHROME (1 << 7) /* no-AA */ +#define BLF_HINTING_NONE (1 << 8) +#define BLF_HINTING_SLIGHT (1 << 9) +#define BLF_HINTING_FULL (1 << 10) #define BLF_DRAW_STR_DUMMY_MAX 1024 diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 5b1a382e368..2679deea254 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -269,7 +269,6 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) GlyphBLF *g; FT_Error err; FT_Bitmap bitmap, tempbitmap; - int flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP; FT_BBox bbox; unsigned int key; @@ -290,13 +289,27 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c) return g; } - if (font->flags & BLF_HINTING) - flags &= ~FT_LOAD_NO_HINTING; - if (font->flags & BLF_MONOCHROME) { err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO); } else { + int flags = FT_LOAD_NO_BITMAP; + + if (font->flags & BLF_HINTING_NONE) { + flags |= FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING; + } + else if (font->flags & BLF_HINTING_SLIGHT) { + flags |= FT_LOAD_TARGET_LIGHT; + } + else if (font->flags & BLF_HINTING_FULL) { + flags |= FT_LOAD_TARGET_NORMAL; + } + else { + /* Default, hinting disabled until FreeType has been upgraded + * to give good results on all platforms. */ + flags |= FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING; + } + err = FT_Load_Glyph(font->face, (FT_UInt)index, flags); } diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index ed4c766c596..16c3e01e7aa 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -524,30 +524,35 @@ void uiStyleInit(void) /* Set default flags based on UI preferences (not render fonts) */ { - int flag_enable = 0, flag_disable = 0; - if ((U.text_render & USER_TEXT_DISABLE_HINTING) == 0) { - flag_enable |= BLF_HINTING; + int flag_disable = BLF_MONOCHROME | + BLF_HINTING_NONE | + BLF_HINTING_SLIGHT | + BLF_HINTING_FULL; + int flag_enable = 0; + + if (U.text_render & USER_TEXT_HINTING_NONE) { + flag_enable |= BLF_HINTING_NONE; } - else { - flag_disable |= BLF_HINTING; + else if (U.text_render & USER_TEXT_HINTING_SLIGHT) { + flag_enable |= BLF_HINTING_SLIGHT; + } + else if (U.text_render & USER_TEXT_HINTING_FULL) { + flag_enable |= BLF_HINTING_FULL; } if (U.text_render & USER_TEXT_DISABLE_AA) { flag_enable |= BLF_MONOCHROME; } - else { - flag_disable |= BLF_MONOCHROME; - } for (font = U.uifonts.first; font; font = font->next) { if (font->blf_id != -1) { - BLF_enable(font->blf_id, flag_enable); BLF_disable(font->blf_id, flag_disable); + BLF_enable(font->blf_id, flag_enable); } } if (blf_mono_font != -1) { - BLF_enable(blf_mono_font, flag_enable); BLF_disable(blf_mono_font, flag_disable); + BLF_enable(blf_mono_font, flag_enable); } } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index cb2c69e2fa1..362a9232553 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -72,7 +72,7 @@ typedef struct uiFont { short blf_id; /* from blfont lib */ short uifont_id; /* own id (eUIFont_ID) */ short r_to_l; /* fonts that read from left to right */ - short hinting; + short pad; } uiFont; /* this state defines appearance of text */ @@ -865,7 +865,10 @@ typedef enum eOpenGL_AntiAliasMethod { * UserDef.text_render */ typedef enum eText_Draw_Options { USER_TEXT_DISABLE_AA = (1 << 0), - USER_TEXT_DISABLE_HINTING = (1 << 1), + + USER_TEXT_HINTING_NONE = (1 << 1), + USER_TEXT_HINTING_SLIGHT = (1 << 2), + USER_TEXT_HINTING_FULL = (1 << 3), } eText_Draw_Options; /* tw_flag (transform widget) */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 4c3074bba4f..9db7b0b807c 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -4125,6 +4125,14 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static const EnumPropertyItem text_hinting_items[] = { + {0, "AUTO", 0, "Auto", ""}, + {USER_TEXT_HINTING_NONE, "NONE", 0, "None", ""}, + {USER_TEXT_HINTING_SLIGHT, "SLIGHT", 0, "Slight", ""}, + {USER_TEXT_HINTING_FULL, "FULL", 0, "Full", ""}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); @@ -4348,9 +4356,10 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased"); RNA_def_property_update(prop, 0, "rna_userdef_text_update"); - prop = RNA_def_property(srna, "use_text_hinting", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_HINTING); - RNA_def_property_ui_text(prop, "Text Hinting", "Draw user interface text with hinting"); + prop = RNA_def_property(srna, "text_hinting", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "text_render"); + RNA_def_property_enum_items(prop, text_hinting_items); + RNA_def_property_ui_text(prop, "Text Hinting", "Method for making user interface text render sharp"); RNA_def_property_update(prop, 0, "rna_userdef_text_update"); prop = RNA_def_property(srna, "select_method", PROP_ENUM, PROP_NONE); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index edcc2bef0c5..9b74b551b20 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -133,6 +133,7 @@ static const EnumPropertyItem property_subtype_array_items[] = { {PROP_XYZ, "XYZ", 0, "XYZ", ""}, {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Color Gamma", ""}, {PROP_LAYER, "LAYER", 0, "Layer", ""}, + {PROP_LAYER_MEMBER, "LAYER_MEMBER", 0, "Layer Member", ""}, {PROP_NONE, "NONE", 0, "None", ""}, {0, NULL, 0, NULL, NULL}}; @@ -140,7 +141,7 @@ static const EnumPropertyItem property_subtype_array_items[] = { #define BPY_PROPDEF_SUBTYPE_ARRAY_DOC \ " :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', " \ "'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', " \ - "'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n" \ + "'XYZ', 'COLOR_GAMMA', 'LAYER', 'LAYER_MEMBER', 'NONE'].\n" \ " :type subtype: string\n" /* PyObject's */ |