bug 780409 - updates to thebes harfbuzz integration for hb api changes. r=jdaggett
authorJonathan Kew <jkew@mozilla.com>
Mon, 06 Aug 2012 11:42:20 +0100
changeset 101545 f24229bc0ec81d97f9248789a1df23251c81e404
parent 101544 e62bc7eb40318d729f69a3e47a6fb5d2227a66a7
child 101546 cdc84c93ffe3d88d0fc5880b3db181c500b26db0
child 101548 5f17d8754132b50fb7b286675faa1abae1d21f67
push id23239
push useremorley@mozilla.com
push dateMon, 06 Aug 2012 14:40:43 +0000
treeherdermozilla-central@f24229bc0ec8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs780409
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 780409 - updates to thebes harfbuzz integration for hb api changes. r=jdaggett
gfx/harfbuzz/README-mozilla
gfx/thebes/gfxFont.h
gfx/thebes/gfxHarfBuzzShaper.cpp
new file mode 100644
--- /dev/null
+++ b/gfx/harfbuzz/README-mozilla
@@ -0,0 +1,23 @@
+gfx/harfbuzz status as of 2012-08-06:
+
+This directory contains the "harfbuzz-ng" source from the 'master' branch of
+git://anongit.freedesktop.org/git/harfbuzz.
+
+UPDATING:
+
+Note that hb-ot-shape-complex-indic-machine.hh and gfx/harfbuzz/src/hb-version.h
+are not present in the upstream Git repository. These are created at build time
+by the harfbuzz build system; but as we don't use that build system in mozilla,
+it is necessary to refresh these files when updating harfbuzz, and check them in
+to the mozilla tree. (This avoids adding the ragel processor to mozilla's build
+prerequisites.)
+
+The normal approach to updating harfbuzz, therefore, is to pull the latest HB
+source into a scratch directory and do a local build; then copy the original
+sources AND the generated headers mentioned above from the build directory into
+the mozilla tree.
+
+In addition, the src/Makefile.in file here is NOT from upstream, nor is it
+generated from src/Makefile.am (the original harfbuzz version); it is a mozilla-
+specific makefile that is maintained by hand. It should only need updating when
+new source files or exported headers are added in harfbuzz.
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -41,17 +41,17 @@ class gfxFont;
 class gfxFontFamily;
 class gfxFontGroup;
 class gfxUserFontSet;
 class gfxUserFontData;
 class gfxShapedWord;
 
 class nsILanguageAtomService;
 
-typedef struct _hb_blob_t hb_blob_t;
+typedef struct hb_blob_t hb_blob_t;
 
 #define FONT_MAX_SIZE                  2000.0
 
 #define NO_FONT_LANGUAGE_OVERRIDE      0
 
 struct FontListSizes;
 
 struct THEBES_API gfxFontStyle {
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -640,42 +640,45 @@ HBGetHKerning(hb_font_t *font, void *fon
     return fcd->mShaper->GetHKerning(first_glyph, second_glyph);
 }
 
 /*
  * HarfBuzz unicode property callbacks
  */
 
 static hb_codepoint_t
-HBGetMirroring(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data)
+HBGetMirroring(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh,
+               void *user_data)
 {
     return GetMirroredChar(aCh);
 }
 
 static hb_unicode_general_category_t
-HBGetGeneralCategory(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data)
+HBGetGeneralCategory(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh,
+                     void *user_data)
 {
     return hb_unicode_general_category_t(GetGeneralCategory(aCh));
 }
 
 static hb_script_t
 HBGetScript(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data)
 {
-    return hb_script_t(GetScriptTagForCode
-        (GetScriptCode(aCh)));
+    return hb_script_t(GetScriptTagForCode(GetScriptCode(aCh)));
+}
+
+static hb_unicode_combining_class_t
+HBGetCombiningClass(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh,
+                    void *user_data)
+{
+    return hb_unicode_combining_class_t(GetCombiningClass(aCh));
 }
 
 static unsigned int
-HBGetCombiningClass(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data)
-{
-    return GetCombiningClass(aCh);
-}
-
-static unsigned int
-HBGetEastAsianWidth(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh, void *user_data)
+HBGetEastAsianWidth(hb_unicode_funcs_t *ufuncs, hb_codepoint_t aCh,
+                    void *user_data)
 {
     return GetEastAsianWidth(aCh);
 }
 
 // Hebrew presentation forms with dagesh, for characters 0x05D0..0x05EA;
 // note that some letters do not have a dagesh presForm encoded
 static const PRUnichar sDageshForms[0x05EA - 0x05D0 + 1] = {
     0xFB30, // ALEF