diff --git a/configure.ac b/configure.ac index 9c0a22dbb..319d480b2 100644 --- a/configure.ac +++ b/configure.ac @@ -136,11 +136,11 @@ AM_CONDITIONAL(HAVE_ICU, $have_icu) dnl ========================================================================== -PKG_CHECK_MODULES(GRAPHITE, graphite2, have_graphite=true, have_graphite=false) +PKG_CHECK_MODULES(GRAPHITE2, graphite2, have_graphite=true, have_graphite=false) if $have_graphite; then - AC_DEFINE(HAVE_GRAPHITE, 1, [Have Graphite library]) + AC_DEFINE(HAVE_GRAPHITE2, 1, [Have Graphite library]) fi -AM_CONDITIONAL(HAVE_GRAPHITE, $have_graphite) +AM_CONDITIONAL(HAVE_GRAPHITE2, $have_graphite) dnl ========================================================================== diff --git a/src/Makefile.am b/src/Makefile.am index 27c69a78c..9311ab7c9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,7 +77,6 @@ HBSOURCES += \ HBHEADERS += \ hb-ot.h \ hb-ot-layout.h \ - hb-ot-shape.h \ hb-ot-tag.h \ $(NULL) endif @@ -118,17 +117,17 @@ HBSOURCES += hb-ft.cc HBHEADERS += hb-ft.h endif -if HAVE_GRAPHITE -HBCFLAGS += $(GRAPHITE_CFLAGS) -HBLIBS += $(GRAPHITE_LIBS) -HBSOURCES += hb-graphite2.cc +if HAVE_GRAPHITE2 +HBCFLAGS += $(GRAPHITE2_CFLAGS) +HBLIBS += $(GRAPHITE2_LIBS) +HBSOURCES += hb-graphite2.cc hb-graphite2-private.hh HBHEADERS += hb-graphite2.h endif if HAVE_UNISCRIBE HBCFLAGS += $(UNISCRIBE_CFLAGS) HBLIBS += $(UNISCRIBE_LIBS) -HBSOURCES += hb-uniscribe.cc +HBSOURCES += hb-uniscribe.cc hb-uniscribe-private.hh HBHEADERS += hb-uniscribe.h endif diff --git a/src/hb-fallback-shape-private.hh b/src/hb-fallback-shape-private.hh index d0beb16de..159456d2f 100644 --- a/src/hb-fallback-shape-private.hh +++ b/src/hb-fallback-shape-private.hh @@ -36,11 +36,10 @@ HB_BEGIN_DECLS HB_INTERNAL hb_bool_t -hb_fallback_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options); +_hb_fallback_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features); HB_END_DECLS diff --git a/src/hb-fallback-shape.cc b/src/hb-fallback-shape.cc index 2fd527f05..6822d2e23 100644 --- a/src/hb-fallback-shape.cc +++ b/src/hb-fallback-shape.cc @@ -29,11 +29,10 @@ #include "hb-buffer-private.hh" hb_bool_t -hb_fallback_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options) +_hb_fallback_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) { buffer->guess_properties (); diff --git a/src/hb-ot-shape.h b/src/hb-graphite2-private.hh similarity index 69% rename from src/hb-ot-shape.h rename to src/hb-graphite2-private.hh index cc18be688..644ea7565 100644 --- a/src/hb-ot-shape.h +++ b/src/hb-graphite2-private.hh @@ -1,5 +1,5 @@ /* - * Copyright © 2010 Red Hat, Inc. + * Copyright © 2012 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * @@ -21,28 +21,22 @@ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * - * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod */ -#ifndef HB_OT_H_IN -#error "Include instead." -#endif +#ifndef HB_GRAPHITE2_PRIVATE_HH +#define HB_GRAPHITE2_PRIVATE_HH -#ifndef HB_OT_SHAPE_H -#define HB_OT_SHAPE_H +#include "hb-private.hh" -HB_BEGIN_DECLS - -#include "hb.h" - -hb_bool_t -hb_ot_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options); +#include "hb-graphite2.h" -HB_END_DECLS +HB_INTERNAL hb_bool_t +_hb_graphite2_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features); -#endif /* HB_OT_SHAPE_H */ + +#endif /* HB_GRAPHITE2_PRIVATE_HH */ diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index 067575968..64f22f7e2 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -212,11 +212,10 @@ _hb_gr_font_get_data (hb_font_t *font) hb_bool_t -hb_graphite_shape (hb_font_t *font, +_hb_graphite_shape (hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options) + unsigned int num_features) { buffer->guess_properties (); diff --git a/src/hb-graphite2.h b/src/hb-graphite2.h index 3eba9e0bd..2d16cc880 100644 --- a/src/hb-graphite2.h +++ b/src/hb-graphite2.h @@ -33,13 +33,6 @@ HB_BEGIN_DECLS #define HB_GRAPHITE_TAG_Silf HB_TAG('S','i','l','f') -hb_bool_t -hb_graphite_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options); - /* TODO add gr_font/face etc getters and other glue API */ HB_END_DECLS diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index 41afd683c..2ceb6f2ff 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -29,8 +29,6 @@ #include "hb-private.hh" -#include "hb-ot-shape.h" - #include "hb-ot-map-private.hh" #include "hb-ot-shape-complex-private.hh" #include "hb-ot-shape-normalize-private.hh" @@ -96,6 +94,12 @@ hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_unicode_funcs_t *unic HB_INTERNAL void _hb_set_unicode_props (hb_buffer_t *buffer); +HB_INTERNAL hb_bool_t +_hb_ot_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features); + #include "hb-ot-shape-complex-private.hh" #endif /* HB_OT_SHAPE_PRIVATE_HH */ diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 92481ed69..4b20cb3ca 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -419,11 +419,10 @@ hb_ot_shape_execute (hb_ot_shape_plan_t *plan, } hb_bool_t -hb_ot_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options) +_hb_ot_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) { hb_ot_shape_plan_t plan; @@ -434,5 +433,3 @@ hb_ot_shape (hb_font_t *font, return TRUE; } - - diff --git a/src/hb-ot.h b/src/hb-ot.h index a825a86a2..a4cb37121 100644 --- a/src/hb-ot.h +++ b/src/hb-ot.h @@ -31,7 +31,6 @@ #include "hb.h" #include "hb-ot-layout.h" -#include "hb-ot-shape.h" #include "hb-ot-tag.h" HB_BEGIN_DECLS diff --git a/src/hb-shape.cc b/src/hb-shape.cc index 9357f8132..3d5f56c5c 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -31,30 +31,29 @@ #include "hb-buffer-private.hh" #ifdef HAVE_GRAPHITE -#include "hb-graphite2.h" +#include "hb-graphite2-private.hh" #endif #ifdef HAVE_UNISCRIBE -# include "hb-uniscribe.h" +# include "hb-uniscribe-private.hh" #endif #ifdef HAVE_OT -# include "hb-ot-shape.h" +# include "hb-ot-shape-private.hh" #endif #include "hb-fallback-shape-private.hh" typedef hb_bool_t (*hb_shape_func_t) (hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options); + unsigned int num_features); -#define HB_SHAPER_IMPLEMENT(name) {#name, hb_##name##_shape} +#define HB_SHAPER_IMPLEMENT(name) {#name, _hb_##name##_shape} static struct hb_shaper_pair_t { char name[16]; hb_shape_func_t func; } shapers[] = { /* v--- Add new shapers in the right place here */ #ifdef HAVE_GRAPHITE - HB_SHAPER_IMPLEMENT (graphite), + HB_SHAPER_IMPLEMENT (graphite2), #endif #ifdef HAVE_UNISCRIBE HB_SHAPER_IMPLEMENT (uniscribe), @@ -120,22 +119,17 @@ hb_shape_full (hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, unsigned int num_features, - const char * const *shaper_options, const char * const *shaper_list) { if (likely (!shaper_list)) { for (unsigned int i = 0; i < ARRAY_LENGTH (shapers); i++) - if (likely (shapers[i].func (font, buffer, - features, num_features, - shaper_options))) + if (likely (shapers[i].func (font, buffer, features, num_features))) return TRUE; } else { while (*shaper_list) { for (unsigned int i = 0; i < ARRAY_LENGTH (shapers); i++) if (0 == strcmp (*shaper_list, shapers[i].name)) { - if (likely (shapers[i].func (font, buffer, - features, num_features, - shaper_options))) + if (likely (shapers[i].func (font, buffer, features, num_features))) return TRUE; break; } @@ -151,5 +145,5 @@ hb_shape (hb_font_t *font, const hb_feature_t *features, unsigned int num_features) { - hb_shape_full (font, buffer, features, num_features, NULL, NULL); + hb_shape_full (font, buffer, features, num_features, NULL); } diff --git a/src/hb-shape.h b/src/hb-shape.h index 99c24abf6..1a0d6cf61 100644 --- a/src/hb-shape.h +++ b/src/hb-shape.h @@ -57,7 +57,6 @@ hb_shape_full (hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, unsigned int num_features, - const char * const *shaper_options, const char * const *shaper_list); const char ** diff --git a/src/hb-uniscribe-private.hh b/src/hb-uniscribe-private.hh new file mode 100644 index 000000000..239ab0cf7 --- /dev/null +++ b/src/hb-uniscribe-private.hh @@ -0,0 +1,42 @@ +/* + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_UNISCRIBE_PRIVATE_HH +#define HB_UNISCRIBE_PRIVATE_HH + +#include "hb-private.hh" + +#include "hb-uniscribe.h" + + +HB_INTERNAL hb_bool_t +_hb_uniscribe_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features); + + +#endif /* HB_UNISCRIBE_PRIVATE_HH */ diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index ce86074ec..41ce5e68d 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -223,11 +223,10 @@ hb_uniscribe_font_get_hfont (hb_font_t *font) hb_bool_t -hb_uniscribe_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options) +_hb_uniscribe_shape (hb_font_t *font, + hb_buffer_t *buffer, + const hb_feature_t *features, + unsigned int num_features) { buffer->guess_properties (); diff --git a/src/hb-uniscribe.h b/src/hb-uniscribe.h index 7bf809070..216610ebd 100644 --- a/src/hb-uniscribe.h +++ b/src/hb-uniscribe.h @@ -35,13 +35,6 @@ HB_BEGIN_DECLS -hb_bool_t -hb_uniscribe_shape (hb_font_t *font, - hb_buffer_t *buffer, - const hb_feature_t *features, - unsigned int num_features, - const char * const *shaper_options); - LOGFONTW * hb_uniscribe_font_get_logfontw (hb_font_t *font); diff --git a/util/options.hh b/util/options.hh index d6322cdbe..165e7a104 100644 --- a/util/options.hh +++ b/util/options.hh @@ -166,7 +166,7 @@ struct shape_options_t : option_group_t } setup_buffer (buffer); - return hb_shape_full (font, buffer, features, num_features, NULL, shapers); + return hb_shape_full (font, buffer, features, num_features, shapers); } const char *direction;