[HarfBuzz] harfbuzz: Branch 'master' - 5 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Jan 10 12:58:50 UTC 2018


 .circleci/config.yml                |    4 +-
 CMakeLists.txt                      |   53 +++++++++++++++++++++++-------------
 src/hb-aat-layout-common-private.hh |   24 ++++++++++++++++
 src/hb-buffer.h                     |    3 +-
 test/shaping/CMakeLists.txt         |   13 ++++++--
 util/options.cc                     |    4 ++
 6 files changed, 77 insertions(+), 24 deletions(-)

New commits:
commit ff2083c53eecc67c011b96b0b9a58331043e53cf
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jan 10 13:54:36 2018 +0100

    [util] Set stdio files to line buffering
    
    So we can stream lines to hb-shape and read output.

diff --git a/util/options.cc b/util/options.cc
index f6360725..243b49b1 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -780,6 +780,8 @@ text_options_t::get_line (unsigned int *len)
     gs = g_string_new (nullptr);
   }
 
+  setlinebuf (fp);
+
   g_string_set_size (gs, 0);
   char buf[BUFSIZ];
   while (fgets (buf, sizeof (buf), fp)) {
@@ -817,6 +819,8 @@ output_options_t::get_file_handle (void)
     fail (false, "Cannot open output file `%s': %s",
 	  g_filename_display_name (output_file), strerror (errno));
 
+  setlinebuf (fp);
+
   return fp;
 }
 
commit 80fd5743200cbe221ae3adf057fe0e5ef54a894c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jan 10 11:09:53 2018 +0100

    [aat] Add Class subtable thingy
    
    From old 'mort' table.

diff --git a/src/hb-aat-layout-common-private.hh b/src/hb-aat-layout-common-private.hh
index c3058682..4b96ee6c 100644
--- a/src/hb-aat-layout-common-private.hh
+++ b/src/hb-aat-layout-common-private.hh
@@ -424,6 +424,30 @@ struct Lookup
 };
 
 
+struct Class
+{
+  inline unsigned int get_class (hb_codepoint_t glyph_id) const
+  {
+    return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ? classArrayZ[glyph_id - firstGlyph] : 1;
+  }
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (c->check_struct (this) && classArrayZ.sanitize (c, glyphCount));
+  }
+
+  protected:
+  GlyphID	firstGlyph;	/* First glyph index included in the trimmed array. */
+  HBUINT16	glyphCount;	/* Total number of glyphs (equivalent to the last
+				 * glyph minus the value of firstGlyph plus 1). */
+  UnsizedArrayOf<HBUINT8>
+		classArrayZ;	/* The class codes (indexed by glyph index minus
+				 * firstGlyph). */
+  public:
+  DEFINE_SIZE_ARRAY (4, classArrayZ);
+};
+
 } /* namespace AAT */
 
 
commit 71e0ed9cbad8438239dcedf1bcfa8e19b9dfdc89
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Wed Jan 10 15:45:12 2018 +0330

    [cmake] Add header existence tests (#685)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index 2a82abaa..8c02624e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -138,8 +138,8 @@ workflows:
   version: 2
   build:
     jobs:
-      - oracledeveloperstudio
-      - fedora-out-of-tree
+      #- oracledeveloperstudio
+      #- fedora-out-of-tree
       - archlinux
       - freebsd9
       - base
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b61d6605..a2599b54 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,15 +89,34 @@ include_directories(AFTER
 add_definitions(-DHAVE_OT)
 add_definitions(-DHAVE_FALLBACK)
 
-include(CheckFunctionExists)
-check_function_exists(atexit HAVE_ATEXIT)
-check_function_exists(mprotect HAVE_MPROTECT)
-check_function_exists(sysconf HAVE_SYSCONF)
-check_function_exists(getpagesize HAVE_GETPAGESIZE)
-check_function_exists(mmap HAVE_MMAP)
-check_function_exists(isatty HAVE_ISATTY)
-check_function_exists(newlocale HAVE_NEWLOCALE)
-check_function_exists(strtod_l HAVE_STRTOD_L)
+
+include (CheckFunctionExists)
+include (CheckIncludeFile)
+macro (check_funcs) # Similar to AC_CHECK_FUNCS of autotools
+  foreach (func_name ${ARGN})
+    set (RESULT OFF)
+    check_function_exists(${func_name} RESULT)
+    if (${RESULT})
+      string(TOUPPER ${func_name} definiton_to_add)
+      add_definitions(-DHAVE_${definiton_to_add})
+    endif ()
+  endforeach ()
+endmacro ()
+check_funcs(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l)
+
+check_include_file(unistd.h HAVE_UNIST_H)
+if (${HAVE_UNIST_H})
+  add_definitions(-DHAVE_UNIST_H)
+endif ()
+#check_include_file(sys/mman.h HAVE_SYS_MMAN_H) enable this sometime
+#if (${HAVE_SYS_MMAN_H})
+#  add_definitions(-DHAVE_SYS_MMAN_H)
+#endif ()
+check_include_file(xlocale.h HAVE_XLOCALE_H)
+if (${HAVE_XLOCALE_H})
+  add_definitions(-DHAVE_XLOCALE_H)
+endif ()
+
 
 if (MSVC)
   add_definitions(-wd4244 -wd4267 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
@@ -237,7 +256,7 @@ set (project_headers
 
 ## Find and include needed header folders and libraries
 if (HB_HAVE_FREETYPE)
-  include(FindFreetype)
+  include (FindFreetype)
   if (NOT FREETYPE_FOUND)
     message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix")
   endif ()
@@ -249,11 +268,9 @@ if (HB_HAVE_FREETYPE)
   list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
   list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
 
-  set (CMAKE_REQUIRED_INCLUDES ${FREETYPE_INCLUDE_DIRS})
-  set (CMAKE_REQUIRED_LIBRARIES ${FREETYPE_LIBRARIES})
-  check_function_exists(FT_Get_Var_Blend_Coordinates HAVE_FT_GET_VAR_BLEND_COORDINATES)
-  check_function_exists(FT_Set_Var_Blend_Coordinates HAVE_FT_SET_VAR_BLEND_COORDINATES)
-  check_function_exists(FT_Done_MM_Var HAVE_FT_DONE_MM_VAR)
+  set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${FREETYPE_INCLUDE_DIRS})
+  set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${FREETYPE_LIBRARIES})
+  check_funcs(FT_Get_Var_Blend_Coordinates FT_Set_Var_Blend_Coordinates FT_Done_MM_Var)
 endif ()
 
 if (HB_HAVE_GRAPHITE2)
@@ -355,8 +372,8 @@ if (WIN32 AND HB_HAVE_DIRECTWRITE)
 endif ()
 
 if (HB_HAVE_GOBJECT)
-  include(FindPythonInterp)
-  include(FindPerl)
+  include (FindPythonInterp)
+  include (FindPerl)
   
   # Use the hints from glib-2.0.pc to find glib-mkenums
   find_package(PkgConfig)
@@ -675,7 +692,7 @@ endif ()
 
 
 ## Install
-include(GNUInstallDirs)
+include (GNUInstallDirs)
 
 if (NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
   install(FILES ${project_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/harfbuzz)
diff --git a/test/shaping/CMakeLists.txt b/test/shaping/CMakeLists.txt
index bf4aaa5a..b79d5328 100644
--- a/test/shaping/CMakeLists.txt
+++ b/test/shaping/CMakeLists.txt
@@ -2,7 +2,6 @@ if (HB_BUILD_UTILS)
   file (READ "${CMAKE_CURRENT_SOURCE_DIR}/data/in-house/Makefile.am" INHOUSE)
   extract_make_variable (TESTS ${INHOUSE})
   foreach (test IN ITEMS ${TESTS})
-    message(${CMAKE_CURRENT_SOURCE_DIR}/data/in-house)
     add_test (NAME ${test}
       COMMAND python run-tests.py $<TARGET_FILE:hb-shape> "data/in-house/${test}"
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
commit a073621b5dc2865a014821307128a8fdd1d7d992
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Wed Jan 10 12:13:28 2018 +0330

    [cmake] Fix tests against latest changes (#690)

diff --git a/test/shaping/CMakeLists.txt b/test/shaping/CMakeLists.txt
index e186858b..bf4aaa5a 100644
--- a/test/shaping/CMakeLists.txt
+++ b/test/shaping/CMakeLists.txt
@@ -1,10 +1,18 @@
 if (HB_BUILD_UTILS)
-  file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
-  extract_make_variable (TESTS ${MAKEFILEAM})
+  file (READ "${CMAKE_CURRENT_SOURCE_DIR}/data/in-house/Makefile.am" INHOUSE)
+  extract_make_variable (TESTS ${INHOUSE})
+  foreach (test IN ITEMS ${TESTS})
+    message(${CMAKE_CURRENT_SOURCE_DIR}/data/in-house)
+    add_test (NAME ${test}
+      COMMAND python run-tests.py $<TARGET_FILE:hb-shape> "data/in-house/${test}"
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+  endforeach ()
 
+  file (READ "${CMAKE_CURRENT_SOURCE_DIR}/data/text-rendering-tests/Makefile.am" TEXTRENDERING)
+  extract_make_variable (TESTS ${TEXTRENDERING})
   foreach (test IN ITEMS ${TESTS})
     add_test (NAME ${test}
-      COMMAND python run-tests.py $<TARGET_FILE:hb-shape> "${test}"
+      COMMAND python run-tests.py $<TARGET_FILE:hb-shape> "data/text-rendering-tests/${test}"
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   endforeach ()
 endif ()
commit 0b22da954142ad7a1e949a56448cee4e836fff75
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Wed Jan 10 07:12:07 2018 +0200

    Improve HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES docs
    
    Add the note about absolute glyph positions from the commit message.

diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index 655a22ee..bcc29930 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -422,7 +422,8 @@ hb_buffer_normalize_glyphs (hb_buffer_t *buffer);
  * @HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES: do no serialize glyph name.
  * @HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS: serialize glyph extents.
  * @HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS: serialize glyph flags. Since: 1.5.0
- * @HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES: do not serialize glyph advances. Since: 1.8.0
+ * @HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES: do not serialize glyph advances,
+ *  glyph offsets will reflect absolute glyph positions. Since: 1.8.0
  *
  * Flags that control what glyph information are serialized in hb_buffer_serialize_glyphs().
  *


More information about the HarfBuzz mailing list