CMakeLists.txt | 115 ++++++++++++++++------------------- src/Makefile.am | 4 - src/hb-common.cc | 6 + src/hb-graphite2.cc | 32 ++++----- src/hb-ot-layout-gsubgpos-private.hh | 2 src/hb-shape-plan.cc | 7 +- test/shaping/README.md | 2 7 files changed, 80 insertions(+), 88 deletions(-)
New commits: commit 74b99ef2249107e7cd01bd1ee522a5d9ce61e05f Author: mhosken <mhos...@users.noreply.github.com> Date: Thu Apr 20 19:13:22 2017 +0100 Fix graphite2 rtl conversion (#475) diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index 5b804b82..c9799e9d 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -301,7 +301,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, hb_codepoint_t *pg = gids; clusters[0].cluster = buffer->info[0].cluster; - float curradv = HB_DIRECTION_IS_BACKWARD(buffer->props.direction) ? gr_slot_origin_X(gr_seg_first_slot(seg)) : 0.; + float curradv = 0.; if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) { curradv = gr_slot_origin_X(gr_seg_first_slot(seg)); @@ -330,13 +330,10 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, c->base_glyph = ic; c->num_glyphs = 0; if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) - { - ci++; - clusters[ci].advance = curradv - gr_slot_origin_X(is); - } else { + c->advance = curradv - gr_slot_origin_X(is); + else clusters[ci].advance = gr_slot_origin_X(is) - curradv; - ci++; - } + ci++; curradv = gr_slot_origin_X(is); } clusters[ci].num_glyphs++; @@ -345,7 +342,9 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, clusters[ci].num_chars = after + 1 - clusters[ci].base_char; } - if (!HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) + if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) + clusters[ci].advance += curradv; + else clusters[ci].advance = gr_seg_advance_X(seg) - curradv; ci++; @@ -366,11 +365,11 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, float yscale = (float) font->y_scale / upem; yscale *= yscale / xscale; /* Positioning. */ + int currclus = -1; + const hb_glyph_info_t *info = buffer->info; + hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL); if (!HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) { - int currclus = -1; - const hb_glyph_info_t *info = buffer->info; - hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL); curradvx = 0; for (is = gr_seg_first_slot (seg); is; pPos++, ++info, is = gr_slot_next_in_segment (is)) { @@ -389,23 +388,20 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, } else { - int currclus = -1; - const hb_glyph_info_t *info = buffer->info; - hb_glyph_position_t *pPos = hb_buffer_get_glyph_positions (buffer, NULL); - curradvx = gr_seg_advance_X(seg) * xscale; + curradvx = gr_seg_advance_X(seg); for (is = gr_seg_first_slot (seg); is; pPos++, info++, is = gr_slot_next_in_segment (is)) { if (info->cluster != currclus) { pPos->x_advance = info->var1.i32 * xscale; - if (currclus != -1) curradvx -= info[-1].var1.i32 * xscale; + curradvx -= pPos->x_advance; currclus = info->cluster; } else - pPos->x_advance = 0.; + pPos->x_advance = 0.; pPos->y_advance = gr_slot_advance_Y (is, grface, NULL) * yscale; curradvy -= pPos->y_advance; - pPos->x_offset = gr_slot_origin_X (is) * xscale - curradvx + pPos->x_advance; + pPos->x_offset = (gr_slot_origin_X (is) - info->var1.i32) * xscale - curradvx + pPos->x_advance; pPos->y_offset = gr_slot_origin_Y (is) * yscale - curradvy; } hb_buffer_reverse_clusters (buffer); commit 696641314e7eb60a5a2e08c1c4fd1e5e41022148 Author: ebraminio <ebra...@gnu.org> Date: Wed Apr 19 22:59:46 2017 +0430 [cmake] Final touches (#473) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c03f2bb..91e7eca0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,12 +19,16 @@ endif () ## HarfBuzz build configurations option(HB_HAVE_FREETYPE "Enable freetype interop helpers" OFF) option(HB_HAVE_GRAPHITE2 "Enable Graphite2 complementary shaper" OFF) -option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper backend on Windows" OFF) -option(HB_HAVE_DIRECWRITE "Enable DirectWrite shaper backend on Windows" OFF) -option(HB_HAVE_CORETEXT "Enable CoreText shaper backend on macOS" ON) option(HB_BUILTIN_UCDN "Use HarfBuzz provided UCDN" ON) option(HB_HAVE_GLIB "Enable glib unicode functions" OFF) option(HB_HAVE_ICU "Enable icu unicode functions" OFF) +if (APPLE) + option(HB_HAVE_CORETEXT "Enable CoreText shaper backend on macOS" ON) +endif () +if (WIN32) + option(HB_HAVE_UNISCRIBE "Enable Uniscribe shaper backend on Windows" OFF) + option(HB_HAVE_DIRECWRITE "Enable DirectWrite shaper backend on Windows" OFF) +endif () option(HB_BUILD_UTILS "Build harfbuzz utils, needs cairo, freetype, and glib properly be installed" OFF) if (HB_BUILD_UTILS) set(HB_HAVE_GLIB ON) @@ -68,45 +72,35 @@ function (prepend var prefix) set(${var} "${listVar}" PARENT_SCOPE) endfunction () -file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES) -file(READ ${PROJECT_SOURCE_DIR}/util/Makefile.sources UTILSOURCES) -file(READ ${PROJECT_SOURCE_DIR}/src/hb-ucdn/Makefile.sources UCDNSOURCES) - -function (extract_make_variable variable file) +function (extract_make_variable variable file prefix) string(REGEX MATCH "${variable} = ([^$]+)\\$" temp ${file}) string(REGEX MATCHALL "[^ \n\t\\]+" list ${CMAKE_MATCH_1}) + prepend(list ${prefix} ${list}) set(${variable} ${list} PARENT_SCOPE) endfunction () -extract_make_variable(HB_BASE_sources ${SRCSOURCES}) -extract_make_variable(HB_BASE_headers ${SRCSOURCES}) -extract_make_variable(HB_OT_sources ${SRCSOURCES}) -extract_make_variable(HB_OT_headers ${SRCSOURCES}) -extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES}) -extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES}) - -extract_make_variable(HB_VIEW_sources ${UTILSOURCES}) -extract_make_variable(HB_SHAPE_sources ${UTILSOURCES}) -extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES}) +file(READ ${PROJECT_SOURCE_DIR}/src/Makefile.sources SRCSOURCES) +file(READ ${PROJECT_SOURCE_DIR}/util/Makefile.sources UTILSOURCES) +file(READ ${PROJECT_SOURCE_DIR}/src/hb-ucdn/Makefile.sources UCDNSOURCES) -extract_make_variable(LIBHB_UCDN_sources ${UCDNSOURCES}) +extract_make_variable(HB_BASE_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/") +extract_make_variable(HB_BASE_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/") +extract_make_variable(HB_OT_sources ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/") +extract_make_variable(HB_OT_headers ${SRCSOURCES} "${PROJECT_SOURCE_DIR}/src/") -prepend(HB_BASE_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_sources}) -prepend(HB_BASE_headers "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_headers}) -prepend(HB_OT_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_sources}) -prepend(HB_OT_headers "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_headers}) if (IN_HB_DIST) - prepend(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_BASE_RAGEL_GENERATED_sources}) - prepend(HB_OT_RAGEL_GENERATED_sources "${PROJECT_SOURCE_DIR}/src/" ${HB_OT_RAGEL_GENERATED_sources}) + set(RAGEL_GENERATED_DIR "${PROJECT_SOURCE_DIR}/src/") else () - prepend(HB_BASE_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/" ${HB_BASE_RAGEL_GENERATED_sources}) - prepend(HB_OT_RAGEL_GENERATED_sources "${PROJECT_BINARY_DIR}/src/" ${HB_OT_RAGEL_GENERATED_sources}) + set(RAGEL_GENERATED_DIR "${PROJECT_BINARY_DIR}/src/") endif () -prepend(HB_VIEW_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_VIEW_sources}) -prepend(HB_SHAPE_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_SHAPE_sources}) -prepend(HB_OT_SHAPE_CLOSURE_sources "${PROJECT_SOURCE_DIR}/util/" ${HB_OT_SHAPE_CLOSURE_sources}) +extract_make_variable(HB_BASE_RAGEL_GENERATED_sources ${SRCSOURCES} ${RAGEL_GENERATED_DIR}) +extract_make_variable(HB_OT_RAGEL_GENERATED_sources ${SRCSOURCES} ${RAGEL_GENERATED_DIR}) -prepend(LIBHB_UCDN_sources "${PROJECT_SOURCE_DIR}/src/hb-ucdn/" ${LIBHB_UCDN_sources}) +extract_make_variable(HB_VIEW_sources ${UTILSOURCES} "${PROJECT_SOURCE_DIR}/util/") +extract_make_variable(HB_SHAPE_sources ${UTILSOURCES} "${PROJECT_SOURCE_DIR}/util/") +extract_make_variable(HB_OT_SHAPE_CLOSURE_sources ${UTILSOURCES} "${PROJECT_SOURCE_DIR}/util/") + +extract_make_variable(LIBHB_UCDN_sources ${UCDNSOURCES} "${PROJECT_SOURCE_DIR}/src/hb-ucdn/") file(READ configure.ac CONFIGUREAC) string(REGEX MATCH "\\[(([0-9]+)\\.([0-9]+)\\.([0-9]+))\\]" HB_VERSION_MATCH ${CONFIGUREAC}) @@ -123,7 +117,7 @@ if (NOT IN_HB_DIST) if (RAGEL) message(STATUS "ragel found at: ${RAGEL}") else () - message(FATAL_ERROR "ragel not found, get it here -- http://www.complang.org/ragel/") + message(FATAL_ERROR "ragel not found, get it here -- http://www.complang.org/ragel/ or, use harfbuzz releases https://github.com/behdad/harfbuzz/releases") endif () foreach (ragel_output IN ITEMS ${HB_BASE_RAGEL_GENERATED_sources} ${HB_OT_RAGEL_GENERATED_sources}) @@ -135,6 +129,8 @@ if (NOT IN_HB_DIST) ) add_custom_target(harfbuzz_${target_name} DEPENDS ${PROJECT_BINARY_DIR}/src/${target_name}) endforeach () + + mark_as_advanced(RAGEL) ## ## Generate hb-version.h @@ -166,37 +162,29 @@ set(project_headers ) if (HB_HAVE_FREETYPE) - set(FREETYPE_DIR "$ENV{FREETYPE_DIR}" - CACHE PATH "root path for freetype lib/ and include/ folders" - ) - find_path(FREETYPE_INCLUDE_DIR - ft2build.h freetype2/freetype/freetype.h - PATHS ${FREETYPE_DIR}/include - ) + add_definitions(-DHAVE_FREETYPE=1 -DHAVE_FT_FACE_GETCHARVARIANTINDEX=1) + # https://github.com/WebKit/webkit/blob/master/Source/cmake/FindFreetype2.cmake + find_package(PkgConfig) + pkg_check_modules(PC_FREETYPE2 QUIET freetype2) + + find_path(FREETYPE2_HEADER_DIR NAMES freetype.h HINTS ${PC_FREETYPE2_INCLUDE_DIRS} ${PC_FREETYPE2_INCLUDEDIR} $ENV{FREETYPE_DIR}/include PATH_SUFFIXES freetype) + find_path(FREETYPE2_ROOT_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${PC_FREETYPE2_INCLUDE_DIRS} ${PC_FREETYPE2_INCLUDEDIR} $ENV{FREETYPE_DIR}/include) if (CMAKE_BUILD_TYPE MATCHES Debug) - find_library(FREETYPE_DEBUG_LIBRARY freetyped) - set(FREETYPE_ACTUAL_LIBRARY ${FREETYPE_DEBUG_LIBRARY}) + set(FREETYPE2_LIBRARY_NAME freetyped) else () - find_library(FREETYPE_LIBRARY - freetype libfreetype - PATHS ${FREETYPE_DIR}/lib - DOC "freetype library" - ) - set(FREETYPE_ACTUAL_LIBRARY ${FREETYPE_LIBRARY}) + set(FREETYPE2_LIBRARY_NAME freetype) endif () + find_library(FREETYPE2_LIBRARIES ${FREETYPE2_LIBRARY_NAME} HINTS ${PC_FREETYPE2_LIBDIR} ${PC_FREETYPE2_LIBRARY_DIRS} $ENV{FREETYPE_DIR}/lib) - if (FREETYPE_INCLUDE_DIR) - include_directories(AFTER ${FREETYPE_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR}/freetype2) - endif () - - if (FREETYPE_INCLUDE_DIR AND FREETYPE_ACTUAL_LIBRARY) - list(APPEND THIRD_PARTY_LIBS ${FREETYPE_ACTUAL_LIBRARY}) - add_definitions(-DHAVE_FREETYPE=1 -DHAVE_FT_FACE_GETCHARVARIANTINDEX=1) - endif () + include_directories(AFTER ${FREETYPE2_HEADER_DIR} ${FREETYPE2_ROOT_INCLUDE_DIR}) list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h) + + list(APPEND THIRD_PARTY_LIBS ${FREETYPE2_LIBRARIES}) + + mark_as_advanced(FREETYPE2_HEADER_DIR FREETYPE2_ROOT_INCLUDE_DIR FREETYPE2_LIBRARIES) endif () if (HB_HAVE_GRAPHITE2) @@ -211,6 +199,8 @@ if (HB_HAVE_GRAPHITE2) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-graphite2.h) list(APPEND THIRD_PARTY_LIBS ${GRAPHITE2_LIBRARY}) + + mark_as_advanced(GRAPHITE2_INCLUDE_DIR GRAPHITE2_LIBRARY) endif () if (HB_BUILTIN_UCDN) @@ -239,6 +229,8 @@ if (HB_HAVE_GLIB) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-glib.h) list(APPEND THIRD_PARTY_LIBS ${GLIB_LIBRARIES}) + + mark_as_advanced(GLIB_LIBRARIES GLIBCONFIG_INCLUDE_DIR GLIB_INCLUDE_DIR) endif () if (HB_HAVE_ICU) @@ -257,6 +249,8 @@ if (HB_HAVE_ICU) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-icu.h) list(APPEND THIRD_PARTY_LIBS ${ICU_LIBRARY}) + + mark_as_advanced(ICU_INCLUDE_DIR ICU_LIBRARY) endif () if (APPLE AND HB_HAVE_CORETEXT) @@ -267,10 +261,11 @@ if (APPLE AND HB_HAVE_CORETEXT) list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-coretext.h) find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices) - mark_as_advanced(APPLICATION_SERVICES_FRAMEWORK) if (APPLICATION_SERVICES_FRAMEWORK) list(APPEND THIRD_PARTY_LIBS ${APPLICATION_SERVICES_FRAMEWORK}) endif (APPLICATION_SERVICES_FRAMEWORK) + + mark_as_advanced(APPLICATION_SERVICES_FRAMEWORK) endif () if (WIN32 AND HB_HAVE_UNISCRIBE) @@ -290,8 +285,6 @@ if (WIN32 AND HB_HAVE_DIRECTWRITE) list(APPEND THIRD_PARTY_LIBS dwrite rpcrt4) endif () - -set(project_sources ${project_sources} ${project_headers}) ## ## Atomic ops availability detection @@ -326,7 +319,7 @@ if (HB_HAVE_SOLARIS_ATOMIC_OPS) endif () ## -add_library(harfbuzz ${project_sources}) +add_library(harfbuzz ${project_sources} ${project_headers}) target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS}) if (HB_BUILD_UTILS) @@ -349,6 +342,8 @@ if (HB_BUILD_UTILS) add_executable(hb-ot-shape-closure ${HB_OT_SHAPE_CLOSURE_sources}) target_link_libraries(hb-ot-shape-closure harfbuzz) + + mark_as_advanced(CAIRO_LIBRARIESNAMES) endif () ## Install commit aacca37590656e235218557ea509eb5624dfbff9 Author: Chris Peterson <cpeter...@mozilla.com> Date: Mon Apr 17 23:25:24 2017 -0700 Fix clang -Wcomma warnings (#471) (#472) clang's new -Wcomma compiler option warns about possible misuse of the comma operator such as between two statements. hb-common.cc:190:9 [-Wcomma] possible misuse of comma operator here hb-ot-layout-gsubgpos-private.hh:345:30 [-Wcomma] possible misuse of comma operator here hb-shape-plan.cc:438:26 [-Wcomma] possible misuse of comma operator here diff --git a/src/hb-common.cc b/src/hb-common.cc index 16657303..39006237 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -186,8 +186,10 @@ lang_equal (hb_language_t v1, const unsigned char *p1 = (const unsigned char *) v1; const unsigned char *p2 = (const unsigned char *) v2; - while (*p1 && *p1 == canon_map[*p2]) - p1++, p2++; + while (*p1 && *p1 == canon_map[*p2]) { + p1++; + p2++; + } return *p1 == canon_map[*p2]; } diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index f9fcec52..921859a6 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -342,7 +342,7 @@ struct hb_apply_context_t : inline void init (hb_apply_context_t *c_, bool context_match = false) { c = c_; - match_glyph_data = NULL, + match_glyph_data = NULL; matcher.set_match_func (NULL, NULL); matcher.set_lookup_props (c->lookup_props); /* Ignore ZWNJ if we are matching GSUB context, or matching GPOS. */ diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index 1ac77bef..61737669 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -431,11 +431,12 @@ static inline hb_bool_t hb_non_global_user_features_present (const hb_feature_t *user_features, unsigned int num_user_features) { - while (num_user_features) + while (num_user_features) { if (user_features->start != 0 || user_features->end != (unsigned int) -1) return true; - else - num_user_features--, user_features++; + num_user_features--; + user_features++; + } return false; } commit 4d7c52066b5b205b20ba2679cb57a4e593942102 Author: ebraminio <ebra...@gnu.org> Date: Mon Apr 17 15:53:46 2017 +0430 [cmake] Remove HB_DISABLE_DEPRECATED as it seems needed for pango build (#470) diff --git a/CMakeLists.txt b/CMakeLists.txt index a43857e8..2c03f2bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,9 +36,7 @@ include_directories(AFTER ${PROJECT_BINARY_DIR}/src ) -# feel free to discuss these or more with the maintainers add_definitions(-DHAVE_OT) -add_definitions(-DHB_DISABLE_DEPRECATED) if (BUILD_SHARED_LIBS) add_definitions(-DHAVE_ATEXIT) commit 5ecf96e3a22e896184710a9f146a8bf149af6ca4 Author: William Hua <will...@attente.ca> Date: Mon Apr 17 01:33:42 2017 -0400 Use absolute paths of ragel generated headers (#467) https://github.com/behdad/harfbuzz/issues/455 diff --git a/src/Makefile.am b/src/Makefile.am index 145033a6..0c077d99 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -253,8 +253,8 @@ built-sources: $(BUILT_SOURCES) .PHONY: unicode-tables arabic-table indic-table use-table built-sources RAGEL_GENERATED = \ - $(HB_BASE_RAGEL_GENERATED_sources) \ - $(HB_OT_RAGEL_GENERATED_sources) \ + $(patsubst %,$(srcdir)/%,$(HB_BASE_RAGEL_GENERATED_sources)) \ + $(patsubst %,$(srcdir)/%,$(HB_OT_RAGEL_GENERATED_sources)) \ $(NULL) BUILT_SOURCES += $(RAGEL_GENERATED) EXTRA_DIST += \ commit c42869eb713f53504e1b77a679cff2f88ebd0c20 Author: Dominik Schlösser <dominik.schloes...@gmail.com> Date: Sat Apr 15 21:17:05 2017 +0200 Small doc fix: `make check` runs the tests (#469) diff --git a/test/shaping/README.md b/test/shaping/README.md index a581a343..d1df6347 100644 --- a/test/shaping/README.md +++ b/test/shaping/README.md @@ -31,7 +31,7 @@ $ ./hb-unicode-encode 41 42 43 627 | ./record-test.sh ../../util/hb-shape font.t ``` If you created a new test file, add it to `Makefile.am` so it is run. -Check that `make test` does indeed run it, and that the test passes. +Check that `make check` does indeed run it, and that the test passes. When everything looks good, `git add` the new font as well as new test file if you created any. You can see what new files are there by running `git status tests fonts/sha1sum`. And commit!
_______________________________________________ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz