[HarfBuzz] harfbuzz: Branch 'master' - 7 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Sun Dec 9 15:48:18 PST 2012
src/hb-coretext.cc | 24 ++++++++++++++----------
src/hb-coretext.h | 3 +++
src/hb-graphite2.cc | 30 ++++++++++++++++++++++++++----
src/hb-graphite2.h | 8 +++++++-
src/hb-uniscribe.cc | 33 ++++++++++++++++-----------------
5 files changed, 66 insertions(+), 32 deletions(-)
New commits:
commit 9a8395824bf51c2ff2cfe0887ecad52b3d2c02e2
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:47:36 2012 -0500
[coretext] Add hb_coretext_face_get_cg_font()
Not sure if it's useful, but it was missing.
diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index f626a2f..c0fe637 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -91,6 +91,14 @@ _hb_coretext_shaper_face_data_destroy (hb_coretext_shaper_face_data_t *data)
free (data);
}
+CGFontRef
+hb_coretext_face_get_ct_font (hb_face_t *face)
+{
+ if (unlikely (!hb_coretext_shaper_face_data_ensure (face))) return NULL;
+ hb_coretext_shaper_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
+ return face_data->cg_font;
+}
+
/*
* shaper font data
@@ -149,19 +157,19 @@ _hb_coretext_shaper_shape_plan_data_destroy (hb_coretext_shaper_shape_plan_data_
{
}
-
-/*
- * shaper
- */
-
CTFontRef
hb_coretext_font_get_ct_font (hb_font_t *font)
{
- if (unlikely (!hb_coretext_shaper_font_data_ensure (font))) return 0;
+ if (unlikely (!hb_coretext_shaper_font_data_ensure (font))) return NULL;
hb_coretext_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
return font_data->ct_font;
}
+
+/*
+ * shaper
+ */
+
hb_bool_t
_hb_coretext_shape (hb_shape_plan_t *shape_plan,
hb_font_t *font,
diff --git a/src/hb-coretext.h b/src/hb-coretext.h
index 0b34203..c4954fa 100644
--- a/src/hb-coretext.h
+++ b/src/hb-coretext.h
@@ -34,6 +34,9 @@
HB_BEGIN_DECLS
+CGFontRef
+hb_coretext_face_get_cg_font (hb_face_t *face);
+
CTFontRef
hb_coretext_font_get_ct_font (hb_font_t *font);
commit 86112356885fde32163882b6c9dd19a494304f7a
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:47:09 2012 -0500
[coretext] Remove hack around GlyphID
We not namespace our types, so the hack is not needed anymore.
diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index dfb6341..f626a2f 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -29,10 +29,6 @@
#define HB_SHAPER coretext
#include "hb-shaper-impl-private.hh"
-#define GlyphID GlyphID_mac
-#include <ApplicationServices/ApplicationServices.h>
-#undef GlyphID
-
#include "hb-coretext.h"
commit 8e58459aeb949591bb5bca340ef9bdd5cfd54e47
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:45:47 2012 -0500
[graphite2] "Update to new API"
Part of patch from Martin Hosken. I believe he knows what he's doing
:).
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
index 4e7cfdc..16ef9a4 100644
--- a/src/hb-graphite2.cc
+++ b/src/hb-graphite2.cc
@@ -325,10 +325,18 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
}
ci++;
- buffer->clear_output ();
+ //buffer->clear_output ();
for (unsigned int i = 0; i < ci; ++i)
- buffer->replace_glyphs (clusters[i].num_chars, clusters[i].num_glyphs, gids + clusters[i].base_glyph);
- buffer->swap_buffers ();
+ {
+ for (unsigned int j = 0; j < clusters[i].num_glyphs; ++j)
+ {
+ hb_glyph_info_t *info = &buffer->info[clusters[i].base_glyph + j];
+ info->codepoint = gids[clusters[i].base_glyph + j];
+ info->cluster = gr_cinfo_base(gr_seg_cinfo(seg, clusters[i].base_char));
+ }
+ }
+ buffer->len = glyph_count;
+ //buffer->swap_buffers ();
if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction))
curradvx = gr_seg_advance_X(seg);
commit a5a4ab3846ef06769784e6469d76eace35e68805
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:44:41 2012 -0500
[graphite2] Add hb_graphite2_face_get_gr_face and hb_graphite2_font_get_gr_font
Based on patch from Martin Hosken. I believe it returns NULL if the
font doesn't have graphite tables, but have not tested.
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
index a2ebbf7..4e7cfdc 100644
--- a/src/hb-graphite2.cc
+++ b/src/hb-graphite2.cc
@@ -141,6 +141,13 @@ _hb_graphite2_shaper_face_data_destroy (hb_graphite2_shaper_face_data_t *data)
free (data);
}
+gr_face *
+hb_graphite2_face_get_gr_face (hb_face_t *face)
+{
+ if (unlikely (!hb_graphite2_shaper_face_data_ensure (face))) return NULL;
+ return HB_SHAPER_DATA_GET (face)->grface;
+}
+
/*
* shaper font data
@@ -168,6 +175,13 @@ _hb_graphite2_shaper_font_data_destroy (hb_graphite2_shaper_font_data_t *data)
gr_font_destroy (data);
}
+gr_font *
+hb_graphite2_font_get_gr_font (hb_font_t *font)
+{
+ if (unlikely (!hb_graphite2_shaper_font_data_ensure (font))) return NULL;
+ return HB_SHAPER_DATA_GET (font);
+}
+
/*
* shaper shape_plan data
diff --git a/src/hb-graphite2.h b/src/hb-graphite2.h
index 8122495..bea68f9 100644
--- a/src/hb-graphite2.h
+++ b/src/hb-graphite2.h
@@ -33,7 +33,13 @@ HB_BEGIN_DECLS
#define HB_GRAPHITE2_TAG_SILF HB_TAG('S','i','l','f')
-/* TODO add gr_font/face etc getters and other glue API */
+
+gr_face *
+hb_graphite2_face_get_gr_face (hb_face_t *face);
+
+gr_font *
+hb_graphite2_font_get_gr_font (hb_font_t *font);
+
HB_END_DECLS
commit 737ba156442f723d126c7c58c73729786b67c17a
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:43:03 2012 -0500
[graphite2] Preload all tables
Part of patch from Martin Hosken.
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
index 6c890d4..a2ebbf7 100644
--- a/src/hb-graphite2.cc
+++ b/src/hb-graphite2.cc
@@ -113,7 +113,7 @@ _hb_graphite2_shaper_face_data_create (hb_face_t *face)
hb_blob_destroy (silf_blob);
data->face = face;
- data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_default);
+ data->grface = gr_make_face (data, &hb_graphite2_get_table, gr_face_preloadAll);
if (unlikely (!data->grface)) {
free (data);
commit 0ae6dbf1b4de8a0326b8a2f201597427cecfb6db
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:37:38 2012 -0500
Minor
diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc
index ba66630..2f01c28 100644
--- a/src/hb-uniscribe.cc
+++ b/src/hb-uniscribe.cc
@@ -188,6 +188,22 @@ _hb_uniscribe_shaper_font_data_destroy (hb_uniscribe_shaper_font_data_t *data)
free (data);
}
+LOGFONTW *
+hb_uniscribe_font_get_logfontw (hb_font_t *font)
+{
+ if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
+ hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
+ return &font_data->log_font;
+}
+
+HFONT
+hb_uniscribe_font_get_hfont (hb_font_t *font)
+{
+ if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
+ hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
+ return font_data->hfont;
+}
+
/*
* shaper shape_plan data
@@ -213,22 +229,6 @@ _hb_uniscribe_shaper_shape_plan_data_destroy (hb_uniscribe_shaper_shape_plan_dat
* shaper
*/
-LOGFONTW *
-hb_uniscribe_font_get_logfontw (hb_font_t *font)
-{
- if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
- hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
- return &font_data->log_font;
-}
-
-HFONT
-hb_uniscribe_font_get_hfont (hb_font_t *font)
-{
- if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
- hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
- return font_data->hfont;
-}
-
hb_bool_t
_hb_uniscribe_shape (hb_shape_plan_t *shape_plan,
commit 3fe5c159d3532f8ce8a85d217a00681225dd8ed1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Dec 9 18:20:19 2012 -0500
Remove excess return
Oops!
diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc
index 18b88b2..ba66630 100644
--- a/src/hb-uniscribe.cc
+++ b/src/hb-uniscribe.cc
@@ -217,7 +217,6 @@ LOGFONTW *
hb_uniscribe_font_get_logfontw (hb_font_t *font)
{
if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return NULL;
- return NULL;
hb_uniscribe_shaper_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
return &font_data->log_font;
}
More information about the HarfBuzz
mailing list