From 4844d837d8c901c0edda6179ebff1b0c006fc07c Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Mon, 12 Jul 2021 10:57:37 -0400 Subject: [PATCH] fribidi: drop package --- extra/fribidi/build | 8 - extra/fribidi/checksums | 1 - extra/fribidi/sources | 1 - extra/fribidi/version | 1 - extra/gtk+3/build | 6 +- extra/gtk+3/checksums | 1 + extra/gtk+3/depends | 1 - extra/gtk+3/patches/no-fribidi.patch | 60 +++++++ extra/gtk+3/sources | 1 + extra/gtk+3/version | 2 +- extra/libass/build | 6 + extra/libass/checksums | 1 + extra/libass/depends | 1 - extra/libass/patches/no-fribidi.patch | 218 ++++++++++++++++++++++++ extra/libass/sources | 1 + extra/libass/version | 2 +- extra/pango/build | 8 +- extra/pango/checksums | 1 + extra/pango/depends | 1 - extra/pango/patches/no-fribidi.patch | 233 ++++++++++++++++++++++++++ extra/pango/sources | 1 + extra/pango/version | 2 +- 22 files changed, 537 insertions(+), 20 deletions(-) delete mode 100755 extra/fribidi/build delete mode 100644 extra/fribidi/checksums delete mode 100644 extra/fribidi/sources delete mode 100644 extra/fribidi/version create mode 100644 extra/gtk+3/patches/no-fribidi.patch create mode 100644 extra/libass/patches/no-fribidi.patch create mode 100644 extra/pango/patches/no-fribidi.patch diff --git a/extra/fribidi/build b/extra/fribidi/build deleted file mode 100755 index cdabf58..0000000 --- a/extra/fribidi/build +++ /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 index 2a5dfc8..0000000 --- a/extra/fribidi/checksums +++ /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 index 0ddde5e..0000000 --- a/extra/fribidi/sources +++ /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 index 2d248d7..0000000 --- a/extra/fribidi/version +++ /dev/null @@ -1 +0,0 @@ -1.0.10 1 diff --git a/extra/gtk+3/build b/extra/gtk+3/build index 8317fc8..9ae968d 100755 --- a/extra/gtk+3/build +++ b/extra/gtk+3/build @@ -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 '//d;/atk_bridge_adaptor_init/d' \ @@ -11,6 +13,8 @@ sed -i '//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 \ diff --git a/extra/gtk+3/checksums b/extra/gtk+3/checksums index 8e8e9ef..1fe5fef 100644 --- a/extra/gtk+3/checksums +++ b/extra/gtk+3/checksums @@ -1 +1,2 @@ f57ec4ade8f15cab0c23a80dcaee85b876e70a8823d9105f067ce335a8268caa +b47bef2cdc90f878119ed4e91de6aa8bd1b08521d1eb8f8b077cadb579045ee1 diff --git a/extra/gtk+3/depends b/extra/gtk+3/depends index 561ac12..49c8f7d 100644 --- a/extra/gtk+3/depends +++ b/extra/gtk+3/depends @@ -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 index 0000000..fd398ca --- /dev/null +++ b/extra/gtk+3/patches/no-fribidi.patch @@ -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 + #include + +-#include + + + /** +@@ -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 +-#include + #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; + } + diff --git a/extra/gtk+3/sources b/extra/gtk+3/sources index 42aee20..47e0fbc 100644 --- a/extra/gtk+3/sources +++ b/extra/gtk+3/sources @@ -1 +1,2 @@ https://download.gnome.org/sources/gtk+/3.24/gtk+-3.24.29.tar.xz +patches/no-fribidi.patch diff --git a/extra/gtk+3/version b/extra/gtk+3/version index c2f912a..f7f31d7 100644 --- a/extra/gtk+3/version +++ b/extra/gtk+3/version @@ -1 +1 @@ -3.24.29 1 +3.24.29 2 diff --git a/extra/libass/build b/extra/libass/build index 1193889..40c062d 100755 --- a/extra/libass/build +++ b/extra/libass/build @@ -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 diff --git a/extra/libass/checksums b/extra/libass/checksums index ea2a7e0..777254d 100644 --- a/extra/libass/checksums +++ b/extra/libass/checksums @@ -1 +1,2 @@ 1cdd39c9d007b06e737e7738004d7f38cf9b1e92843f37307b24e7ff63ab8e53 +c6d5c147d795edde634178f3a1437c81fe932fcaaaf2c9fb8269f59f4da70897 diff --git a/extra/libass/depends b/extra/libass/depends index 4220926..58efa52 100644 --- a/extra/libass/depends +++ b/extra/libass/depends @@ -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 index 0000000..4d033a6 --- /dev/null +++ b/extra/libass/patches/no-fribidi.patch @@ -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 + #include + #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); diff --git a/extra/libass/sources b/extra/libass/sources index a627189..6e432be 100644 --- a/extra/libass/sources +++ b/extra/libass/sources @@ -1 +1,2 @@ https://github.com/libass/libass/releases/download/0.15.1/libass-0.15.1.tar.xz +patches/no-fribidi.patch diff --git a/extra/libass/version b/extra/libass/version index a506fde..1eff0b7 100644 --- a/extra/libass/version +++ b/extra/libass/version @@ -1 +1 @@ -0.15.1 1 +0.15.1 2 diff --git a/extra/pango/build b/extra/pango/build index 1d4cc2e..6bf0c55 100755 --- a/extra/pango/build +++ b/extra/pango/build @@ -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 diff --git a/extra/pango/checksums b/extra/pango/checksums index 9cd7385..e413894 100644 --- a/extra/pango/checksums +++ b/extra/pango/checksums @@ -1 +1,2 @@ 8783c82927582437d3a224eb18ea90d195b7451ff2effdffba16039df5346170 +9d071dd6db8446017d1fcdd252cc168fa889e306d3bbb97651dd55a36425e2c6 diff --git a/extra/pango/depends b/extra/pango/depends index a826934..cd1947b 100644 --- a/extra/pango/depends +++ b/extra/pango/depends @@ -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 index 0000000..f04e7b6 --- /dev/null +++ b/extra/pango/patches/no-fribidi.patch @@ -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 + +-#include +- + #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; + } + diff --git a/extra/pango/sources b/extra/pango/sources index 7521cf4..4222e58 100644 --- a/extra/pango/sources +++ b/extra/pango/sources @@ -1 +1,2 @@ https://github.com/GNOME/pango/archive/1.48.7.tar.gz +patches/no-fribidi.patch diff --git a/extra/pango/version b/extra/pango/version index 3098975..9989cfa 100644 --- a/extra/pango/version +++ b/extra/pango/version @@ -1 +1 @@ -1.48.7 1 +1.48.7 2 -- 2.39.2