- apply a patch from upstream which a nasty crash i've been observing

This commit is contained in:
jasper 2012-09-27 18:50:37 +00:00
parent d62a678e0e
commit 12dcc9db63
2 changed files with 37 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.68 2012/09/26 21:37:00 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.69 2012/09/27 18:50:37 jasper Exp $
SHARED_ONLY= Yes
@ -6,6 +6,7 @@ COMMENT= library for layout and rendering of text
GNOME_VERSION= 1.32.0
GNOME_PROJECT= pango
REVISION= 0
SHARED_LIBS += pango-1.0 3200.0 # 3200.0
SHARED_LIBS += pangoft2-1.0 3200.0 # 3200.0

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-modules_basic_basic-fc_c,v 1.1 2012/09/27 18:50:37 jasper Exp $
From 0d34c10108585b4cfed042aa2ef501780b2d2193 Mon Sep 17 00:00:00 2001
From: Behdad Esfahbod <behdad@behdad.org>
Date: Thu, 27 Sep 2012 18:08:30 +0000
Subject: Fixup grapheme clusters
--- modules/basic/basic-fc.c.orig Wed Sep 26 22:35:16 2012
+++ modules/basic/basic-fc.c Thu Sep 27 20:43:34 2012
@@ -317,6 +317,7 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC
hb_glyph_position_t *hb_position;
int last_cluster;
guint i, num_glyphs;
+ unsigned int item_offset = item_text - paragraph_text;
g_return_if_fail (font != NULL);
g_return_if_fail (analysis != NULL);
@@ -362,7 +363,7 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC
hb_buffer_set_script (hb_buffer, hb_glib_script_to_script (analysis->script));
hb_buffer_set_language (hb_buffer, hb_language_from_string (pango_language_to_string (analysis->language), -1));
- hb_buffer_add_utf8 (hb_buffer, paragraph_text, paragraph_length, item_text - paragraph_text, item_length);
+ hb_buffer_add_utf8 (hb_buffer, paragraph_text, paragraph_length, item_offset, item_length);
hb_shape (hb_font, hb_buffer, NULL, 0);
if (PANGO_GRAVITY_IS_IMPROPER (analysis->gravity))
@@ -376,7 +377,7 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC
for (i = 0; i < num_glyphs; i++)
{
glyphs->glyphs[i].glyph = hb_glyph->codepoint;
- glyphs->log_clusters[i] = hb_glyph->cluster;
+ glyphs->log_clusters[i] = hb_glyph->cluster - item_offset;
glyphs->glyphs[i].attr.is_cluster_start = glyphs->log_clusters[i] != last_cluster;
hb_glyph++;
last_cluster = glyphs->log_clusters[i];