Merge with master
authorEbrahim Byagowi <ebrahim@gnu.org>
Tue, 27 Feb 2018 16:45:54 +0000 (20:15 +0330)
committerEbrahim Byagowi <ebrahim@gnu.org>
Tue, 27 Feb 2018 16:47:25 +0000 (20:17 +0330)
1  2 
NEWS
src/Makefile.am
src/Makefile.sources
src/hb-ot-layout-private.hh
src/hb-ot-layout.cc
src/hb-ot.h
test/api/Makefile.am
test/api/hb-test.h

diff --cc NEWS
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
- Overview of changes leading to 1.2.8
- Not yet released
++=======
+ Overview of changes leading to 1.7.5
+ Tuesday, January 30, 2018
  ====================================
- - Implemented 'CPAL' table in hb-ot-color.
+ - Separate Khmer shaper from Indic.
+ - First stab at AAT morx. Not hooked up.
+ - Misc bug fixes.
+ Overview of changes leading to 1.7.4
+ Wednesday, December 20, 2017
+ ====================================
+ - Fix collect_glyphs() regression caused by hb_set_t changes.
+ Overview of changes leading to 1.7.3
+ Monday, December 18, 2017
+ ====================================
+ - hb_set_t performance tuning and optimizations.
+ - Speed up collect_glyphs() and reject garbage data.
+ - In hb_coretext_font_create() set font point-size (ptem).
+ - Misc fixes.
+ Overview of changes leading to 1.7.2
+ Monday, December 4, 2017
+ ====================================
+ - Optimize hb_set_add_range().
+ - Misc fixes.
+ - New API:
+ hb_coretext_font_create()
+ Overview of changes leading to 1.7.1
+ Tuesday, November 14, 2017
+ ====================================
+ - Fix atexit object destruction regression.
+ - Fix minor integer-overflow.
+ Overview of changes leading to 1.7.0
+ Monday, November 13, 2017
+ ====================================
+ - Minor Indic fixes.
+ - Implement kerning and glyph names in hb-ot-font.
+ - Various DSO optimization re .data and .bss sizes.
+ - Make C++11 optional; build fixes.
+ - Mark all other backends "unsafe-to-break".
+ - Graphite fix.
+ Overview of changes leading to 1.6.3
+ Thursday, October 26th, 2017
+ ====================================
+ - Fix hb_set_t some more.  Should be solid now.
+ - Implement get_glyph_name() for hb-ot-font.
+ - Misc fixes.
+ Overview of changes leading to 1.6.2
+ Monday, October 23nd, 2017
+ ====================================
+ - Yesterday's release had a bad crasher; don't use it.  That's what
+   happens when one works on Sunday...
+   https://github.com/harfbuzz/harfbuzz/issues/578
+ - Build fixes for FreeBSD and Chrome Android.
+ Overview of changes leading to 1.6.1
+ Sunday, October 22nd, 2017
+ ====================================
+ - Don't skip over COMBINING GRAPHEME JOINER when ligating, etc.
+   To be refined: https://github.com/harfbuzz/harfbuzz/issues/554
+ - Faster hb_set_t implementation.
+ - Don't use deprecated ICU API.
+ - Fix undefined-behavior in Myanmar shaper, introduced in 1.6.0
+ - Deprecated API:
+   hb_set_invert()
+ Overview of changes leading to 1.6.0
+ Friday, October the 13th, 2017
+ ====================================
+ - Update to Unicode 10.
+ - Various Indic and Universal Shaping Engine fixes as a result of
+   HarfBuzz Hackfest with Jonathan Kew at Web Engines Hackfest at
+   the Igalia offices in A Coruña, Spain.  Thanks Igalia for having
+   us!
+ - Implement Unicode Arabic Mark Ordering Algorithm UTR#53.
+ - Implement optical sizing / tracking in CoreText backend, using
+   new API hb_font_set_ptem().
+ - Allow notifying hb_font_t that underlying FT_Face changed sizing,
+   using new API hb_ft_font_changed().
+ - More Graphite backend RTL fixes.
+ - Fix caching of variable font shaping plans.
+ - hb-view / hb-shape now accept following new arguments:
+   o --unicodes: takes a list of hex numbers that represent Unicode
+     codepoints.
+ New API:
+ +hb_face_get_table_tags()
+ +hb_font_set_ptem()
+ +hb_font_get_ptem()
+ +hb_ft_font_changed()
+ Overview of changes leading to 1.5.1
+ Tuesday, September 5, 2017
+ ====================================
+ - Fix "unsafe-to-break" in fallback shaping and other corner cases.
+   All our tests pass with --verify now, meaning unsafe-to-break API
+   works as expected.
+ - Add --unicodes to hb-view / hb-shape.
+ - [indic] Treat Consonant_With_Stacker as consonant.  This will need
+   further tweaking.
+ - hb_buffer_diff() tweaks.
+ Overview of changes leading to 1.5.0
+ Wednesday, August 23, 2017
+ ====================================
+ - Misc new API, for appending a buffer to another, and for comparing
+   contents of two buffers for types of differences.
+ - New "unsafe-to-break" API.  Can be used to speed up reshaping
+   in line-breaking situations.  Essentially, after shaping, it returns
+   positions in the input string (some of the cluster boundaries) that
+   are "safe to break" in that if the text is segmented at that position
+   and two sides reshaped and concatenated, the shaping result is
+   exactly the same as shaping the text in one piece.
+   hb-view and hb-shape and hb-shape now take --verify, which verifies
+   the above property.
+   Some corner cases of the implementation are still not quite working.
+   Those will be fixed in subsequent releases.
+ - New API:
+ hb_buffer_append()
+ hb_glyph_flags_t
+ HB_GLYPH_FLAG_UNSAFE_TO_BREAK
+ HB_GLYPH_FLAG_DEFINED
+ hb_glyph_info_get_glyph_flags()
+ HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS
+ hb_buffer_diff_flags_t
+ HB_BUFFER_DIFF_FLAG_EQUAL
+ HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH
+ HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH
+ HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT
+ HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT
+ HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH
+ HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH
+ HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH
+ HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH
+ hb_buffer_diff
+ Overview of changes leading to 1.4.8
+ Tuesday, August 8, 2017
+ ====================================
+ - Major fix to avar table handling.
+ - Rename hb-shape --show-message to --trace.
+ - Build fixes.
+ Overview of changes leading to 1.4.7
+ Tuesday, July 18, 2017
+ ====================================
+ - Multiple Indic, Tibetan, and Cham fixes.
+ - CoreText: Allow disabling kerning.
+ - Adjust Arabic feature order again.
+ - Misc build fixes.
+ Overview of changes leading to 1.4.6
+ Sunday, April 23, 2017
+ ====================================
+ - Graphite2: Fix RTL positioning issue.
+ - Backlist GDEF of more versions of Padauk and Tahoma.
+ - New, experimental, cmake alternative build system.
+ Overview of changes leading to 1.4.5
+ Friday, March 10, 2017
+ ====================================
+ - Revert "Fix Context lookup application when moving back after a glyph..."
+   This introduced memory access problems.  To be fixed properly soon.
+ Overview of changes leading to 1.4.4
+ Sunday, March 5, 2017
+ ====================================
+ - Fix Context lookup application when moving back after a glyph deletion.
+ - Fix buffer-overrun in Bengali.
+ Overview of changes leading to 1.4.3
+ Saturday, February 25, 2017
+ ====================================
+ - Route Adlam script to Arabic shaper.
+ - Misc fixes.
+ - New API:
+   hb_font_set_face()
+ - Deprecate API:
+   hb_graphite2_font_get_gr_font()
+ Overview of changes leading to 1.4.2
+ Monday, January 23, 2017
+ ====================================
+ - Implement OpenType Font Variation tables avar/fvar/HVAR/VVAR.
+ - hb-shape and hb-view now accept --variations.
+ - New API:
+ hb_variation_t
+ hb_variation_from_string()
+ hb_variation_to_string()
+ hb_font_set_variations()
+ hb_font_set_var_coords_design()
+ hb_font_get_var_coords_normalized()
+ hb-ot-var.h:
+ hb_ot_var_axis_t
+ hb_ot_var_has_data()
+ hb_ot_var_get_axis_count()
+ hb_ot_var_get_axes()
+ hb_ot_var_find_axis()
+ hb_ot_var_normalize_variations()
+ hb_ot_var_normalize_coords()
+ - MVAR to be implemented later.  Access to named instances to be
+   implemented later as well.
+ - Misc fixes.
+ Overview of changes leading to 1.4.1
+ Thursday, January 5, 2017
+ ====================================
+ - Always build and use UCDN for Unicode data by default.
+   Reduces dependence on version of Unicode data in glib,
+   specially in the Windows bundles we are shipping, which
+   have very old glib.
+ Overview of changes leading to 1.4.0
+ Thursday, January 5, 2017
+ ====================================
+ - Merged "OpenType GX" branch which adds core of support for
+   OpenType 1.8 Font Variations.  To that extent, the relevant
+   new API is:
+ New API:
+ hb_font_set_var_coords_normalized()
+   with supporting API:
+ New API:
+ HB_OT_LAYOUT_NO_VARIATIONS_INDEX
+ hb_ot_layout_table_find_feature_variations()
+ hb_ot_layout_feature_with_variations_get_lookups()
+ hb_shape_plan_create2()
+ hb_shape_plan_create_cached2()
+   Currently variations in GSUB/GPOS/GDEF are fully supported,
+   and no other tables are supported.  In particular, fvar/avar
+   are NOT supported, hence the hb_font_set_var_coords_normalized()
+   taking normalized coordinates.  API to take design coordinates
+   will be added in the future.
+   HVAR/VVAR/MVAR support will also be added to hb-ot-font in the
+   future.
+ - Fix regression in GDEF glyph class processing.
+ - Add decompositions for Chakma, Limbu, and Balinese in USE shaper.
+ - Misc fixes.
+ Overview of changes leading to 1.3.4
+ Monday, December 5, 2016
+ ====================================
+ - Fix vertical glyph origin in hb-ot-font.
+ - Implement CBDT/CBLC color font glyph extents in hb-ot-font.
+ Overview of changes leading to 1.3.3
+ Wednesday, September 28, 2016
+ ====================================
+ - Implement parsing of OpenType MATH table.
+ New API:
+ HB_OT_TAG_MATH
+ HB_OT_MATH_SCRIPT
+ hb_ot_math_constant_t
+ hb_ot_math_kern_t
+ hb_ot_math_glyph_variant_t
+ hb_ot_math_glyph_part_flags_t
+ hb_ot_math_glyph_part_t
+ hb_ot_math_has_data
+ hb_ot_math_get_constant
+ hb_ot_math_get_glyph_italics_correction
+ hb_ot_math_get_glyph_top_accent_attachment
+ hb_ot_math_get_glyph_kerning
+ hb_ot_math_is_glyph_extended_shape
+ hb_ot_math_get_glyph_variants
+ hb_ot_math_get_min_connector_overlap
+ hb_ot_math_get_glyph_assembly
+ Overview of changes leading to 1.3.2
+ Wednesday, September 27, 2016
+ ====================================
+ - Fix build of hb-coretext on older OS X versions.
+ Overview of changes leading to 1.3.1
+ Wednesday, September 7, 2016
+ ====================================
+ - Blacklist bad GDEF of more fonts (Padauk).
+ - More CoreText backend crash fixes with OS X 10.9.5.
+ - Misc fixes.
+ Overview of changes leading to 1.3.0
+ Thursday, July 21, 2016
+ ====================================
+ - Update to Unicode 9.0.0
+ - Move Javanese from Indic shaper to Universal Shaping Engine.
+ - Allow MultipleSubst to delete a glyph (matching Windows engine).
+ - Update Universal Shaping Engine to latest draft from Microsoft.
+ - DirectWrite backend improvements.  Note: this backend is for testing ONLY.
+ - CoreText backend improvements with unreachable fonts.
+ - Implement symbol fonts (cmap 3.0.0) in hb-ft and hb-ot-font.
+ - Blacklist bad GDEF of more fonts (Tahoma & others).
+ - Misc fixes.
  
 -
  Overview of changes leading to 1.2.7
  Monday, May 2, 2016
  ====================================
diff --cc src/Makefile.am
@@@ -307,14 -354,36 +354,37 @@@ dist_check_SCRIPTS = 
        check-static-inits.sh \
        check-symbols.sh \
        $(NULL)
+ TESTS += $(dist_check_SCRIPTS)
+ if !WITH_LIBSTDCXX
+ dist_check_SCRIPTS += \
+       check-libstdc++.sh \
+       $(NULL)
+ endif
  
- check_PROGRAMS = \
-       test-ot-tag \
+ check_PROGRAMS += \
+       dump-indic-data \
+       dump-khmer-data \
+       dump-myanmar-data \
+       dump-use-data \
        $(NULL)
- test_ot_color_SOURCES = hb-ot-color.cc
- test_ot_color_CPPFLAGS = $(HBCFLAGS) -DMAIN
- test_ot_color_LDADD = libharfbuzz.la $(HBLIBS)
++
+ dump_indic_data_SOURCES = dump-indic-data.cc hb-ot-shape-complex-indic-table.cc
+ dump_indic_data_CPPFLAGS = $(HBCFLAGS)
+ dump_indic_data_LDADD = libharfbuzz.la $(HBLIBS)
+ dump_khmer_data_SOURCES = dump-khmer-data.cc hb-ot-shape-complex-indic-table.cc
+ dump_khmer_data_CPPFLAGS = $(HBCFLAGS)
+ dump_khmer_data_LDADD = libharfbuzz.la $(HBLIBS)
+ dump_myanmar_data_SOURCES = dump-myanmar-data.cc hb-ot-shape-complex-indic-table.cc
+ dump_myanmar_data_CPPFLAGS = $(HBCFLAGS)
+ dump_myanmar_data_LDADD = libharfbuzz.la $(HBLIBS)
+ dump_use_data_SOURCES = dump-use-data.cc hb-ot-shape-complex-use-table.cc
+ dump_use_data_CPPFLAGS = $(HBCFLAGS)
+ dump_use_data_LDADD = libharfbuzz.la $(HBLIBS)
+ check_PROGRAMS += test-ot-tag test-unicode-ranges
+ TESTS += test-ot-tag test-unicode-ranges
  test_ot_tag_SOURCES = hb-ot-tag.cc
  test_ot_tag_CPPFLAGS = $(HBCFLAGS) -DMAIN
  test_ot_tag_LDADD = libharfbuzz.la $(HBLIBS)
@@@ -78,8 -96,10 +96,12 @@@ HB_OT_sources = 
        hb-ot-layout-gsub-table.hh \
        hb-ot-layout-jstf-table.hh \
        hb-ot-layout-private.hh \
++      hb-ot-color.cc \
++      hb-ot-cpal-table.hh \
        hb-ot-map.cc \
        hb-ot-map-private.hh \
+       hb-ot-math.cc \
+       hb-ot-math-table.hh \
        hb-ot-shape.cc \
        hb-ot-shape-complex-arabic.cc \
        hb-ot-shape-complex-arabic-fallback.hh \
@@@ -111,11 -149,13 +151,14 @@@ HB_OT_RAGEL_sources = 
  
  HB_OT_headers = \
        hb-ot.h \
 +      hb-ot-color.h \
        hb-ot-font.h \
        hb-ot-layout.h \
+       hb-ot-math.h \
+       hb-ot-base.h \
        hb-ot-shape.h \
        hb-ot-tag.h \
+       hb-ot-var.h \
        $(NULL)
  
  # Optional Sources and Headers with external deps
@@@ -124,7 -126,16 +126,17 @@@ namespace OT 
    struct GDEF;
    struct GSUB;
    struct GPOS;
 +  struct CPAL;
+   struct MATH;
+   struct fvar;
+   struct avar;
+ }
+ namespace AAT {
+   struct ankr;
+   struct kerx;
+   struct morx;
+   struct trak;
  }
  
  struct hb_ot_layout_lookup_accelerator_t
@@@ -158,8 -168,17 +170,18 @@@ struct hb_ot_layout_
    const struct OT::GDEF *gdef;
    const struct OT::GSUB *gsub;
    const struct OT::GPOS *gpos;
 +  const struct OT::CPAL *cpal;
  
+   /* TODO Move the following out of this struct. */
+   OT::hb_lazy_table_loader_t<struct OT::BASE> base;
+   OT::hb_lazy_table_loader_t<struct OT::MATH> math;
+   OT::hb_lazy_table_loader_t<struct OT::fvar> fvar;
+   OT::hb_lazy_table_loader_t<struct OT::avar> avar;
+   OT::hb_lazy_table_loader_t<struct AAT::ankr> ankr;
+   OT::hb_lazy_table_loader_t<struct AAT::kerx> kerx;
+   OT::hb_lazy_table_loader_t<struct AAT::morx> morx;
+   OT::hb_lazy_table_loader_t<struct AAT::trak> trak;
    unsigned int gsub_lookup_count;
    unsigned int gpos_lookup_count;
  
  
  #include "hb-open-type-private.hh"
  #include "hb-ot-layout-private.hh"
--
- #include "hb-ot-cpal-table.hh"
+ #include "hb-ot-layout-base-table.hh"
  #include "hb-ot-layout-gdef-table.hh"
  #include "hb-ot-layout-gsub-table.hh"
  #include "hb-ot-layout-gpos-table.hh"
- #include "hb-ot-layout-jstf-table.hh"
+ #include "hb-ot-layout-jstf-table.hh" // Just so we compile it; unused otherwise.
+ #include "hb-ot-name-table.hh" // Just so we compile it; unused otherwise.
++#include "hb-ot-cpal-table.hh"
  
  #include "hb-ot-map-private.hh"
  
@@@ -50,20 -51,25 +51,26 @@@ _hb_ot_layout_create (hb_face_t *face
  {
    hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
    if (unlikely (!layout))
-     return NULL;
+     return nullptr;
  
-   layout->gdef_blob = OT::Sanitizer<OT::GDEF>::sanitize (face->reference_table (HB_OT_TAG_GDEF));
+   layout->gdef_blob = OT::Sanitizer<OT::GDEF>().sanitize (face->reference_table (HB_OT_TAG_GDEF));
    layout->gdef = OT::Sanitizer<OT::GDEF>::lock_instance (layout->gdef_blob);
  
-   layout->gsub_blob = OT::Sanitizer<OT::GSUB>::sanitize (face->reference_table (HB_OT_TAG_GSUB));
+   layout->gsub_blob = OT::Sanitizer<OT::GSUB>().sanitize (face->reference_table (HB_OT_TAG_GSUB));
    layout->gsub = OT::Sanitizer<OT::GSUB>::lock_instance (layout->gsub_blob);
  
-   layout->gpos_blob = OT::Sanitizer<OT::GPOS>::sanitize (face->reference_table (HB_OT_TAG_GPOS));
+   layout->gpos_blob = OT::Sanitizer<OT::GPOS>().sanitize (face->reference_table (HB_OT_TAG_GPOS));
    layout->gpos = OT::Sanitizer<OT::GPOS>::lock_instance (layout->gpos_blob);
  
-   // The CPAL table is rarely accessed, so we only try to load it in _get_cpal.
-   layout->cpal_blob = NULL;
-   layout->cpal = NULL;
+   layout->math.init (face);
+   layout->base.init (face);
+   layout->fvar.init (face);
+   layout->avar.init (face);
+   layout->ankr.init (face);
+   layout->kerx.init (face);
+   layout->morx.init (face);
+   layout->trak.init (face);
++  layout->cpal.init (face);
  
    {
      /*
@@@ -136,7 -216,14 +217,15 @@@ _hb_ot_layout_destroy (hb_ot_layout_t *
    hb_blob_destroy (layout->gsub_blob);
    hb_blob_destroy (layout->gpos_blob);
  
-   if (layout->cpal_blob) hb_blob_destroy (layout->cpal_blob);
+   layout->math.fini ();
+   layout->base.fini ();
+   layout->fvar.fini ();
+   layout->avar.fini ();
+   layout->ankr.fini ();
+   layout->kerx.fini ();
+   layout->morx.fini ();
+   layout->trak.fini ();
++  layout->cpal.fini ();
  
    free (layout);
  }
diff --cc src/hb-ot.h
  
  #include "hb.h"
  
 +#include "hb-ot-color.h"
  #include "hb-ot-font.h"
  #include "hb-ot-layout.h"
+ #include "hb-ot-math.h"
+ #include "hb-ot-base.h"
  #include "hb-ot-tag.h"
  #include "hb-ot-shape.h"
+ #include "hb-ot-var.h"
  
  HB_BEGIN_DECLS
  
@@@ -43,11 -59,20 +59,21 @@@ endi
  
  
  if HAVE_OT
  TEST_PROGS += \
 +      test-ot-color \
        test-ot-tag \
        $(NULL)
- endif
+ if HAVE_FREETYPE
+ TEST_PROGS += \
+       test-ot-math \
+       $(NULL)
+ test_ot_math_LDADD = $(LDADD) $(FREETYPE_LIBS)
+ test_ot_math_CPPFLAGS = $(AM_CPPFLAGS) $(FREETYPE_CFLAGS)
+ endif # HAVE_FREETYPE
+ endif # HAVE_OT
  
  # Tests for header compilation
  TEST_PROGS += \
Simple merge