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

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Feb 6 00:39:32 UTC 2018


 src/hb-subset.h       |    7 +------
 test/api/Makefile.am  |    2 +-
 util/Makefile.am      |    3 +--
 util/Makefile.sources |    2 +-
 util/hb-subset.cc     |   11 ++++++-----
 5 files changed, 10 insertions(+), 15 deletions(-)

New commits:
commit 0ff007daaa471d05cc0473beec4ba4d434b084b1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Feb 4 20:22:07 2018 -0500

    [subset] Minor

diff --git a/src/hb-subset.h b/src/hb-subset.h
index 84c0c3c2..969cf5d2 100644
--- a/src/hb-subset.h
+++ b/src/hb-subset.h
@@ -24,15 +24,10 @@
  * Google Author(s): Rod Sheeter
  */
 
-#ifndef HB_H_IN
-#error "Include <hb.h> instead."
-#endif
-
 #ifndef HB_SUBSET_H
 #define HB_SUBSET_H
 
-#include "hb-common.h"
-#include "hb-face.h"
+#include "hb.h"
 
 HB_BEGIN_DECLS
 
commit fc1e82a5aef410138381bc8f5476dcff5679b464
Merge: ae39fc81 2ea22893
Author: Garret Rieger <grieger at google.com>
Date:   Mon Feb 5 15:35:13 2018 -0800

    Merge pull request #754 from googlefonts/master
    
    Fix build for subsetting code.

commit 2ea228935d41b55fed45b7423b69bc15b42e3abc
Author: Garret Rieger <grieger at google.com>
Date:   Mon Feb 5 15:10:01 2018 -0800

    ssize_t -> size_t

diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index 3ae0ceeb..ef70a2dc 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -62,7 +62,7 @@ struct subset_consumer_t
       fprintf(stderr, "Unable to open output file\n");
       return false;
     }
-    ssize_t bytes_written = fwrite(data, 1, data_length, fp_out);
+    size_t bytes_written = fwrite(data, 1, data_length, fp_out);
 
     if (bytes_written == -1) {
       fprintf(stderr, "Unable to write output file\n");
commit c25898eb54217e2a1c681233a6b9adcd7940652e
Author: Garret Rieger <grieger at google.com>
Date:   Mon Feb 5 14:35:32 2018 -0800

    Switch to fopen() instead of open() in subset test. open wasn't compiling on windows.

diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index 2306e66a..3ae0ceeb 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -25,9 +25,7 @@
  * Google Author(s): Garret Rieger, Rod Sheeter
  */
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#include <stdio.h>
 
 #include "main-font-text.hh"
 #include "hb-subset.h"
@@ -59,12 +57,13 @@ struct subset_consumer_t
     unsigned int data_length;
     const char* data = hb_blob_get_data (blob, &data_length);
 
-    int fd_out = open(output_file, O_CREAT | O_WRONLY, S_IRWXU);
-    if (fd_out == -1) {
-      fprintf(stderr, "Unable to open output file");
+    FILE *fp_out = fopen(output_file, "w");
+    if (fp_out == nullptr) {
+      fprintf(stderr, "Unable to open output file\n");
       return false;
     }
-    ssize_t bytes_written = write(fd_out, data, data_length);
+    ssize_t bytes_written = fwrite(data, 1, data_length, fp_out);
+
     if (bytes_written == -1) {
       fprintf(stderr, "Unable to write output file\n");
       return false;
commit fc04f11ce1999da042a39c5b271351223033292f
Author: Garret Rieger <grieger at google.com>
Date:   Mon Feb 5 11:12:33 2018 -0800

    Rename HB_SUBSET_sources -> HB_SUBSET_CLI_sources to match what cmake is looking for.

diff --git a/util/Makefile.am b/util/Makefile.am
index 3810e15e..d4ab9cdc 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -46,8 +46,7 @@ endif # HAVE_FREETYPE
 hb_shape_SOURCES = $(HB_SHAPE_sources)
 bin_PROGRAMS += hb-shape
 
-hb_subset_SOURCES = $(HB_SUBSET_sources)
-hb_subset_SOURCES = $(HB_SUBSET_sources)
+hb_subset_SOURCES = $(HB_SUBSET_CLI_sources)
 hb_subset_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
 bin_PROGRAMS += hb-subset
 
diff --git a/util/Makefile.sources b/util/Makefile.sources
index c4516ebc..6c815d26 100644
--- a/util/Makefile.sources
+++ b/util/Makefile.sources
@@ -29,7 +29,7 @@ HB_OT_SHAPE_CLOSURE_sources = \
 	main-font-text.hh \
 	$(NULL)
 
-HB_SUBSET_sources = \
+HB_SUBSET_CLI_sources = \
 	hb-subset.cc \
 	options.cc \
 	options.hh \
commit e428f7b1c21e0a7d6b9af507d98031b8eebcbeb5
Author: Garret Rieger <grieger at google.com>
Date:   Mon Feb 5 10:24:16 2018 -0800

    Wrap unistd.h include in ifdef.

diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index 21d0f767..2306e66a 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -25,7 +25,9 @@
  * Google Author(s): Garret Rieger, Rod Sheeter
  */
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 #include "main-font-text.hh"
 #include "hb-subset.h"
commit 5f6eb1256fb6c251303d3728fc27875fe7a9ffb8
Author: Garret Rieger <grieger at google.com>
Date:   Mon Feb 5 10:23:38 2018 -0800

    Add libharfbuzz-subset.la to linking when building api tests.

diff --git a/test/api/Makefile.am b/test/api/Makefile.am
index 99849fc9..d1d9b222 100644
--- a/test/api/Makefile.am
+++ b/test/api/Makefile.am
@@ -14,7 +14,7 @@ EXTRA_DIST += CMakeLists.txt
 
 if HAVE_GLIB
 AM_CPPFLAGS = -DSRCDIR="\"$(srcdir)\"" -I$(top_srcdir)/src/ -I$(top_builddir)/src/ $(GLIB_CFLAGS)
-LDADD = $(top_builddir)/src/libharfbuzz.la $(GLIB_LIBS)
+LDADD = $(top_builddir)/src/libharfbuzz.la $(top_builddir)/src/libharfbuzz-subset.la $(GLIB_LIBS)
 
 EXTRA_DIST += hb-test.h
 


More information about the HarfBuzz mailing list