]> git.armaanb.net Git - asd-repo.git/commitdiff
fribidi: drop package
authorArmaan Bhojwani <me@armaanb.net>
Mon, 12 Jul 2021 14:57:37 +0000 (10:57 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 12 Jul 2021 22:58:51 +0000 (18:58 -0400)
22 files changed:
extra/fribidi/build [deleted file]
extra/fribidi/checksums [deleted file]
extra/fribidi/sources [deleted file]
extra/fribidi/version [deleted file]
extra/gtk+3/build
extra/gtk+3/checksums
extra/gtk+3/depends
extra/gtk+3/patches/no-fribidi.patch [new file with mode: 0644]
extra/gtk+3/sources
extra/gtk+3/version
extra/libass/build
extra/libass/checksums
extra/libass/depends
extra/libass/patches/no-fribidi.patch [new file with mode: 0644]
extra/libass/sources
extra/libass/version
extra/pango/build
extra/pango/checksums
extra/pango/depends
extra/pango/patches/no-fribidi.patch [new file with mode: 0644]
extra/pango/sources
extra/pango/version

diff --git a/extra/fribidi/build b/extra/fribidi/build
deleted file mode 100755 (executable)
index cdabf58..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh -e
-
-./configure \
-    --prefix=/usr \
-    --enable-static
-
-make
-make DESTDIR="$1" install
diff --git a/extra/fribidi/checksums b/extra/fribidi/checksums
deleted file mode 100644 (file)
index 2a5dfc8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-7f1c687c7831499bcacae5e8675945a39bacbad16ecaa945e9454a32df653c01  fribidi-1.0.10.tar.xz
diff --git a/extra/fribidi/sources b/extra/fribidi/sources
deleted file mode 100644 (file)
index 0ddde5e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-https://github.com/fribidi/fribidi/releases/download/v1.0.10/fribidi-1.0.10.tar.xz
diff --git a/extra/fribidi/version b/extra/fribidi/version
deleted file mode 100644 (file)
index 2d248d7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1.0.10 1
index 8317fc8d645f84007f016179ff35859686578367..9ae968dc3f1e99a5f2302aec3df91dca3fb54046 100755 (executable)
@@ -1,7 +1,9 @@
 #!/bin/sh -e
 
 # Remove 'atk-bridge' dependency which removes the 'dbus' dependency.
-sed -i 's/ATK_PACKAGES="atk atk-bridge-2.0"/ATK_PACKAGES="atk"/' \
+sed -i \
+    -e 's/ATK_PACKAGES="atk atk-bridge-2.0"/ATK_PACKAGES="atk"/g' \
+    -e 's/fribidi >= 0\.19\.7//g' \
     configure
 
 sed -i '/<atk-bridge.h>/d;/atk_bridge_adaptor_init/d' \
@@ -11,6 +13,8 @@ sed -i '/<atk-bridge.h>/d;/atk_bridge_adaptor_init/d' \
 sed -i 's/demos tests testsuite examples//' Makefile.am Makefile.in
 sed -i 's/docs m4macros/m4macros/'          Makefile.am Makefile.in
 
+patch -p1 < no-fribidi.patch
+
 ./configure \
     --prefix=/usr \
     --sysconfdir=/etc \
index 8e8e9efb228664085dbb24486038683b1fc67128..1fe5fefd151389233ca519583794c89ba981fa3a 100644 (file)
@@ -1 +1,2 @@
 f57ec4ade8f15cab0c23a80dcaee85b876e70a8823d9105f067ce335a8268caa
+b47bef2cdc90f878119ed4e91de6aa8bd1b08521d1eb8f8b077cadb579045ee1
index 561ac12fc479327a6818f4168fd15441d832f157..49c8f7d04242f232e2aaf5f539c8d69c1059c502 100644 (file)
@@ -1,5 +1,4 @@
 atk
-fribidi
 gdk-pixbuf
 libXcomposite
 libXcursor
diff --git a/extra/gtk+3/patches/no-fribidi.patch b/extra/gtk+3/patches/no-fribidi.patch
new file mode 100644 (file)
index 0000000..fd398ca
--- /dev/null
@@ -0,0 +1,60 @@
+diff --git a/gdk/gdk.c b/gdk/gdk.c
+index f0869a6..2f3c039 100644
+--- a/gdk/gdk.c
++++ b/gdk/gdk.c
+@@ -44,7 +44,6 @@
+ #include <string.h>
+ #include <stdlib.h>
+-#include <fribidi.h>
+ /**
+@@ -1118,17 +1117,6 @@ gdk_disable_multidevice (void)
+ PangoDirection
+ gdk_unichar_direction (gunichar ch)
+ {
+-  FriBidiCharType fribidi_ch_type;
+-
+-  G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
+-
+-  fribidi_ch_type = fribidi_get_bidi_type (ch);
+-
+-  if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
+-    return PANGO_DIRECTION_NEUTRAL;
+-  else if (FRIBIDI_IS_RTL (fribidi_ch_type))
+-    return PANGO_DIRECTION_RTL;
+-  else
+     return PANGO_DIRECTION_LTR;
+ }
+diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
+index aaac4cc..a76ad57 100644
+--- a/gtk/gtkpango.c
++++ b/gtk/gtkpango.c
+@@ -25,7 +25,6 @@
+ #include "config.h"
+ #include "gtkpango.h"
+ #include <pango/pangocairo.h>
+-#include <fribidi.h>
+ #include "gtkintl.h"
+ #define GTK_TYPE_FILL_LAYOUT_RENDERER            (_gtk_fill_layout_renderer_get_type())
+@@ -1326,17 +1325,6 @@ _gtk_pango_attr_list_merge (PangoAttrList *into,
+ PangoDirection
+ _gtk_pango_unichar_direction (gunichar ch)
+ {
+-  FriBidiCharType fribidi_ch_type;
+-
+-  G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
+-
+-  fribidi_ch_type = fribidi_get_bidi_type (ch);
+-
+-  if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
+-    return PANGO_DIRECTION_NEUTRAL;
+-  else if (FRIBIDI_IS_RTL (fribidi_ch_type))
+-    return PANGO_DIRECTION_RTL;
+-  else
+     return PANGO_DIRECTION_LTR;
+ }
+
index 42aee20fd79c5aa3206f5064c572cd5eb7eb79e3..47e0fbc733efbc0a53bedd1d565e6c185e37da6f 100644 (file)
@@ -1 +1,2 @@
 https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.29.tar.xz
+patches/no-fribidi.patch
index c2f912a289477ddade2ac47c3e967ad186a018e5..f7f31d79e98f2a0300b3b0547d2b9faa9c437f9a 100644 (file)
@@ -1 +1 @@
-3.24.29 1
+3.24.29 2
index 1193889565b0a28d0592d825eb5fad39391dba9e..40c062d94e8348c8df035fca1c34ead0b4a30949 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/sh -e
 
+patch -p1 < no-fribidi.patch
+sed -i \
+    -e 's/as_fn_error.*fribidi/: 0 "/' \
+    -e '/pkg_requires="fribidi >= .*/d' \
+    configure
+
 ./configure \
     --prefix=/usr \
     --enable-fontconfig
index ea2a7e082ef99f9820abc1dd33596235cf79e300..777254dec183e3218b4fbe92077341ff5f83e469 100644 (file)
@@ -1 +1,2 @@
 1cdd39c9d007b06e737e7738004d7f38cf9b1e92843f37307b24e7ff63ab8e53
+c6d5c147d795edde634178f3a1437c81fe932fcaaaf2c9fb8269f59f4da70897
index 42209260819cb0f88f578e81d57ead5945835b6b..58efa52d7f83b147c05f087ff96db2b4001c8e98 100644 (file)
@@ -1,6 +1,5 @@
 expat
 fontconfig
 freetype-harfbuzz
-fribidi
 nasm    make
 pkgconf make
diff --git a/extra/libass/patches/no-fribidi.patch b/extra/libass/patches/no-fribidi.patch
new file mode 100644 (file)
index 0000000..4d033a6
--- /dev/null
@@ -0,0 +1,218 @@
+diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c
+index ffcb36b..849b55f 100644
+--- a/libass/ass_shaper.c
++++ b/libass/ass_shaper.c
+@@ -81,8 +81,7 @@ struct ass_shaper_font_data {
+  */
+ void ass_shaper_info(ASS_Library *lib)
+ {
+-    ass_msg(lib, MSGL_INFO, "Shaper: FriBidi "
+-            FRIBIDI_VERSION " (SIMPLE)"
++    ass_msg(lib, MSGL_INFO, "Shaper: "
+             " HarfBuzz-ng %s (COMPLEX)", hb_version_string()
+            );
+ }
+@@ -686,8 +685,7 @@ static bool shape_harfbuzz(ASS_Shaper *shaper, GlyphInfo *glyphs, size_t len)
+         hb_buffer_add_utf32(buf, shaper->event_text + offset, i - offset + 1,
+                 0, i - offset + 1);
+-        props.direction = FRIBIDI_LEVEL_IS_RTL(level) ?
+-            HB_DIRECTION_RTL : HB_DIRECTION_LTR;
++        props.direction = HB_DIRECTION_LTR;
+         props.script = glyphs[offset].script;
+         props.language  = hb_shaper_get_run_language(shaper, props.script);
+         hb_buffer_set_segment_properties(buf, &props);
+@@ -754,33 +752,6 @@ void ass_shaper_determine_script(ASS_Shaper *shaper, GlyphInfo *glyphs,
+     }
+ }
+-/**
+- * \brief Shape event text with FriBidi. Does mirroring and simple
+- * Arabic shaping.
+- * \param len number of clusters
+- */
+-static void shape_fribidi(ASS_Shaper *shaper, GlyphInfo *glyphs, size_t len)
+-{
+-    int i;
+-    FriBidiJoiningType *joins = calloc(sizeof(*joins), len);
+-
+-    // shape on codepoint level
+-    fribidi_get_joining_types(shaper->event_text, len, joins);
+-    fribidi_join_arabic(shaper->ctypes, len, shaper->emblevels, joins);
+-    fribidi_shape(FRIBIDI_FLAGS_DEFAULT | FRIBIDI_FLAGS_ARABIC,
+-            shaper->emblevels, len, joins, shaper->event_text);
+-
+-    // update indexes
+-    for (i = 0; i < len; i++) {
+-        GlyphInfo *info = glyphs + i;
+-        FT_Face face = info->font->faces[info->face_index];
+-        info->symbol = shaper->event_text[i];
+-        info->glyph_index = FT_Get_Char_Index(face, ass_font_index_magic(face, shaper->event_text[i]));
+-    }
+-
+-    free(joins);
+-}
+-
+ /**
+  * \brief Toggle kerning for HarfBuzz shaping.
+  * \param shaper shaper instance
+@@ -864,33 +835,6 @@ void ass_shaper_set_bidi_brackets(ASS_Shaper *shaper, bool match_brackets)
+ }
+ #endif
+-/**
+-  * \brief Remove all zero-width invisible characters from the text.
+-  * \param text_info text
+-  */
+-static void ass_shaper_skip_characters(TextInfo *text_info)
+-{
+-    int i;
+-    GlyphInfo *glyphs = text_info->glyphs;
+-
+-    for (i = 0; i < text_info->length; i++) {
+-        // Skip direction override control characters
+-        if ((glyphs[i].symbol <= 0x202e && glyphs[i].symbol >= 0x202a)
+-                || (glyphs[i].symbol <= 0x200f && glyphs[i].symbol >= 0x200b)
+-                || (glyphs[i].symbol <= 0x206f && glyphs[i].symbol >= 0x2060)
+-                || (glyphs[i].symbol <= 0xfe0f && glyphs[i].symbol >= 0xfe00)
+-                || (glyphs[i].symbol <= 0xe01ef && glyphs[i].symbol >= 0xe0100)
+-                || (glyphs[i].symbol <= 0x180f && glyphs[i].symbol >= 0x180b)
+-                || glyphs[i].symbol == 0x061c
+-                || glyphs[i].symbol == 0xfeff
+-                || glyphs[i].symbol == 0x00ad
+-                || glyphs[i].symbol == 0x034f) {
+-            glyphs[i].symbol = 0;
+-            glyphs[i].skip = true;
+-        }
+-    }
+-}
+-
+ /**
+  * \brief Shape an event's text. Calculates directional runs and shapes them.
+  * \param text_info event's text
+@@ -898,52 +842,18 @@ static void ass_shaper_skip_characters(TextInfo *text_info)
+  */
+ bool ass_shaper_shape(ASS_Shaper *shaper, TextInfo *text_info)
+ {
+-    int i, ret, last_break;
+-    FriBidiParType dir;
++    int i;
+     GlyphInfo *glyphs = text_info->glyphs;
+     if (!check_allocations(shaper, text_info->length))
+         return false;
+     // Get bidi character types and embedding levels
+-    last_break = 0;
+     for (i = 0; i < text_info->length; i++) {
+         shaper->event_text[i] = glyphs[i].symbol;
+-        // embedding levels should be calculated paragraph by paragraph
+-        if (glyphs[i].symbol == '\n' || i == text_info->length - 1) {
+-            dir = shaper->base_direction;
+-            fribidi_get_bidi_types(shaper->event_text + last_break,
+-                    i - last_break + 1, shaper->ctypes + last_break);
+-#ifdef USE_FRIBIDI_EX_API
+-            FriBidiBracketType *btypes = NULL;
+-            if (shaper->bidi_brackets) {
+-                btypes = shaper->btypes + last_break;
+-                fribidi_get_bracket_types(shaper->event_text + last_break,
+-                        i - last_break + 1, shaper->ctypes + last_break,
+-                        btypes);
+-            }
+-            ret = fribidi_get_par_embedding_levels_ex(
+-                    shaper->ctypes + last_break, btypes,
+-                    i - last_break + 1, &dir, shaper->emblevels + last_break);
+-#else
+-            ret = fribidi_get_par_embedding_levels(shaper->ctypes + last_break,
+-                    i - last_break + 1, &dir, shaper->emblevels + last_break);
+-#endif
+-            if (ret == 0)
+-                return false;
+-            last_break = i + 1;
+-        }
+     }
+-    switch (shaper->shaping_level) {
+-    case ASS_SHAPING_SIMPLE:
+-        shape_fribidi(shaper, glyphs, text_info->length);
+-        ass_shaper_skip_characters(text_info);
+-        return true;
+-    case ASS_SHAPING_COMPLEX:
+-    default:
+-        return shape_harfbuzz(shaper, glyphs, text_info->length);
+-    }
++    return shape_harfbuzz(shaper, glyphs, text_info->length);
+ }
+ /**
+@@ -955,7 +865,7 @@ ASS_Shaper *ass_shaper_new(void)
+     if (!shaper)
+         return NULL;
+-    shaper->base_direction = FRIBIDI_PAR_ON;
++    shaper->base_direction = 0;
+     if (!init_features(shaper))
+         goto error;
+@@ -998,25 +908,12 @@ void ass_shaper_cleanup(ASS_Shaper *shaper, TextInfo *text_info)
+  */
+ FriBidiStrIndex *ass_shaper_reorder(ASS_Shaper *shaper, TextInfo *text_info)
+ {
+-    int i, ret;
++    int i;
+     // Initialize reorder map
+     for (i = 0; i < text_info->length; i++)
+         shaper->cmap[i] = i;
+-    // Create reorder map line-by-line
+-    for (i = 0; i < text_info->n_lines; i++) {
+-        LineInfo *line = text_info->lines + i;
+-        FriBidiParType dir = FRIBIDI_PAR_ON;
+-
+-        ret = fribidi_reorder_line(0,
+-                shaper->ctypes + line->offset, line->len, 0, dir,
+-                shaper->emblevels + line->offset, NULL,
+-                shaper->cmap + line->offset);
+-        if (ret == 0)
+-            return NULL;
+-    }
+-
+     return shaper->cmap;
+ }
+@@ -1034,10 +931,5 @@ FriBidiStrIndex *ass_shaper_get_reorder_map(ASS_Shaper *shaper)
+  */
+ FriBidiParType resolve_base_direction(int enc)
+ {
+-    switch (enc) {
+-        case -1:
+-            return FRIBIDI_PAR_ON;
+-        default:
+-            return FRIBIDI_PAR_LTR;
+-    }
++    return 0;
+ }
+diff --git a/libass/ass_shaper.h b/libass/ass_shaper.h
+index 70bec9a..c0ff055 100644
+--- a/libass/ass_shaper.h
++++ b/libass/ass_shaper.h
+@@ -21,13 +21,14 @@
+ typedef struct ass_shaper ASS_Shaper;
+-#include <fribidi.h>
+ #include <stdbool.h>
+ #include "ass_render.h"
+-#if FRIBIDI_MAJOR_VERSION >= 1
+-#define USE_FRIBIDI_EX_API
+-#endif
++typedef uint32_t FriBidiChar;
++typedef uint32_t FriBidiCharType;
++typedef int FriBidiStrIndex;
++typedef int FriBidiParType;
++typedef signed char FriBidiLevel;
+ void ass_shaper_info(ASS_Library *lib);
+ ASS_Shaper *ass_shaper_new(void);
index a62718933dbc5e2476d77f0eee7f4e00a2780cc7..6e432bea40e3c127c3df3f677f32736ed196a8d1 100644 (file)
@@ -1 +1,2 @@
 https://github.com/libass/libass/releases/download/0.15.1/libass-0.15.1.tar.xz
+patches/no-fribidi.patch
index a506fde315b948faec143a15776a3019c1ff3530..1eff0b70b1b00281b4c438bc54fce1ba25915f48 100644 (file)
@@ -1 +1 @@
-0.15.1 1
+0.15.1 2
index 1d4cc2e1b300e12705ff8a37a84e6eefad7686aa..6bf0c55c1d5f031b82ce8ca80f5f94bc40401aed 100755 (executable)
@@ -2,8 +2,12 @@
 
 export DESTDIR="$1"
 
-sed -i "/subdir('tests')/d"    meson.build
-sed -i "/subdir('examples')/d" meson.build
+sed -i \
+    -e "/subdir('tests')/d" \
+    -e "/subdir('examples')/d" \
+    meson.build
+
+patch -p1 < no-fribidi.patch
 
 # Don't clone subprojects we don't even enable
 rm -rf subprojects
index 9cd73857f77c05016e69da6a3882156e84238344..e4138946ce2f7573f6a95776004eca75826d68fe 100644 (file)
@@ -1 +1,2 @@
 8783c82927582437d3a224eb18ea90d195b7451ff2effdffba16039df5346170
+9d071dd6db8446017d1fcdd252cc168fa889e306d3bbb97651dd55a36425e2c6
index a826934de2274ab5305c2f6215984e053bbb3e28..cd1947b7cbc17af88e630796c06cdf303c1a0bc1 100644 (file)
@@ -1,7 +1,6 @@
 cairo
 fontconfig
 freetype-harfbuzz
-fribidi
 glib
 libXft
 libXrender
diff --git a/extra/pango/patches/no-fribidi.patch b/extra/pango/patches/no-fribidi.patch
new file mode 100644 (file)
index 0000000..f04e7b6
--- /dev/null
@@ -0,0 +1,233 @@
+diff --git a/meson.build b/meson.build
+index f542574..d57df3a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -191,7 +191,6 @@ endif
+ pango_deps = []
+ glib_req_version = '>= 2.62'
+-fribidi_req_version = '>= 0.19.7'
+ libthai_req_version = '>= 0.1.9'
+ harfbuzz_req_version = '>= 2.0.0'
+ fontconfig_req_version = '>= 2.11.91'
+@@ -211,11 +210,6 @@ gio_dep = dependency('gio-2.0', version: glib_req_version,
+                          fallback: ['glib', 'libgio_dep'])
+ pango_deps += [glib_dep, gobject_dep, gio_dep]
+-fribidi_dep = dependency('fribidi', version: fribidi_req_version,
+-                         fallback: ['fribidi', 'libfribidi_dep'],
+-                         default_options: ['docs=false'])
+-pango_deps += fribidi_dep
+-
+ thai_dep = dependency('libthai', version: libthai_req_version, required: get_option('libthai'))
+ if thai_dep.found()
+   pango_conf.set('HAVE_LIBTHAI', 1)
+diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c
+index a5a13a9..29ddeb8 100644
+--- a/pango/pango-bidi-type.c
++++ b/pango/pango-bidi-type.c
+@@ -23,16 +23,18 @@
+ #include <string.h>
+-#include <fribidi.h>
+-
+ #undef PANGO_DISABLE_DEPRECATED
+ #include "pango-bidi-type.h"
+ #include "pango-utils.h"
+-#if FRIBIDI_MAJOR_VERSION >= 1
+-#define USE_FRIBIDI_EX_API
+-#endif
++typedef uint32_t FriBidiChar;
++typedef uint32_t FriBidiCharType;
++typedef int FriBidiStrIndex;
++typedef int FriBidiParType;
++typedef signed char FriBidiLevel;
++
++#define FRIBIDI_PAR_LTR (0x00000010L | 0x00000100L)
+ /**
+  * pango_bidi_type_for_unichar:
+@@ -52,40 +54,7 @@
+ PangoBidiType
+ pango_bidi_type_for_unichar (gunichar ch)
+ {
+-  FriBidiCharType fribidi_ch_type;
+-
+-  G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
+-
+-  fribidi_ch_type = fribidi_get_bidi_type (ch);
+-
+-  switch (fribidi_ch_type)
+-    {
+-    case FRIBIDI_TYPE_LTR:  return PANGO_BIDI_TYPE_L;
+-    case FRIBIDI_TYPE_LRE:  return PANGO_BIDI_TYPE_LRE;
+-    case FRIBIDI_TYPE_LRO:  return PANGO_BIDI_TYPE_LRO;
+-    case FRIBIDI_TYPE_RTL:  return PANGO_BIDI_TYPE_R;
+-    case FRIBIDI_TYPE_AL:   return PANGO_BIDI_TYPE_AL;
+-    case FRIBIDI_TYPE_RLE:  return PANGO_BIDI_TYPE_RLE;
+-    case FRIBIDI_TYPE_RLO:  return PANGO_BIDI_TYPE_RLO;
+-    case FRIBIDI_TYPE_PDF:  return PANGO_BIDI_TYPE_PDF;
+-    case FRIBIDI_TYPE_EN:   return PANGO_BIDI_TYPE_EN;
+-    case FRIBIDI_TYPE_ES:   return PANGO_BIDI_TYPE_ES;
+-    case FRIBIDI_TYPE_ET:   return PANGO_BIDI_TYPE_ET;
+-    case FRIBIDI_TYPE_AN:   return PANGO_BIDI_TYPE_AN;
+-    case FRIBIDI_TYPE_CS:   return PANGO_BIDI_TYPE_CS;
+-    case FRIBIDI_TYPE_NSM:  return PANGO_BIDI_TYPE_NSM;
+-    case FRIBIDI_TYPE_BN:   return PANGO_BIDI_TYPE_BN;
+-    case FRIBIDI_TYPE_BS:   return PANGO_BIDI_TYPE_B;
+-    case FRIBIDI_TYPE_SS:   return PANGO_BIDI_TYPE_S;
+-    case FRIBIDI_TYPE_WS:   return PANGO_BIDI_TYPE_WS;
+-    case FRIBIDI_TYPE_ON:   return PANGO_BIDI_TYPE_ON;
+-    case FRIBIDI_TYPE_LRI:  return PANGO_BIDI_TYPE_LRI;
+-    case FRIBIDI_TYPE_RLI:  return PANGO_BIDI_TYPE_RLI;
+-    case FRIBIDI_TYPE_FSI:  return PANGO_BIDI_TYPE_FSI;
+-    case FRIBIDI_TYPE_PDI:  return PANGO_BIDI_TYPE_PDI;
+-    default:
+-      return PANGO_BIDI_TYPE_ON;
+-    }
++    return PANGO_BIDI_TYPE_L;
+ }
+ /* Some bidi-related functions */
+@@ -120,38 +89,16 @@ pango_log2vis_get_embedding_levels (const gchar    *text,
+   glong n_chars, i;
+   guint8 *embedding_levels_list;
+   const gchar *p;
+-  FriBidiParType fribidi_base_dir;
+   FriBidiCharType *bidi_types;
+ #ifdef USE_FRIBIDI_EX_API
+   FriBidiBracketType *bracket_types;
+ #endif
+   FriBidiLevel max_level;
+   FriBidiCharType ored_types = 0;
+-  FriBidiCharType anded_strongs = FRIBIDI_TYPE_RLE;
+   G_STATIC_ASSERT (sizeof (FriBidiLevel) == sizeof (guint8));
+   G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
+-  switch (*pbase_dir)
+-    {
+-    case PANGO_DIRECTION_LTR:
+-    case PANGO_DIRECTION_TTB_RTL:
+-      fribidi_base_dir = FRIBIDI_PAR_LTR;
+-      break;
+-    case PANGO_DIRECTION_RTL:
+-    case PANGO_DIRECTION_TTB_LTR:
+-      fribidi_base_dir = FRIBIDI_PAR_RTL;
+-      break;
+-    case PANGO_DIRECTION_WEAK_RTL:
+-      fribidi_base_dir = FRIBIDI_PAR_WRTL;
+-      break;
+-    case PANGO_DIRECTION_WEAK_LTR:
+-    case PANGO_DIRECTION_NEUTRAL:
+-    default:
+-      fribidi_base_dir = FRIBIDI_PAR_WLTR;
+-      break;
+-    }
+-
+   if (length < 0)
+     length = strlen (text);
+@@ -165,16 +112,13 @@ pango_log2vis_get_embedding_levels (const gchar    *text,
+   for (i = 0, p = text; p < text + length; p = g_utf8_next_char(p), i++)
+     {
+-      gunichar ch = g_utf8_get_char (p);
+-      FriBidiCharType char_type = fribidi_get_bidi_type (ch);
++      FriBidiCharType char_type = FRIBIDI_PAR_LTR;
+       if (i == n_chars)
+         break;
+       bidi_types[i] = char_type;
+       ored_types |= char_type;
+-      if (FRIBIDI_IS_STRONG (char_type))
+-        anded_strongs &= char_type;
+ #ifdef USE_FRIBIDI_EX_API
+       if (G_UNLIKELY(bidi_types[i] == FRIBIDI_TYPE_ON))
+         bracket_types[i] = fribidi_get_bracket (ch);
+@@ -200,39 +144,8 @@ pango_log2vis_get_embedding_levels (const gchar    *text,
+      * o base_dir doesn't have an RTL taste.
+      * o there are letters, and base_dir is weak.
+      */
+-    if (!FRIBIDI_IS_ISOLATE (ored_types) &&
+-      !FRIBIDI_IS_RTL (ored_types) &&
+-      !FRIBIDI_IS_ARABIC (ored_types) &&
+-      (!FRIBIDI_IS_RTL (fribidi_base_dir) ||
+-        (FRIBIDI_IS_WEAK (fribidi_base_dir) &&
+-         FRIBIDI_IS_LETTER (ored_types))
+-      ))
+-      {
+-        /* all LTR */
+-      fribidi_base_dir = FRIBIDI_PAR_LTR;
+       memset (embedding_levels_list, 0, n_chars);
+       goto resolved;
+-      }
+-    /* The case that all resolved levels will be RTL is much more complex.
+-     * No isolates, no numbers, all strongs are RTL, and one of
+-     * the following:
+-     *
+-     * o base_dir has an RTL taste (may be weak).
+-     * o there are letters, and base_dir is weak.
+-     */
+-    else if (!FRIBIDI_IS_ISOLATE (ored_types) &&
+-           !FRIBIDI_IS_NUMBER (ored_types) &&
+-           FRIBIDI_IS_RTL (anded_strongs) &&
+-           (FRIBIDI_IS_RTL (fribidi_base_dir) ||
+-             (FRIBIDI_IS_WEAK (fribidi_base_dir) &&
+-              FRIBIDI_IS_LETTER (ored_types))
+-           ))
+-      {
+-        /* all RTL */
+-      fribidi_base_dir = FRIBIDI_PAR_RTL;
+-      memset (embedding_levels_list, 1, n_chars);
+-      goto resolved;
+-      }
+ #ifdef USE_FRIBIDI_EX_API
+@@ -240,12 +153,10 @@ pango_log2vis_get_embedding_levels (const gchar    *text,
+                                                  &fribidi_base_dir,
+                                                  (FriBidiLevel*)embedding_levels_list);
+ #else
+-  max_level = fribidi_get_par_embedding_levels (bidi_types, n_chars,
+-                                              &fribidi_base_dir,
+-                                              (FriBidiLevel*)embedding_levels_list);
++  max_level = 0;
+ #endif
+-  if (G_UNLIKELY(max_level == 0))
++  if (max_level == 0)
+     {
+       /* fribidi_get_par_embedding_levels() failed. */
+       memset (embedding_levels_list, 0, length);
+@@ -258,7 +169,7 @@ resolved:
+   g_free (bracket_types);
+ #endif
+-  *pbase_dir = (fribidi_base_dir == FRIBIDI_PAR_LTR) ?  PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL;
++  *pbase_dir = PANGO_DIRECTION_LTR;
+   return embedding_levels_list;
+ }
+@@ -282,17 +193,6 @@ resolved:
+ PangoDirection
+ pango_unichar_direction (gunichar ch)
+ {
+-  FriBidiCharType fribidi_ch_type;
+-
+-  G_STATIC_ASSERT (sizeof (FriBidiChar) == sizeof (gunichar));
+-
+-  fribidi_ch_type = fribidi_get_bidi_type (ch);
+-
+-  if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
+-    return PANGO_DIRECTION_NEUTRAL;
+-  else if (FRIBIDI_IS_RTL (fribidi_ch_type))
+-    return PANGO_DIRECTION_RTL;
+-  else
+     return PANGO_DIRECTION_LTR;
+ }
index 7521cf4845fdb3c114d7834714ff4c955617301f..4222e58204c9dccf064a3490af6fd4a3da7fd86e 100644 (file)
@@ -1 +1,2 @@
 https://github.com/GNOME/pango/archive/1.48.7.tar.gz
+patches/no-fribidi.patch
index 3098975daa8f709b572b2c947d33248727d58215..9989cfaf57fab330eac656b7c780759411796d31 100644 (file)
@@ -1 +1 @@
-1.48.7 1
+1.48.7 2