[HarfBuzz] harfbuzz: Branch 'master' - 7 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Mon Apr 29 10:49:56 PDT 2013
configure.ac | 6 ++--
src/hb-ot-layout-gpos-table.hh | 5 ---
src/hb-ot-map-private.hh | 32 +++++++++++-----------
src/hb-ot-map.cc | 59 +++++++++++++++++------------------------
4 files changed, 44 insertions(+), 58 deletions(-)
New commits:
commit 00b93f6610f36d8d14ca65fb99864be6d5bdb1ea
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Apr 29 13:48:49 2013 -0400
Fix icu linking by requesting the library searchpath from icu-config
This is not ideal as we don't like -L/usr/lib in our linker line.
But this is only relevant to environments that don't have pkgconfig
files for ICU...
https://github.com/behdad/harfbuzz/pull/2
diff --git a/configure.ac b/configure.ac
index b44dd75..0ab61ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,7 +177,7 @@ if test "$have_icu" != "true"; then
# necessarily want, like debugging and optimization flags
# See man (1) icu-config for more info.
ICU_CFLAGS=`$ICU_CONFIG --cppflags`
- ICU_LIBS=`$ICU_CONFIG --ldflags-libsonly`
+ ICU_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly`
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
AC_MSG_RESULT([yes])
@@ -205,7 +205,7 @@ if test "$have_icu_le" != "true"; then
# necessarily want, like debugging and optimization flags
# See man (1) icu-config for more info.
ICU_LE_CFLAGS=`$ICU_CONFIG --cppflags`
- ICU_LE_LIBS=`$ICU_CONFIG --ldflags-libsonly --ldflags-layout`
+ ICU_LE_LIBS=`$ICU_CONFIG --ldflags-searchpath --ldflags-libsonly --ldflags-layout`
AC_SUBST(ICU_LE_CFLAGS)
AC_SUBST(ICU_LE_LIBS)
AC_MSG_RESULT([yes])
commit 03adf38b22a37216dffac50d075ea9c881f1a22d
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Mon Apr 29 13:40:52 2013 -0400
Make both old autoconf and new automake happy
Sigh..
Bug 64039 - undefined macro AM_PROG_AR
diff --git a/configure.ac b/configure.ac
index 588744e..b44dd75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,7 @@ AM_INIT_AUTOMAKE([1.11.1 gnits dist-bzip2 no-dist-gzip -Wall no-define color-tes
AM_SILENT_RULES([yes])
# Initialize libtool
-AM_PROG_AR
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_PREREQ([2.2])
LT_INIT([disable-static])
commit ed79dff517bacfc87279079d5d42d079c21a0373
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Apr 21 15:39:25 2013 -0400
Minor
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index b2b5e9a..56b3a4f 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -710,8 +710,6 @@ struct PairPosFormat2
TRACE_COLLECT_GLYPHS (this);
/* (this+coverage).add_coverage (c->input); // Don't need this. */
- /* TODO only add values for pairs that have nonzero adjustments. */
-
unsigned int count1 = class1Count;
const ClassDef &klass1 = this+classDef1;
for (unsigned int i = 0; i < count1; i++)
@@ -1014,7 +1012,6 @@ struct MarkBasePosFormat1
TRACE_COLLECT_GLYPHS (this);
(this+markCoverage).add_coverage (c->input);
(this+baseCoverage).add_coverage (c->input);
- /* TODO only add combinations that have nonzero adjustment. */
}
inline const Coverage &get_coverage (void) const
@@ -1118,7 +1115,6 @@ struct MarkLigPosFormat1
TRACE_COLLECT_GLYPHS (this);
(this+markCoverage).add_coverage (c->input);
(this+ligatureCoverage).add_coverage (c->input);
- /* TODO only add combinations that have nonzero adjustment. */
}
inline const Coverage &get_coverage (void) const
@@ -1234,7 +1230,6 @@ struct MarkMarkPosFormat1
TRACE_COLLECT_GLYPHS (this);
(this+mark1Coverage).add_coverage (c->input);
(this+mark2Coverage).add_coverage (c->input);
- /* TODO only add combinations that have nonzero adjustment. */
}
inline const Coverage &get_coverage (void) const
commit 893f57b32f01da3411b5596d59170bc340e9fa39
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Apr 21 15:21:49 2013 -0400
Minor renaming
diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh
index 66e9b95..62fd605 100644
--- a/src/hb-ot-map-private.hh
+++ b/src/hb-ot-map-private.hh
@@ -68,8 +68,8 @@ struct hb_ot_map_t
typedef void (*pause_func_t) (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer);
struct stage_map_t {
- unsigned int num_lookups; /* Cumulative */
- pause_func_t callback;
+ unsigned int last_lookup; /* Cumulative */
+ pause_func_t pause_func;
};
@@ -111,8 +111,8 @@ struct hb_ot_map_t
return;
}
assert (stage <= stages[table_index].len);
- unsigned int start = stage ? stages[table_index][stage - 1].num_lookups : 0;
- unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].num_lookups : lookups[table_index].len;
+ unsigned int start = stage ? stages[table_index][stage - 1].last_lookup : 0;
+ unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].last_lookup : lookups[table_index].len;
*plookups = &lookups[table_index][start];
*lookup_count = end - start;
}
@@ -215,7 +215,7 @@ struct hb_ot_map_builder_t
struct stage_info_t {
unsigned int index;
- hb_ot_map_t::pause_func_t callback;
+ hb_ot_map_t::pause_func_t pause_func;
};
HB_INTERNAL void add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func);
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index b907fe1..39929e0 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -109,16 +109,16 @@ void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, h
for (unsigned int stage_index = 0; stage_index < stages[table_index].len; stage_index++) {
const stage_map_t *stage = &stages[table_index][stage_index];
- for (; i < stage->num_lookups; i++)
+ for (; i < stage->last_lookup; i++)
hb_ot_layout_substitute_lookup (font, buffer,
lookups[table_index][i].index,
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- if (stage->callback)
+ if (stage->pause_func)
{
buffer->clear_output ();
- stage->callback (plan, font, buffer);
+ stage->pause_func (plan, font, buffer);
}
}
}
@@ -130,13 +130,13 @@ void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_
for (unsigned int stage_index = 0; stage_index < stages[table_index].len; stage_index++) {
const stage_map_t *stage = &stages[table_index][stage_index];
- for (; i < stage->num_lookups; i++)
+ for (; i < stage->last_lookup; i++)
hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index,
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- if (stage->callback)
- stage->callback (plan, font, buffer);
+ if (stage->pause_func)
+ stage->pause_func (plan, font, buffer);
}
}
@@ -151,7 +151,7 @@ void hb_ot_map_builder_t::add_pause (unsigned int table_index, hb_ot_map_t::paus
stage_info_t *s = stages[table_index].push ();
if (likely (s)) {
s->index = current_stage[table_index];
- s->callback = pause_func;
+ s->pause_func = pause_func;
}
current_stage[table_index]++;
@@ -299,10 +299,10 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
last_num_lookups = m.lookups[table_index].len;
if (stage_index < stages[table_index].len && stages[table_index][stage_index].index == stage) {
- hb_ot_map_t::stage_map_t *pause_map = m.stages[table_index].push ();
- if (likely (pause_map)) {
- pause_map->num_lookups = last_num_lookups;
- pause_map->callback = stages[table_index][stage_index].callback;
+ hb_ot_map_t::stage_map_t *stage_map = m.stages[table_index].push ();
+ if (likely (stage_map)) {
+ stage_map->last_lookup = last_num_lookups;
+ stage_map->pause_func = stages[table_index][stage_index].pause_func;
}
stage_index++;
commit 8ac3c9c0b6b8e76bce282825b9bb706c0c78c2a6
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Apr 21 15:19:38 2013 -0400
Rename "pause" to "stage"
The compile() function is starting to become illegible...
diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh
index bcd5da4..66e9b95 100644
--- a/src/hb-ot-map-private.hh
+++ b/src/hb-ot-map-private.hh
@@ -67,7 +67,7 @@ struct hb_ot_map_t
typedef void (*pause_func_t) (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer);
- struct pause_map_t {
+ struct stage_map_t {
unsigned int num_lookups; /* Cumulative */
pause_func_t callback;
};
@@ -110,9 +110,9 @@ struct hb_ot_map_t
*lookup_count = 0;
return;
}
- assert (stage <= pauses[table_index].len);
- unsigned int start = stage ? pauses[table_index][stage - 1].num_lookups : 0;
- unsigned int end = stage < pauses[table_index].len ? pauses[table_index][stage].num_lookups : lookups[table_index].len;
+ assert (stage <= stages[table_index].len);
+ unsigned int start = stage ? stages[table_index][stage - 1].num_lookups : 0;
+ unsigned int end = stage < stages[table_index].len ? stages[table_index][stage].num_lookups : lookups[table_index].len;
*plookups = &lookups[table_index][start];
*lookup_count = end - start;
}
@@ -125,8 +125,8 @@ struct hb_ot_map_t
features.finish ();
lookups[0].finish ();
lookups[1].finish ();
- pauses[0].finish ();
- pauses[1].finish ();
+ stages[0].finish ();
+ stages[1].finish ();
}
public:
@@ -145,7 +145,7 @@ struct hb_ot_map_t
hb_prealloced_array_t<feature_map_t, 8> features;
hb_prealloced_array_t<lookup_map_t, 32> lookups[2]; /* GSUB/GPOS */
- hb_prealloced_array_t<pause_map_t, 1> pauses[2]; /* GSUB/GPOS */
+ hb_prealloced_array_t<stage_map_t, 1> stages[2]; /* GSUB/GPOS */
};
enum hb_ot_map_feature_flags_t {
@@ -195,8 +195,8 @@ struct hb_ot_map_builder_t
inline void finish (void) {
feature_infos.finish ();
- pauses[0].finish ();
- pauses[1].finish ();
+ stages[0].finish ();
+ stages[1].finish ();
}
private:
@@ -213,8 +213,8 @@ struct hb_ot_map_builder_t
{ return (a->tag != b->tag) ? (a->tag < b->tag ? -1 : 1) : (a->seq < b->seq ? -1 : 1); }
};
- struct pause_info_t {
- unsigned int stage;
+ struct stage_info_t {
+ unsigned int index;
hb_ot_map_t::pause_func_t callback;
};
@@ -233,7 +233,7 @@ struct hb_ot_map_builder_t
unsigned int current_stage[2]; /* GSUB/GPOS */
hb_prealloced_array_t<feature_info_t,16> feature_infos;
- hb_prealloced_array_t<pause_info_t, 1> pauses[2]; /* GSUB/GPOS */
+ hb_prealloced_array_t<stage_info_t, 1> stages[2]; /* GSUB/GPOS */
};
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index 5300639..b907fe1 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -107,18 +107,18 @@ void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, h
const unsigned int table_index = 0;
unsigned int i = 0;
- for (unsigned int pause_index = 0; pause_index < pauses[table_index].len; pause_index++) {
- const pause_map_t *pause = &pauses[table_index][pause_index];
- for (; i < pause->num_lookups; i++)
+ for (unsigned int stage_index = 0; stage_index < stages[table_index].len; stage_index++) {
+ const stage_map_t *stage = &stages[table_index][stage_index];
+ for (; i < stage->num_lookups; i++)
hb_ot_layout_substitute_lookup (font, buffer,
lookups[table_index][i].index,
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- if (pause->callback)
+ if (stage->callback)
{
buffer->clear_output ();
- pause->callback (plan, font, buffer);
+ stage->callback (plan, font, buffer);
}
}
}
@@ -128,15 +128,15 @@ void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_
const unsigned int table_index = 1;
unsigned int i = 0;
- for (unsigned int pause_index = 0; pause_index < pauses[table_index].len; pause_index++) {
- const pause_map_t *pause = &pauses[table_index][pause_index];
- for (; i < pause->num_lookups; i++)
+ for (unsigned int stage_index = 0; stage_index < stages[table_index].len; stage_index++) {
+ const stage_map_t *stage = &stages[table_index][stage_index];
+ for (; i < stage->num_lookups; i++)
hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index,
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- if (pause->callback)
- pause->callback (plan, font, buffer);
+ if (stage->callback)
+ stage->callback (plan, font, buffer);
}
}
@@ -148,10 +148,10 @@ void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_o
void hb_ot_map_builder_t::add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func)
{
- pause_info_t *p = pauses[table_index].push ();
- if (likely (p)) {
- p->stage = current_stage[table_index];
- p->callback = pause_func;
+ stage_info_t *s = stages[table_index].push ();
+ if (likely (s)) {
+ s->index = current_stage[table_index];
+ s->callback = pause_func;
}
current_stage[table_index]++;
@@ -268,7 +268,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
&required_feature_index))
m.add_lookups (face, table_index, required_feature_index, 1, true);
- unsigned int pause_index = 0;
+ unsigned int stage_index = 0;
unsigned int last_num_lookups = 0;
for (unsigned stage = 0; stage < current_stage[table_index]; stage++)
{
@@ -298,14 +298,14 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
last_num_lookups = m.lookups[table_index].len;
- if (pause_index < pauses[table_index].len && pauses[table_index][pause_index].stage == stage) {
- hb_ot_map_t::pause_map_t *pause_map = m.pauses[table_index].push ();
+ if (stage_index < stages[table_index].len && stages[table_index][stage_index].index == stage) {
+ hb_ot_map_t::stage_map_t *pause_map = m.stages[table_index].push ();
if (likely (pause_map)) {
pause_map->num_lookups = last_num_lookups;
- pause_map->callback = pauses[table_index][pause_index].callback;
+ pause_map->callback = stages[table_index][stage_index].callback;
}
- pause_index++;
+ stage_index++;
}
}
}
commit dd0641a432691f9b6186b081c38053858c8bc5c1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Apr 21 15:13:57 2013 -0400
Minor
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index 6228c5f..5300639 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -115,10 +115,11 @@ void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, h
lookups[table_index][i].mask,
lookups[table_index][i].auto_zwj);
- buffer->clear_output ();
-
if (pause->callback)
+ {
+ buffer->clear_output ();
pause->callback (plan, font, buffer);
+ }
}
}
commit 06a44e859328f5f1e2f6034e711b474116d22e22
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Apr 21 15:13:08 2013 -0400
Remove unneeded code
We always push a pause at the end such that each lookup falls in exactly
one pause_map_t. Now, only if I can find a better name for that...
diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh
index a679fb5..bcd5da4 100644
--- a/src/hb-ot-map-private.hh
+++ b/src/hb-ot-map-private.hh
@@ -1,6 +1,6 @@
/*
* Copyright © 2009,2010 Red Hat, Inc.
- * Copyright © 2010,2011,2012 Google, Inc.
+ * Copyright © 2010,2011,2012,2013 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index 85e6e16..6228c5f 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -1,6 +1,6 @@
/*
* Copyright © 2009,2010 Red Hat, Inc.
- * Copyright © 2010,2011 Google, Inc.
+ * Copyright © 2010,2011,2013 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
@@ -120,11 +120,6 @@ void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, h
if (pause->callback)
pause->callback (plan, font, buffer);
}
-
- for (; i < lookups[table_index].len; i++)
- hb_ot_layout_substitute_lookup (font, buffer, lookups[table_index][i].index,
- lookups[table_index][i].mask,
- lookups[table_index][i].auto_zwj);
}
void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const
@@ -142,11 +137,6 @@ void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_
if (pause->callback)
pause->callback (plan, font, buffer);
}
-
- for (; i < lookups[table_index].len; i++)
- hb_ot_layout_position_lookup (font, buffer, lookups[table_index][i].index,
- lookups[table_index][i].mask,
- lookups[table_index][i].auto_zwj);
}
void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_out) const
More information about the HarfBuzz
mailing list