From 5f3d21b78679694f76e788e9308062380a0d0c8e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 Nov 2009 16:44:54 -0500 Subject: Remove REBUILD black magic Shouldn't be needed. --- configure.in | 13 ------------- pango/Makefile.am | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/configure.in b/configure.in index ba173468..513665cb 100644 --- a/configure.in +++ b/configure.in @@ -228,19 +228,6 @@ AC_ARG_ENABLE(rebuilds, AM_CONDITIONAL(CROSS_COMPILING, [test $cross_compiling = yes]) -# define a MAINT-like variable REBUILD which is set if Perl -# is found, so autogenerated sources can be rebuilt - -AC_CHECK_PROGS(PERL, perl5 perl) - -REBUILD=\# -if test "x$enable_rebuilds" = "xyes" && \ - test -n "$PERL" && \ - $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then - REBUILD= -fi -AC_SUBST(REBUILD) - have_x=false if test "x$pango_os_win32" != xyes; then AC_PATH_XTRA diff --git a/pango/Makefile.am b/pango/Makefile.am index ef0245c0..3480af04 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -132,7 +132,7 @@ pangoinclude_HEADERS = \ pango-enum-types.h: s-enum-types-h $(AM_V_GEN) true -s-enum-types-h: @REBUILD@ $(pango_headers) Makefile +s-enum-types-h: $(pango_headers) Makefile $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#ifndef __PANGO_ENUM_TYPES_H__\n#define __PANGO_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ @@ -145,7 +145,7 @@ s-enum-types-h: @REBUILD@ $(pango_headers) Makefile pango-enum-types.c: s-enum-types-c $(AM_V_GEN) true -s-enum-types-c: @REBUILD@ $(pango_headers) Makefile +s-enum-types-c: $(pango_headers) Makefile $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#include " \ --fprod "\n/* enumerations from \"@filename@\" */" \ -- cgit v1.2.1 From 16c3f1d491a04eb8b12f209f97904c7862fbb9db Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 Nov 2009 17:09:31 -0500 Subject: Bug 587768 - [patch] Don't build pango-view twice Try to fix parallel build.. --- pango-view/Makefile.am | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/pango-view/Makefile.am b/pango-view/Makefile.am index 7a5e25ed..49af6614 100644 --- a/pango-view/Makefile.am +++ b/pango-view/Makefile.am @@ -84,20 +84,27 @@ endif ######################################################### -MAINTAINERCLEANFILES = pango-view.1 +MAINTAINERCLEANFILES = pango-view.1 pango-view.stamp +EXTRA_DIST += pango-view.stamp dist_man_MANS = pango-view.1 -$(srcdir)/pango-view.1: ../configure.in $(pango_view_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) pango-view$(EXEEXT) - $(AM_V_GEN) $(top_builddir)/missing --run \ +# The indirection through pango-view.stamp is to make parallel build work. +# See bug 587768. +pango-view.stamp: ../configure.in $(pango_view_SOURCES) + $(AM_V_GEN) X="$(srcdir)/pango-view.1"; \ + $(top_builddir)/missing --run \ help2man --no-info --section=1 \ - --help-option="--help-all" --output="$@.tmp" \ + --help-option="--help-all" --output="$$X.tmp" \ --name 'Pango text viewer' ./pango-view \ - && mv "$@.tmp" "$@" \ - || ($(RM) "$@"; \ - echo Failed to update pango-view.1, the man page may be outdated >&2; \ - (test -f "$@" || echo help2man is required to generate this file. >> "$@")); + && mv "$$X.tmp" "$$X" && touch $@ \ + || (echo Failed to update pango-view.1, the man page may be outdated >&2; \ + (test -f "$$X" || echo help2man is required to generate this file. >> "$$X")); +$(srcdir)/pango-view.1: pango-view$(EXEEXT) pango-view.stamp + $(AM_V_GEN) if test -f $@; then touch $@; else \ + $(RM) pango-view.stamp; \ + $(MAKE) $(AM_MAKEFLAGS) pango-view.stamp; \ + fi ######################################################### -- cgit v1.2.1 From 28e179b4f24e11f2af3b739c6c5c3bd560d2de74 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Nov 2009 11:03:29 -0500 Subject: Bug 587768 - [patch] Don't build pango-view twice Second try. --- pango-view/Makefile.am | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/pango-view/Makefile.am b/pango-view/Makefile.am index 49af6614..df8f9027 100644 --- a/pango-view/Makefile.am +++ b/pango-view/Makefile.am @@ -84,27 +84,25 @@ endif ######################################################### -MAINTAINERCLEANFILES = pango-view.1 pango-view.stamp -EXTRA_DIST += pango-view.stamp +MAINTAINERCLEANFILES = pango-view.1.in +EXTRA_DIST += pango-view.1.in +CLEANFILES += pango-view -dist_man_MANS = pango-view.1 +nodist_man_MANS = pango-view.1 -# The indirection through pango-view.stamp is to make parallel build work. +# The indirection through pango-view.1.in is to make parallel build work. # See bug 587768. -pango-view.stamp: ../configure.in $(pango_view_SOURCES) - $(AM_V_GEN) X="$(srcdir)/pango-view.1"; \ - $(top_builddir)/missing --run \ +$(srcdir)/pango-view.1.in: ../configure.in $(pango_view_SOURCES) + $(AM_V_GEN) $(top_builddir)/missing --run \ help2man --no-info --section=1 \ - --help-option="--help-all" --output="$$X.tmp" \ + --help-option="--help-all" --output="$@.tmp" \ --name 'Pango text viewer' ./pango-view \ - && mv "$$X.tmp" "$$X" && touch $@ \ + && mv "$@.tmp" "$@" \ || (echo Failed to update pango-view.1, the man page may be outdated >&2; \ - (test -f "$$X" || echo help2man is required to generate this file. >> "$$X")); -$(srcdir)/pango-view.1: pango-view$(EXEEXT) pango-view.stamp - $(AM_V_GEN) if test -f $@; then touch $@; else \ - $(RM) pango-view.stamp; \ - $(MAKE) $(AM_MAKEFLAGS) pango-view.stamp; \ - fi + (test -f "$@" || echo help2man is required to generate this file. >> "$@")); +pango-view.1: pango-view$(EXEEXT) + $(AM_V_GEN) $(MAKE) $(AM_MAKEFLAGS) pango-view.1.in && \ + cp $(srcdir)/pango-view.1.in $@ ######################################################### -- cgit v1.2.1 From 718c533d28cb760e45c7b874420b14003445a9c1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Nov 2009 11:57:59 -0500 Subject: Fix typo in previous commit --- pango-view/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango-view/Makefile.am b/pango-view/Makefile.am index df8f9027..2721f970 100644 --- a/pango-view/Makefile.am +++ b/pango-view/Makefile.am @@ -86,7 +86,7 @@ endif MAINTAINERCLEANFILES = pango-view.1.in EXTRA_DIST += pango-view.1.in -CLEANFILES += pango-view +CLEANFILES += pango-view.1 nodist_man_MANS = pango-view.1 -- cgit v1.2.1 From 4ccabeffc20f899163bf610356871afb197e9bf8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Nov 2009 16:20:42 -0500 Subject: Bug 596614 - Pango application receives SIGSEGV on pasting text with U+202E Fixed all modules to reverse glyphs if run is rtl. Except for Hangul module. Fixed pango_shape() to detect that, warn, and reverse. --- modules/indic/indic-fc.c | 1 + modules/khmer/khmer-fc.c | 1 + modules/thai/thai-fc.c | 1 + modules/tibetan/tibetan-fc.c | 1 + pango/glyphstring.c | 2 -- pango/pango-engine.c | 3 +++ pango/pango-impl-utils.h | 26 +++++++++++++++++++++++++- pango/pango-ot-buffer.c | 23 ++--------------------- pango/shape.c | 34 +++++++++++++++++++++++++++++++--- 9 files changed, 65 insertions(+), 27 deletions(-) diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index 6ba90c1a..3a232be4 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -252,6 +252,7 @@ indic_engine_shape (PangoEngineShape *engine, pango_glyph_string_set_size (glyphs, n_glyphs); buffer = pango_ot_buffer_new (fc_font); + pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); set_glyphs(font, wc_out, tags, n_glyphs, buffer, (indic_shape_engine->classTable->scriptFlags & SF_PROCESS_ZWJ) != 0); diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c index 04c5c830..14357d78 100644 --- a/modules/khmer/khmer-fc.c +++ b/modules/khmer/khmer-fc.c @@ -481,6 +481,7 @@ khmer_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, return; buffer = pango_ot_buffer_new (fc_font); + pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); wcs = g_utf8_to_ucs4_fast (text, length, &n_chars); diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c index 66dccbb4..837a0286 100644 --- a/modules/thai/thai-fc.c +++ b/modules/thai/thai-fc.c @@ -298,6 +298,7 @@ thai_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, thai_set_glyphs (font_info, text, length, analysis->script, glyphs); buffer = pango_ot_buffer_new (PANGO_FC_FONT (font)); + pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); for (i = 0; i < glyphs->num_glyphs; i++) pango_ot_buffer_add_glyph (buffer, diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c index 51600fc8..4e894165 100644 --- a/modules/tibetan/tibetan-fc.c +++ b/modules/tibetan/tibetan-fc.c @@ -443,6 +443,7 @@ tibetan_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, return; buffer = pango_ot_buffer_new (fc_font); + pango_ot_buffer_set_rtl (buffer, analysis->level % 2 != 0); wcs = g_utf8_to_ucs4_fast (text, length, &n_chars); diff --git a/pango/glyphstring.c b/pango/glyphstring.c index 923a9360..0382eb6e 100644 --- a/pango/glyphstring.c +++ b/pango/glyphstring.c @@ -659,5 +659,3 @@ pango_glyph_string_x_to_index (PangoGlyphString *glyphs, } } } - - diff --git a/pango/pango-engine.c b/pango/pango-engine.c index 974e2d5a..50ba7f40 100644 --- a/pango/pango-engine.c +++ b/pango/pango-engine.c @@ -140,6 +140,9 @@ fallback_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, p = g_utf8_next_char (p); } + + if (analysis->level & 1) + pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); } static PangoCoverageLevel diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h index 3ef3a0c4..6d6c8ff2 100644 --- a/pango/pango-impl-utils.h +++ b/pango/pango-impl-utils.h @@ -150,7 +150,31 @@ pango_utf8_strlen (const gchar *p, gssize max) return len; } + +/* To be made public at some point */ + +static G_GNUC_UNUSED void +pango_glyph_string_reverse_range (PangoGlyphString *glyphs, + int start, int end) +{ + int i, j; + + for (i = start, j = end - 1; i < j; i++, j--) + { + PangoGlyphInfo glyph_info; + gint log_cluster; + + glyph_info = glyphs->glyphs[i]; + glyphs->glyphs[i] = glyphs->glyphs[j]; + glyphs->glyphs[j] = glyph_info; + + log_cluster = glyphs->log_clusters[i]; + glyphs->log_clusters[i] = glyphs->log_clusters[j]; + glyphs->log_clusters[j] = log_cluster; + } +} + + G_END_DECLS #endif /* __PANGO_IMPL_UTILS_H__ */ - diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c index a4aacc3a..533c3102 100644 --- a/pango/pango-ot-buffer.c +++ b/pango/pango-ot-buffer.c @@ -23,6 +23,7 @@ #include "pango-ot-private.h" #include "pangofc-private.h" +#include "pango-impl-utils.h" /* cache a single hb_buffer_t */ static hb_buffer_t *cached_buffer = NULL; @@ -203,26 +204,6 @@ pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, *n_glyphs = hb_buffer_get_len (buffer->buffer); } -static void -swap_range (PangoGlyphString *glyphs, int start, int end) -{ - int i, j; - - for (i = start, j = end - 1; i < j; i++, j--) - { - PangoGlyphInfo glyph_info; - gint log_cluster; - - glyph_info = glyphs->glyphs[i]; - glyphs->glyphs[i] = glyphs->glyphs[j]; - glyphs->glyphs[j] = glyph_info; - - log_cluster = glyphs->log_clusters[i]; - glyphs->log_clusters[i] = glyphs->log_clusters[j]; - glyphs->log_clusters[j] = log_cluster; - } -} - static void apply_gpos_ltr (PangoGlyphString *glyphs, hb_glyph_position_t *positions, @@ -389,7 +370,7 @@ pango_ot_buffer_output (const PangoOTBuffer *buffer, if (buffer->rtl) { /* Swap all glyphs */ - swap_range (glyphs, 0, glyphs->num_glyphs); + pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); } positions = hb_buffer_get_glyph_positions (buffer->buffer); diff --git a/pango/shape.c b/pango/shape.c index 0dd56a8e..1513b028 100644 --- a/pango/shape.c +++ b/pango/shape.c @@ -108,20 +108,21 @@ pango_shape (const gchar *text, else glyphs->num_glyphs = 0; - if (!glyphs->num_glyphs) + if (G_UNLIKELY (!glyphs->num_glyphs)) { PangoEngineShape *fallback_engine = _pango_get_fallback_shaper (); _pango_engine_shape_shape (fallback_engine, analysis->font, text, length, analysis, glyphs); + if (G_UNLIKELY (!glyphs->num_glyphs)) + return; } /* make sure last_cluster is invalid */ last_cluster = glyphs->log_clusters[0] - 1; for (i = 0; i < glyphs->num_glyphs; i++) { - /* Set glyphs[i].attr.is_cluster_start based on log_clusters[] - */ + /* Set glyphs[i].attr.is_cluster_start based on log_clusters[] */ if (glyphs->log_clusters[i] != last_cluster) { glyphs->glyphs[i].attr.is_cluster_start = TRUE; @@ -141,4 +142,31 @@ pango_shape (const gchar *text, glyphs->glyphs[i].geometry.x_offset += glyphs->glyphs[i].geometry.width; } } + + /* Make sure glyphstring direction conforms to analysis->level */ + if (G_UNLIKELY ((analysis->level & 1) && + glyphs->log_clusters[0] < glyphs->log_clusters[glyphs->num_glyphs - 1])) + { + /* Warn once per shaper */ + static GQuark warned_quark = 0; + + if (!warned_quark) + warned_quark = g_quark_from_static_string ("pango-shape-warned"); + + if (analysis->shape_engine && !g_object_get_qdata (G_OBJECT (analysis->shape_engine), warned_quark)) + { + GType engine_type = G_OBJECT_TYPE (analysis->shape_engine); + const char *engine_name = g_type_name (engine_type); + if (!engine_name) + engine_name = "(unknown)"; + + g_warning ("Expected RTL run but shape-engine='%s' returned LTR. Fixing.", engine_name); + + g_object_set_qdata_full (G_OBJECT (analysis->shape_engine), warned_quark, + GINT_TO_POINTER (1), NULL); + } + + /* *Fix* it so we don't crash later */ + pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); + } } -- cgit v1.2.1 From d9abcaf566e9cd7f702c98958f99f90fd53b4c0b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Nov 2009 19:31:23 -0500 Subject: Bug 341481 - pangocairo kerning problem with nonidentity scaling Finally fix this embarrassing bug. The fix is a kludge, but it will be redone for 1.28 (harfbuzz-ng) anyway. --- pango/pango-ot-buffer.c | 56 +++++++++++++++++++++++++++++++++++++++++++------ pango/pangofc-font.c | 19 +++++++++++++++++ pango/pangofc-private.h | 44 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 6 deletions(-) diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c index 533c3102..f5a68512 100644 --- a/pango/pango-ot-buffer.c +++ b/pango/pango-ot-buffer.c @@ -207,6 +207,9 @@ pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, static void apply_gpos_ltr (PangoGlyphString *glyphs, hb_glyph_position_t *positions, + gboolean scale, + double xscale, + double yscale, gboolean is_hinted) { int i; @@ -224,6 +227,8 @@ apply_gpos_ltr (PangoGlyphString *glyphs, if (is_hinted) adjustment = PANGO_UNITS_ROUND (adjustment); + if (G_UNLIKELY (scale)) + adjustment *= xscale; if (positions[i].new_advance) glyphs->glyphs[i].geometry.width = adjustment; @@ -241,14 +246,25 @@ apply_gpos_ltr (PangoGlyphString *glyphs, for (j = back; j < i; j++) glyphs->glyphs[i].geometry.x_offset -= glyphs->glyphs[j].geometry.width; - glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6(x_pos); - glyphs->glyphs[i].geometry.y_offset -= PANGO_UNITS_26_6(y_pos); + if (G_UNLIKELY (scale)) + { + glyphs->glyphs[i].geometry.x_offset += xscale * PANGO_UNITS_26_6(x_pos); + glyphs->glyphs[i].geometry.y_offset -= yscale * PANGO_UNITS_26_6(y_pos); + } + else + { + glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6(x_pos); + glyphs->glyphs[i].geometry.y_offset -= PANGO_UNITS_26_6(y_pos); + } } } static void apply_gpos_rtl (PangoGlyphString *glyphs, hb_glyph_position_t *positions, + gboolean scale, + double xscale, + double yscale, gboolean is_hinted) { int i; @@ -268,6 +284,8 @@ apply_gpos_rtl (PangoGlyphString *glyphs, if (is_hinted) adjustment = PANGO_UNITS_ROUND (adjustment); + if (G_UNLIKELY (scale)) + adjustment *= xscale; if (positions[i_rev].new_advance) glyphs->glyphs[i].geometry.width = adjustment; @@ -287,8 +305,16 @@ apply_gpos_rtl (PangoGlyphString *glyphs, for (j = i; j < back; j++) glyphs->glyphs[i].geometry.x_offset += glyphs->glyphs[j].geometry.width; - glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6(x_pos); - glyphs->glyphs[i].geometry.y_offset -= PANGO_UNITS_26_6(y_pos); + if (G_UNLIKELY (scale)) + { + glyphs->glyphs[i].geometry.x_offset += xscale * PANGO_UNITS_26_6(x_pos); + glyphs->glyphs[i].geometry.y_offset -= yscale * PANGO_UNITS_26_6(y_pos); + } + else + { + glyphs->glyphs[i].geometry.x_offset += PANGO_UNITS_26_6(x_pos); + glyphs->glyphs[i].geometry.y_offset -= PANGO_UNITS_26_6(y_pos); + } } } @@ -376,10 +402,28 @@ pango_ot_buffer_output (const PangoOTBuffer *buffer, positions = hb_buffer_get_glyph_positions (buffer->buffer); if (buffer->applied_gpos) { + gboolean scale = FALSE; + double xscale = 1, yscale = 1; + PangoFcFontKey *key = _pango_fc_font_get_font_key (buffer->font); + + /* This is a kludge, and dupped in pango_fc_font_kern_glyphs(). + * Should move the scale factor to PangoFcFont layer. */ + if (key) { + const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key); + PangoMatrix identity = PANGO_MATRIX_INIT; + if (G_UNLIKELY (matrix && 0 != memcmp (&identity, matrix, 4 * sizeof (double)))) + { + scale = TRUE; + pango_matrix_get_font_scale_factors (matrix, &xscale, &yscale); + if (xscale) xscale = 1 / xscale; + if (yscale) yscale = 1 / yscale; + } + } + if (buffer->rtl) - apply_gpos_rtl (glyphs, positions, buffer->font->is_hinted); + apply_gpos_rtl (glyphs, positions, scale, xscale, yscale, buffer->font->is_hinted); else - apply_gpos_ltr (glyphs, positions, buffer->font->is_hinted); + apply_gpos_ltr (glyphs, positions, scale, xscale, yscale, buffer->font->is_hinted); } else { diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c index 8fc5a579..ad234beb 100644 --- a/pango/pangofc-font.c +++ b/pango/pangofc-font.c @@ -807,6 +807,9 @@ pango_fc_font_kern_glyphs (PangoFcFont *font, FT_Vector kerning; int i; gboolean hinting = font->is_hinted; + gboolean scale = FALSE; + double xscale = 1; + PangoFcFontKey *key; g_return_if_fail (PANGO_IS_FC_FONT (font)); g_return_if_fail (glyphs != NULL); @@ -821,6 +824,20 @@ pango_fc_font_kern_glyphs (PangoFcFont *font, return; } + /* This is a kludge, and dupped in pango_ot_buffer_output(). + * Should move the scale factor to PangoFcFont layer. */ + key = _pango_fc_font_get_font_key (font); + if (key) { + const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key); + PangoMatrix identity = PANGO_MATRIX_INIT; + if (G_UNLIKELY (matrix && 0 != memcmp (&identity, matrix, 2 * sizeof (double)))) + { + scale = TRUE; + pango_matrix_get_font_scale_factors (matrix, &xscale, NULL); + if (xscale) xscale = 1 / xscale; + } + } + for (i = 1; i < glyphs->num_glyphs; ++i) { error = FT_Get_Kerning (face, @@ -834,6 +851,8 @@ pango_fc_font_kern_glyphs (PangoFcFont *font, if (hinting) adjustment = PANGO_UNITS_ROUND (adjustment); + if (G_UNLIKELY (scale)) + adjustment *= xscale; glyphs->glyphs[i-1].geometry.width += adjustment; } diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h index 0612a692..e7c08bff 100644 --- a/pango/pangofc-private.h +++ b/pango/pangofc-private.h @@ -93,6 +93,50 @@ void pango_fc_font_get_raw_extents (PangoFcFont *font, PangoFontMetrics *pango_fc_font_create_metrics_for_context (PangoFcFont *font, PangoContext *context); + + +/* To be made public at some point */ + +#include + +static G_GNUC_UNUSED void +pango_matrix_get_font_scale_factors (const PangoMatrix *matrix, + double *xscale, double *yscale) +{ +/* + * Based on cairo-matrix.c:_cairo_matrix_compute_scale_factors() + * + * Copyright 2005, Keith Packard + */ + double major = 0, minor = 0; + + if (matrix) { + double det = matrix->xx * matrix->yy - matrix->yx * matrix->xy; + + if (det) + { + double x = matrix->xx; + double y = matrix->yx; + + major = sqrt (x*x + y*y); + + /* + * ignore mirroring + */ + if (det < 0) + det = - det; + + if (major) + minor = det / major; + } + } + + if (xscale) + *xscale = major; + if (yscale) + *yscale = minor; +} + G_END_DECLS #endif /* __PANGOFC_PRIVATE_H__ */ -- cgit v1.2.1 From df2d2ecbedfcc9fd470313c08f3d7edad148a0d1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Nov 2009 21:09:05 -0500 Subject: Fix pangocairo-fc fontsize weirdness --- pango/pangocairo-fcfont.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c index 3ac166e6..8401ed8d 100644 --- a/pango/pangocairo-fcfont.c +++ b/pango/pangocairo-fcfont.c @@ -166,7 +166,7 @@ get_font_size (const FcPattern *pattern) double dpi; if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &size) == FcResultMatch) - return size * PANGO_SCALE; + return size; /* Just in case FC_PIXEL_SIZE got unset between pango_fc_make_pattern() * and here. That would be very weird. @@ -240,8 +240,7 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap, fc_matrix.yy, 0., 0.); - cairo_matrix_scale (&font_matrix, - size / PANGO_SCALE, size / PANGO_SCALE); + cairo_matrix_scale (&font_matrix, size, size); _pango_cairo_font_private_initialize (&cffont->cf_priv, (PangoCairoFont *) cffont, -- cgit v1.2.1 From 640404de481360206d0c08f7528ff14cf9166814 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Nov 2009 21:38:53 -0500 Subject: Release 1.26.1 --- NEWS | 12 ++++++++++++ configure.in | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index eda0c982..fd6743aa 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +Overview of changes between 1.26.0 and 1.26.1 +============================================= +- Finally fix GPOS positioning and kerning with non-identity cairo matrices +- [HB] Fix lookup_flag ignoring +- Fix leak with non-mmapped fonts +- Allow using uninstalled glib +- Bugs fixed: + Bug 341481 - pangocairo kerning problem with nonidentity scaling + Bug 587768 - [patch] Don't build pango-view twice + Bug 594101 - [Indic] character class data updates to support unicode 5.1 + Bug 596837 - Typo in pango_cairo_show_layout documentation + Overview of changes between 1.25.6 and 1.26.0 ============================================= - New stable release series diff --git a/configure.in b/configure.in index 513665cb..259c0832 100644 --- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ dnl dnl The triplet m4_define([pango_version_major], [1]) m4_define([pango_version_minor], [26]) -m4_define([pango_version_micro], [0]) +m4_define([pango_version_micro], [1]) m4_define([pango_version], [pango_version_major.pango_version_minor.pango_version_micro]) -- cgit v1.2.1 From 27b2a4a4d504d6ba06b8acd91eab17796bc3b3c8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Nov 2009 20:35:07 -0500 Subject: Another C++ strictness fix Pango Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler (Error: A union member cannot have a user-defined assignment operator) According to the bug: C++ Programming Language by Bjarne Stroustrup: Chapter 10.4.12 forbids explicitly using of union members with constructors, destructors or assignment operations. So we use a set() method instead of the assignment operator. Ugly, but hey, that's life. Cherry-pick from harfbuzz-ng repo. --- pango/opentype/hb-open-type-private.hh | 8 ++++---- pango/opentype/hb-ot-layout-common-private.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 4061cfe8..df8d217e 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -258,7 +258,7 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF, #define NEUTER(Var, Val) \ (SANITIZE_OBJ (Var) && \ _hb_sanitize_edit (SANITIZE_ARG, CONST_CHARP(&(Var)), sizeof (Var)) && \ - ((Var) = (Val), true)) + ((Var).set (Val), true)) /* Template to sanitize an object. */ @@ -345,7 +345,7 @@ struct Sanitizer #define _DEFINE_INT_TYPE1_UNALIGNED(NAME, TYPE, BIG_ENDIAN, BYTES) \ struct NAME \ { \ - inline NAME& operator = (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \ + inline NAME& set (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN ((TYPE&) v); } \ inline bool operator== (NAME o) const { return (TYPE&) v == (TYPE&) o.v; } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ @@ -359,7 +359,7 @@ struct Sanitizer #define DEFINE_INT_TYPE1(NAME, TYPE, BIG_ENDIAN, BYTES) \ struct NAME \ { \ - inline NAME& operator = (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \ + inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \ inline bool operator== (NAME o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ @@ -384,7 +384,7 @@ DEFINE_INT_TYPE (LONG, , 32); /* 32-bit signed integer. */ struct Tag : ULONG { inline Tag (const Tag &o) { *(ULONG*)this = (ULONG&) o; } - inline Tag (uint32_t i) { *(ULONG*)this = i; } + inline Tag (uint32_t i) { (*(ULONG*)this).set (i); } inline Tag (const char *c) { *(ULONG*)this = *(ULONG*)c; } inline bool operator== (const char *c) const { return *(ULONG*)this == *(ULONG*)c; } /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index a1e625d9..bb85928c 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -320,7 +320,7 @@ struct CoverageFormat1 if (HB_UNLIKELY (glyph_id > 0xFFFF)) return NOT_COVERED; GlyphID gid; - gid = glyph_id; + gid.set (glyph_id); // TODO: bsearch unsigned int num_glyphs = glyphArray.len; for (unsigned int i = 0; i < num_glyphs; i++) -- cgit v1.2.1 From 29010456474a512c4193f2fec583c2723f3e2806 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Nov 2009 18:20:49 -0500 Subject: Bug 602660 - [HB] don't use flexible arrays Cherry-picked from harfbuzz-ng repo. --- pango/opentype/hb-open-file-private.hh | 4 +- pango/opentype/hb-open-type-private.hh | 36 +++++++----- pango/opentype/hb-ot-layout-common-private.hh | 33 +++++------ pango/opentype/hb-ot-layout-gdef-private.hh | 14 ++--- pango/opentype/hb-ot-layout-gpos-private.hh | 76 ++++++++++--------------- pango/opentype/hb-ot-layout-gsub-private.hh | 44 ++++++-------- pango/opentype/hb-ot-layout-gsubgpos-private.hh | 47 +++++++-------- pango/opentype/hb-private.h | 5 ++ 8 files changed, 122 insertions(+), 137 deletions(-) diff --git a/pango/opentype/hb-open-file-private.hh b/pango/opentype/hb-open-file-private.hh index 47d4e04f..dda6b945 100644 --- a/pango/opentype/hb-open-file-private.hh +++ b/pango/opentype/hb-open-file-private.hh @@ -122,9 +122,9 @@ typedef struct OffsetTable USHORT searchRange; /* (Maximum power of 2 <= numTables) x 16 */ USHORT entrySelector; /* Log2(maximum power of 2 <= numTables). */ USHORT rangeShift; /* NumTables x 16-searchRange. */ - TableDirectory tableDir[]; /* TableDirectory entries. numTables items */ + TableDirectory tableDir[VAR]; /* TableDirectory entries. numTables items */ } OpenTypeFontFace; -ASSERT_SIZE (OffsetTable, 12); +ASSERT_SIZE_VAR (OffsetTable, 12, TableDirectory); /* * TrueType Collections diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index df8d217e..65e4950f 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -50,6 +50,9 @@ #define CONST_NEXT(T,X) (*(reinterpret_cast(CONST_CHARP(&(X)) + (X).get_size ()))) #define NEXT(T,X) (*(reinterpret_cast(CHARP(&(X)) + (X).get_size ()))) +#define CONST_ARRAY_AFTER(T,X) ((reinterpret_cast(CONST_CHARP(&(X)) + sizeof (X)))) +#define ARRAY_AFTER(T,X) ((reinterpret_cast(CHARP(&(X)) + sizeof (X)))) + /* * Class features */ @@ -58,7 +61,7 @@ /* Null objects */ /* Global nul-content Null pool. Enlarge as necessary. */ -static const char NullPool[16] = ""; +static const char NullPool[32] = ""; /* Generic template for nul-content sizeof-sized Null objects. */ template @@ -505,13 +508,16 @@ struct LongOffsetTo : GenericOffsetTo {}; template struct GenericArrayOf { + const Type *const_array(void) const { return CONST_ARRAY_AFTER (Type, len); } + Type *array(void) { return ARRAY_AFTER (Type, len); } + inline const Type& operator [] (unsigned int i) const { if (HB_UNLIKELY (i >= len)) return Null(Type); - return array[i]; + return const_array()[i]; } inline unsigned int get_size () const - { return sizeof (len) + len * sizeof (array[0]); } + { return sizeof (len) + len * sizeof (Type); } inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); @@ -523,7 +529,7 @@ struct GenericArrayOf return true; unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (!SANITIZE (array[i])) + if (!SANITIZE (array()[i])) return false; return true; } @@ -532,7 +538,7 @@ struct GenericArrayOf if (!SANITIZE_GET_SIZE()) return false; unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (!array[i].sanitize (SANITIZE_ARG, base)) + if (!array()[i].sanitize (SANITIZE_ARG, base)) return false; return true; } @@ -541,7 +547,7 @@ struct GenericArrayOf if (!SANITIZE_GET_SIZE()) return false; unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (!array[i].sanitize (SANITIZE_ARG, base, base2)) + if (!array()[i].sanitize (SANITIZE_ARG, base, base2)) return false; return true; } @@ -550,13 +556,13 @@ struct GenericArrayOf if (!SANITIZE_GET_SIZE()) return false; unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (!array[i].sanitize (SANITIZE_ARG, base, user_data)) + if (!array()[i].sanitize (SANITIZE_ARG, base, user_data)) return false; return true; } LenType len; - Type array[]; +/*Type array[VAR];*/ }; /* An array with a USHORT number of elements. */ @@ -586,7 +592,7 @@ struct OffsetListOf : OffsetArrayOf inline const Type& operator [] (unsigned int i) const { if (HB_UNLIKELY (i >= this->len)) return Null(Type); - return this+this->array[i]; + return this+this->const_array()[i]; } inline bool sanitize (SANITIZE_ARG_DEF) { @@ -605,13 +611,16 @@ struct OffsetListOf : OffsetArrayOf template struct HeadlessArrayOf { + const Type *const_array(void) const { return CONST_ARRAY_AFTER (Type, len); } + Type *array(void) { return ARRAY_AFTER (Type, len); } + inline const Type& operator [] (unsigned int i) const { if (HB_UNLIKELY (i >= len || !i)) return Null(Type); - return array[i-1]; + return const_array()[i-1]; } inline unsigned int get_size () const - { return sizeof (len) + (len ? len - 1 : 0) * sizeof (array[0]); } + { return sizeof (len) + (len ? len - 1 : 0) * sizeof (Type); } inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); @@ -622,14 +631,15 @@ struct HeadlessArrayOf * do have a simple sanitize(). */ return true; unsigned int count = len ? len - 1 : 0; + Type *a = array(); for (unsigned int i = 0; i < count; i++) - if (!SANITIZE (array[i])) + if (!SANITIZE (a[i])) return false; return true; } USHORT len; - Type array[]; +/*Type array[VAR];*/ }; diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index bb85928c..70c8774a 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -67,14 +67,15 @@ struct RecordArrayOf : ArrayOf > { inline const Tag& get_tag (unsigned int i) const { if (HB_UNLIKELY (i >= this->len)) return Null(Tag); - return this->array[i].tag; + return (*this)[i].tag; } inline bool get_tags (unsigned int *record_count /* IN/OUT */, hb_tag_t *record_tags /* OUT */) const { + const Record *a = this->const_array(); unsigned int count = MIN (this->len, *record_count); for (unsigned int i = 0; i < count; i++) - record_tags[i] = this->array[i].tag; + record_tags[i] = a[i].tag; *record_count = this->len; return !!this->len; @@ -83,10 +84,11 @@ struct RecordArrayOf : ArrayOf > { { const Tag t = tag; // TODO bsearch + const Record *a = this->const_array(); unsigned int count = this->len; for (unsigned int i = 0; i < count; i++) { - if (t == this->array[i].tag) + if (t == a[i].tag) { if (index) *index = i; return true; @@ -116,14 +118,15 @@ struct IndexArray : ArrayOf { if (HB_UNLIKELY (i >= this->len)) return NO_INDEX; - return this->array[i]; + return this->const_array()[i]; } inline bool get_indexes (unsigned int *_count /* IN/OUT */, unsigned int *_indexes /* OUT */) const { unsigned int count = MIN (this->len, *_count); + const USHORT *a = this->const_array(); for (unsigned int i = 0; i < count; i++) - _indexes[i] = this->array[i]; + _indexes[i] = a[i]; *_count = this->len; return !!this->len; @@ -283,7 +286,7 @@ struct Lookup inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); - if (!(SANITIZE_SELF () && SANITIZE_THIS (subTable))) return false; + if (!(SANITIZE (lookupType) && SANITIZE (lookupFlag) && SANITIZE_THIS (subTable))) return false; if (HB_UNLIKELY (lookupFlag & LookupFlag::UseMarkFilteringSet)) { USHORT &markFilteringSet = NEXT (USHORT, subTable); @@ -296,11 +299,11 @@ struct Lookup USHORT lookupFlag; /* Lookup qualifiers */ OffsetArrayOf subTable; /* Array of SubTables */ - USHORT markFilteringSetX[0]; /* Index (base 0) into GDEF mark glyph sets + USHORT markFilteringSetX[VAR]; /* Index (base 0) into GDEF mark glyph sets * structure. This field is only present if bit * UseMarkFilteringSet of lookup flags is set. */ }; -ASSERT_SIZE (Lookup, 6); +ASSERT_SIZE_VAR (Lookup, 6, USHORT); typedef OffsetListOf LookupList; ASSERT_SIZE (LookupList, 2); @@ -425,11 +428,10 @@ struct Coverage private: union { USHORT format; /* Format identifier */ - CoverageFormat1 format1[]; - CoverageFormat2 format2[]; + CoverageFormat1 format1[VAR]; + CoverageFormat2 format2[VAR]; } u; }; -ASSERT_SIZE (Coverage, 2); /* @@ -541,11 +543,10 @@ struct ClassDef private: union { USHORT format; /* Format identifier */ - ClassDefFormat1 format1[]; - ClassDefFormat2 format2[]; + ClassDefFormat1 format1[VAR]; + ClassDefFormat2 format2[VAR]; } u; }; -ASSERT_SIZE (ClassDef, 2); /* @@ -595,9 +596,9 @@ struct Device USHORT startSize; /* Smallest size to correct--in ppem */ USHORT endSize; /* Largest size to correct--in ppem */ USHORT deltaFormat; /* Format of DeltaValue array data: 1, 2, or 3 */ - USHORT deltaValue[]; /* Array of compressed data */ + USHORT deltaValue[VAR]; /* Array of compressed data */ }; -ASSERT_SIZE (Device, 6); +ASSERT_SIZE_VAR (Device, 6, USHORT); #endif /* HB_OT_LAYOUT_COMMON_PRIVATE_HH */ diff --git a/pango/opentype/hb-ot-layout-gdef-private.hh b/pango/opentype/hb-ot-layout-gdef-private.hh index 1eb96c0d..69f90fec 100644 --- a/pango/opentype/hb-ot-layout-gdef-private.hh +++ b/pango/opentype/hb-ot-layout-gdef-private.hh @@ -177,12 +177,11 @@ struct CaretValue private: union { USHORT format; /* Format identifier */ - CaretValueFormat1 format1[]; - CaretValueFormat2 format2[]; - CaretValueFormat3 format3[]; + CaretValueFormat1 format1[VAR]; + CaretValueFormat2 format2[VAR]; + CaretValueFormat3 format3[VAR]; } u; }; -ASSERT_SIZE (CaretValue, 2); struct LigGlyph { @@ -286,10 +285,9 @@ struct MarkGlyphSets private: union { USHORT format; /* Format identifier */ - MarkGlyphSetsFormat1 format1[]; + MarkGlyphSetsFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (MarkGlyphSets, 2); /* @@ -364,12 +362,12 @@ struct GDEF * mark attachment type--from beginning * of GDEF header (may be Null) */ OffsetTo - markGlyphSetsDef[0]; /* Offset to the table of mark set + markGlyphSetsDef[VAR]; /* Offset to the table of mark set * definitions--from beginning of GDEF * header (may be NULL). Introduced * in version 00010002. */ }; -ASSERT_SIZE (GDEF, 12); +ASSERT_SIZE_VAR (GDEF, 12, OffsetTo); #endif /* HB_OT_LAYOUT_GDEF_PRIVATE_HH */ diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index 609ebe78..2ab079f9 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -35,8 +35,8 @@ typedef SHORT Value; -typedef Value ValueRecord[0]; -ASSERT_SIZE (ValueRecord, 0); +typedef Value ValueRecord[VAR]; +ASSERT_SIZE_VAR (ValueRecord, 0, Value); struct ValueFormat : USHORT { @@ -259,12 +259,11 @@ struct Anchor private: union { USHORT format; /* Format identifier */ - AnchorFormat1 format1[]; - AnchorFormat2 format2[]; - AnchorFormat3 format3[]; + AnchorFormat1 format1[VAR]; + AnchorFormat2 format2[VAR]; + AnchorFormat3 format3[VAR]; } u; }; -ASSERT_SIZE (Anchor, 2); struct AnchorMatrix @@ -287,10 +286,10 @@ struct AnchorMatrix USHORT rows; /* Number of rows */ private: OffsetTo - matrix[]; /* Matrix of offsets to Anchor tables-- + matrix[VAR]; /* Matrix of offsets to Anchor tables-- * from beginning of AnchorMatrix table */ }; -ASSERT_SIZE (AnchorMatrix, 2); +ASSERT_SIZE_VAR (AnchorMatrix, 2, OffsetTo); struct MarkRecord @@ -389,7 +388,7 @@ struct SinglePosFormat1 * value(s)--applied to all glyphs in * the Coverage table */ }; -ASSERT_SIZE (SinglePosFormat1, 6); +ASSERT_SIZE_VAR (SinglePosFormat1, 6, ValueRecord); struct SinglePosFormat2 { @@ -431,7 +430,7 @@ struct SinglePosFormat2 ValueRecord values; /* Array of ValueRecords--positioning * values applied to glyphs */ }; -ASSERT_SIZE (SinglePosFormat2, 8); +ASSERT_SIZE_VAR (SinglePosFormat2, 8, ValueRecord); struct SinglePos { @@ -461,11 +460,10 @@ struct SinglePos private: union { USHORT format; /* Format identifier */ - SinglePosFormat1 format1[]; - SinglePosFormat2 format2[]; + SinglePosFormat1 format1[VAR]; + SinglePosFormat2 format2[VAR]; } u; }; -ASSERT_SIZE (SinglePos, 2); struct PairValueRecord @@ -479,7 +477,7 @@ struct PairValueRecord ValueRecord values; /* Positioning data for the first glyph * followed by for second glyph */ }; -ASSERT_SIZE (PairValueRecord, 2); +ASSERT_SIZE_VAR (PairValueRecord, 2, ValueRecord); struct PairSet { @@ -495,10 +493,10 @@ struct PairSet private: USHORT len; /* Number of PairValueRecords */ PairValueRecord - array[]; /* Array of PairValueRecords--ordered + array[VAR]; /* Array of PairValueRecords--ordered * by GlyphID of the second glyph */ }; -ASSERT_SIZE (PairSet, 2); +ASSERT_SIZE_VAR (PairSet, 2, PairValueRecord); struct PairPosFormat1 { @@ -654,7 +652,7 @@ struct PairPosFormat2 * class1-major, class2-minor, * Each entry has value1 and value2 */ }; -ASSERT_SIZE (PairPosFormat2, 16); +ASSERT_SIZE_VAR (PairPosFormat2, 16, ValueRecord); struct PairPos { @@ -684,11 +682,10 @@ struct PairPos private: union { USHORT format; /* Format identifier */ - PairPosFormat1 format1[]; - PairPosFormat2 format2[]; + PairPosFormat1 format1[VAR]; + PairPosFormat2 format2[VAR]; } u; }; -ASSERT_SIZE (PairPos, 2); struct EntryExitRecord @@ -931,17 +928,15 @@ struct CursivePos private: union { USHORT format; /* Format identifier */ - CursivePosFormat1 format1[]; + CursivePosFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (CursivePos, 2); typedef AnchorMatrix BaseArray; /* base-major-- * in order of BaseCoverage Index--, * mark-minor-- * ordered by class--zero-based. */ -ASSERT_SIZE (BaseArray, 2); struct MarkBasePosFormat1 { @@ -1027,23 +1022,20 @@ struct MarkBasePos private: union { USHORT format; /* Format identifier */ - MarkBasePosFormat1 format1[]; + MarkBasePosFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (MarkBasePos, 2); typedef AnchorMatrix LigatureAttach; /* component-major-- * in order of writing direction--, * mark-minor-- * ordered by class--zero-based. */ -ASSERT_SIZE (LigatureAttach, 2); typedef OffsetListOf LigatureArray; /* Array of LigatureAttach * tables ordered by * LigatureCoverage Index */ -ASSERT_SIZE (LigatureArray, 2); struct MarkLigPosFormat1 { @@ -1152,17 +1144,15 @@ struct MarkLigPos private: union { USHORT format; /* Format identifier */ - MarkLigPosFormat1 format1[]; + MarkLigPosFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (MarkLigPos, 2); typedef AnchorMatrix Mark2Array; /* mark2-major-- * in order of Mark2Coverage Index--, * mark1-minor-- * ordered by class--zero-based. */ -ASSERT_SIZE (Mark2Array, 2); struct MarkMarkPosFormat1 { @@ -1253,10 +1243,9 @@ struct MarkMarkPos private: union { USHORT format; /* Format identifier */ - MarkMarkPosFormat1 format1[]; + MarkMarkPosFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (MarkMarkPos, 2); static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index); @@ -1272,7 +1261,6 @@ struct ContextPos : Context return Context::apply (APPLY_ARG, position_lookup); } }; -ASSERT_SIZE (ContextPos, 2); struct ChainContextPos : ChainContext { @@ -1285,7 +1273,6 @@ struct ChainContextPos : ChainContext return ChainContext::apply (APPLY_ARG, position_lookup); } }; -ASSERT_SIZE (ChainContextPos, 2); struct ExtensionPos : Extension @@ -1300,7 +1287,6 @@ struct ExtensionPos : Extension inline bool sanitize (SANITIZE_ARG_DEF); }; -ASSERT_SIZE (ExtensionPos, 2); @@ -1362,18 +1348,17 @@ struct PosLookupSubTable private: union { USHORT format; - SinglePos single[]; - PairPos pair[]; - CursivePos cursive[]; - MarkBasePos markBase[]; - MarkLigPos markLig[]; - MarkMarkPos markMark[]; - ContextPos context[]; - ChainContextPos chainContext[]; - ExtensionPos extension[]; + SinglePos single[VAR]; + PairPos pair[VAR]; + CursivePos cursive[VAR]; + MarkBasePos markBase[VAR]; + MarkLigPos markLig[VAR]; + MarkMarkPos markMark[VAR]; + ContextPos context[VAR]; + ChainContextPos chainContext[VAR]; + ExtensionPos extension[VAR]; } u; }; -ASSERT_SIZE (PosLookupSubTable, 2); struct PosLookup : Lookup @@ -1462,7 +1447,6 @@ struct PosLookup : Lookup return SANITIZE_THIS (list); } }; -ASSERT_SIZE (PosLookup, 6); typedef OffsetListOf PosLookupList; ASSERT_SIZE (PosLookupList, 2); diff --git a/pango/opentype/hb-ot-layout-gsub-private.hh b/pango/opentype/hb-ot-layout-gsub-private.hh index bd29cf74..dde1cf5a 100644 --- a/pango/opentype/hb-ot-layout-gsub-private.hh +++ b/pango/opentype/hb-ot-layout-gsub-private.hh @@ -141,11 +141,10 @@ struct SingleSubst private: union { USHORT format; /* Format identifier */ - SingleSubstFormat1 format1[]; - SingleSubstFormat2 format2[]; + SingleSubstFormat1 format1[VAR]; + SingleSubstFormat2 format2[VAR]; } u; }; -ASSERT_SIZE (SingleSubst, 2); struct Sequence @@ -160,7 +159,7 @@ struct Sequence return false; _hb_buffer_add_output_glyphs (buffer, 1, - substitute.len, (const uint16_t *) substitute.array, + substitute.len, (const uint16_t *) substitute.const_array(), 0xFFFF, 0xFFFF); /* This is a guess only ... */ @@ -249,10 +248,9 @@ struct MultipleSubst private: union { USHORT format; /* Format identifier */ - MultipleSubstFormat1 format1[]; + MultipleSubstFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (MultipleSubst, 2); typedef ArrayOf AlternateSet; /* Array of alternate GlyphIDs--in @@ -345,10 +343,9 @@ struct AlternateSubst private: union { USHORT format; /* Format identifier */ - AlternateSubstFormat1 format1[]; + AlternateSubstFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (AlternateSubst, 2); struct Ligature @@ -531,10 +528,9 @@ struct LigatureSubst private: union { USHORT format; /* Format identifier */ - LigatureSubstFormat1 format1[]; + LigatureSubstFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (LigatureSubst, 2); @@ -551,7 +547,6 @@ struct ContextSubst : Context return Context::apply (APPLY_ARG, substitute_lookup); } }; -ASSERT_SIZE (ContextSubst, 2); struct ChainContextSubst : ChainContext { @@ -564,7 +559,6 @@ struct ChainContextSubst : ChainContext return ChainContext::apply (APPLY_ARG, substitute_lookup); } }; -ASSERT_SIZE (ChainContextSubst, 2); struct ExtensionSubst : Extension @@ -579,7 +573,6 @@ struct ExtensionSubst : Extension inline bool sanitize (SANITIZE_ARG_DEF); }; -ASSERT_SIZE (ExtensionSubst, 2); struct ReverseChainSingleSubstFormat1 @@ -601,10 +594,10 @@ struct ReverseChainSingleSubstFormat1 const ArrayOf &substitute = CONST_NEXT (ArrayOf, lookahead); if (match_backtrack (APPLY_ARG, - backtrack.len, (USHORT *) backtrack.array, + backtrack.len, (USHORT *) backtrack.const_array(), match_coverage, DECONST_CHARP(this)) && match_lookahead (APPLY_ARG, - lookahead.len, (USHORT *) lookahead.array, + lookahead.len, (USHORT *) lookahead.const_array(), match_coverage, DECONST_CHARP(this), 1)) { @@ -672,10 +665,9 @@ struct ReverseChainSingleSubst private: union { USHORT format; /* Format identifier */ - ReverseChainSingleSubstFormat1 format1[]; + ReverseChainSingleSubstFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (ReverseChainSingleSubst, 2); @@ -733,17 +725,16 @@ struct SubstLookupSubTable private: union { USHORT format; - SingleSubst single[]; - MultipleSubst multiple[]; - AlternateSubst alternate[]; - LigatureSubst ligature[]; - ContextSubst context[]; - ChainContextSubst chainContext[]; - ExtensionSubst extension[]; - ReverseChainSingleSubst reverseChainContextSingle[]; + SingleSubst single[VAR]; + MultipleSubst multiple[VAR]; + AlternateSubst alternate[VAR]; + LigatureSubst ligature[VAR]; + ContextSubst context[VAR]; + ChainContextSubst chainContext[VAR]; + ExtensionSubst extension[VAR]; + ReverseChainSingleSubst reverseChainContextSingle[VAR]; } u; }; -ASSERT_SIZE (SubstLookupSubTable, 2); struct SubstLookup : Lookup @@ -846,7 +837,6 @@ struct SubstLookup : Lookup return SANITIZE_THIS (list); } }; -ASSERT_SIZE (SubstLookup, 6); typedef OffsetListOf SubstLookupList; ASSERT_SIZE (SubstLookupList, 2); diff --git a/pango/opentype/hb-ot-layout-gsubgpos-private.hh b/pango/opentype/hb-ot-layout-gsubgpos-private.hh index 8b9b1cd4..91703da3 100644 --- a/pango/opentype/hb-ot-layout-gsubgpos-private.hh +++ b/pango/opentype/hb-ot-layout-gsubgpos-private.hh @@ -307,7 +307,7 @@ struct Rule public: inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); - if (!SANITIZE_SELF ()) return false; + if (!(SANITIZE (inputCount) && SANITIZE (lookupCount))) return false; return SANITIZE_MEM (input, sizeof (input[0]) * inputCount + sizeof (lookupRecordX[0]) * lookupCount); @@ -318,12 +318,12 @@ struct Rule * glyph sequence--includes the first * glyph */ USHORT lookupCount; /* Number of LookupRecords */ - USHORT input[]; /* Array of match inputs--start with + USHORT input[VAR]; /* Array of match inputs--start with * second glyph */ - LookupRecord lookupRecordX[]; /* Array of LookupRecords--in + LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in * design order */ }; -ASSERT_SIZE (Rule, 4); +ASSERT_SIZE_VAR2 (Rule, 4, USHORT, LookupRecord); struct RuleSet { @@ -473,12 +473,12 @@ struct ContextFormat3 * sequence */ USHORT lookupCount; /* Number of LookupRecords */ OffsetTo - coverage[]; /* Array of offsets to Coverage + coverage[VAR]; /* Array of offsets to Coverage * table in glyph sequence order */ - LookupRecord lookupRecordX[]; /* Array of LookupRecords--in + LookupRecord lookupRecordX[VAR]; /* Array of LookupRecords--in * design order */ }; -ASSERT_SIZE (ContextFormat3, 6); +ASSERT_SIZE_VAR2 (ContextFormat3, 6, OffsetTo, LookupRecord); struct Context { @@ -508,12 +508,11 @@ struct Context private: union { USHORT format; /* Format identifier */ - ContextFormat1 format1[]; - ContextFormat2 format2[]; - ContextFormat3 format3[]; + ContextFormat1 format1[VAR]; + ContextFormat2 format2[VAR]; + ContextFormat3 format3[VAR]; } u; }; -ASSERT_SIZE (Context, 2); /* Chaining Contextual lookups */ @@ -572,10 +571,10 @@ struct ChainRule const ArrayOf &lookahead = CONST_NEXT (ArrayOf, input); const ArrayOf &lookup = CONST_NEXT (ArrayOf, lookahead); return chain_context_lookup (APPLY_ARG, - backtrack.len, backtrack.array, - input.len, input.array, - lookahead.len, lookahead.array, - lookup.len, lookup.array, + backtrack.len, backtrack.const_array(), + input.len, input.const_array(), + lookahead.len, lookahead.const_array(), + lookup.len, lookup.const_array(), lookup_context); return false; } @@ -754,10 +753,10 @@ struct ChainContextFormat3 {DECONST_CHARP(this), DECONST_CHARP(this), DECONST_CHARP(this)} }; return chain_context_lookup (APPLY_ARG, - backtrack.len, (USHORT *) backtrack.array, - input.len, (USHORT *) input.array + 1, - lookahead.len, (USHORT *) lookahead.array, - lookup.len, lookup.array, + backtrack.len, (const USHORT *) backtrack.const_array(), + input.len, (const USHORT *) input.const_array() + 1, + lookahead.len, (const USHORT *) lookahead.const_array(), + lookup.len, lookup.const_array(), lookup_context); return false; } @@ -821,12 +820,11 @@ struct ChainContext private: union { USHORT format; /* Format identifier */ - ChainContextFormat1 format1[]; - ChainContextFormat2 format2[]; - ChainContextFormat3 format3[]; + ChainContextFormat1 format1[VAR]; + ChainContextFormat2 format2[VAR]; + ChainContextFormat3 format3[VAR]; } u; }; -ASSERT_SIZE (ChainContext, 2); struct ExtensionFormat1 @@ -889,10 +887,9 @@ struct Extension private: union { USHORT format; /* Format identifier */ - ExtensionFormat1 format1[]; + ExtensionFormat1 format1[VAR]; } u; }; -ASSERT_SIZE (Extension, 2); /* diff --git a/pango/opentype/hb-private.h b/pango/opentype/hb-private.h index 8d885aa4..ea29e74a 100644 --- a/pango/opentype/hb-private.h +++ b/pango/opentype/hb-private.h @@ -130,6 +130,11 @@ typedef GStaticMutex hb_mutex_t; #define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size)) +#define VAR 1 /* Size signifying variable-sized array */ +#define ASSERT_SIZE_VAR(_type, _size, _var_type) \ + ASSERT_STATIC (sizeof (_type) == (_size) + VAR * sizeof (_var_type)) +#define ASSERT_SIZE_VAR2(_type, _size, _var_type1, _var_type2) \ + ASSERT_STATIC (sizeof (_type) == (_size) + VAR * sizeof (_var_type1) + VAR * sizeof (_var_type2)) #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) #define _HB_BOOLEAN_EXPR(expr) \ -- cgit v1.2.1 From 40bade07f999a0535e0cbc8c2afe45d44e92a663 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Nov 2009 18:23:35 -0500 Subject: Fix MarkMark issue with ligid and components Cherry-picked from harfbuzz-ng repo. --- pango/opentype/hb-ot-layout-gpos-private.hh | 11 ++++++----- pango/opentype/hb-ot-layout-gsub-private.hh | 6 +----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index 2ab079f9..81b7fa15 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -1080,9 +1080,9 @@ struct MarkLigPosFormat1 * is identical to the ligature ID of the found ligature. If yes, we * can directly use the component index. If not, we attach the mark * glyph to the last component of the ligature. */ - if (IN_LIGID (j) == IN_LIGID (buffer->in_pos)) + if (IN_LIGID (j) && IN_LIGID (j) == IN_LIGID (buffer->in_pos) && IN_COMPONENT (buffer->in_pos)) { - comp_index = IN_COMPONENT (buffer->in_pos); + comp_index = IN_COMPONENT (buffer->in_pos) - 1; if (comp_index >= comp_count) comp_index = comp_count - 1; } @@ -1179,9 +1179,10 @@ struct MarkMarkPosFormat1 return false; /* Two marks match only if they belong to the same base, or same component - * of the same ligature. */ - if (IN_LIGID (j) != IN_LIGID (buffer->in_pos) || - IN_COMPONENT (j) != IN_COMPONENT (buffer->in_pos)) + * of the same ligature. That is, the component numbers must match, and + * if those are non-zero, the ligid number should also match. */ + if ((IN_COMPONENT (j) != IN_COMPONENT (buffer->in_pos)) || + (IN_COMPONENT (j) && IN_LIGID (j) != IN_LIGID (buffer->in_pos))) return false; unsigned int mark2_index = (this+mark2Coverage) (IN_GLYPH (j)); diff --git a/pango/opentype/hb-ot-layout-gsub-private.hh b/pango/opentype/hb-ot-layout-gsub-private.hh index dde1cf5a..75ca150b 100644 --- a/pango/opentype/hb-ot-layout-gsub-private.hh +++ b/pango/opentype/hb-ot-layout-gsub-private.hh @@ -406,14 +406,10 @@ struct Ligature for ( i = 1; i < count; i++ ) { while (_hb_ot_layout_skip_mark (context->face, IN_CURINFO (), lookup_flag, NULL)) - _hb_buffer_add_output_glyph (buffer, IN_CURGLYPH (), i - 1, lig_id); + _hb_buffer_add_output_glyph (buffer, IN_CURGLYPH (), i, lig_id); (buffer->in_pos)++; } - - /* TODO We should possibly reassign lig_id and component for any - * components of a previous ligature that s now being removed as part of - * this ligature. */ } return true; -- cgit v1.2.1 From b685d25141ba069d2494b17fada2ecedd6dd0df5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 22 Nov 2009 18:24:54 -0500 Subject: [GSUB] More ligature/component fixing We can only reuse the ligid if it belongs to a previous ligature, not a component! Cherry-picked from harfbuzz-ng repo. --- pango/opentype/hb-ot-layout-gsub-private.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/opentype/hb-ot-layout-gsub-private.hh b/pango/opentype/hb-ot-layout-gsub-private.hh index 75ca150b..d35aaff1 100644 --- a/pango/opentype/hb-ot-layout-gsub-private.hh +++ b/pango/opentype/hb-ot-layout-gsub-private.hh @@ -388,8 +388,8 @@ struct Ligature glyphs and the ligature already has an ID. */ _hb_buffer_add_output_glyphs (buffer, i, 1, (const uint16_t *) &ligGlyph, - 0xFFFF, - IN_LIGID (buffer->in_pos) ? + 0, + IN_LIGID (buffer->in_pos) && !IN_COMPONENT (buffer->in_pos) ? 0xFFFF : _hb_buffer_allocate_lig_id (buffer)); else { -- cgit v1.2.1 From 1a6d89b217fb259f91f8661351336cec651c55e3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 25 Nov 2009 19:49:44 -0500 Subject: Bug 602823 - void function cannot return value --- pango/glyphstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/glyphstring.c b/pango/glyphstring.c index 0382eb6e..dedd822c 100644 --- a/pango/glyphstring.c +++ b/pango/glyphstring.c @@ -347,7 +347,7 @@ pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs, NULL}}; PangoGlyphItem glyph_item = {&item, glyphs}; - return pango_glyph_item_get_logical_widths (&glyph_item, text, logical_widths); + pango_glyph_item_get_logical_widths (&glyph_item, text, logical_widths); } /* The initial implementation here is script independent, -- cgit v1.2.1 From 20889f065700ef005b1016729e9c26e078ef9e8a Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Sun, 6 Dec 2009 20:53:20 +0100 Subject: Do not multiply return value of CTFontGetDescent with -1 The return value of CTFontGetDescent is already positive, as opposed to the ats_metrics.descent value used before. This is a regression introduced by the previous patch "porting" the backend to CoreText, which also broke support for Tiger and earlier -- we will fix that soonish. --- pango/pangocairo-atsuifont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c index 21472440..91391e7e 100644 --- a/pango/pangocairo-atsuifont.c +++ b/pango/pangocairo-atsuifont.c @@ -134,7 +134,7 @@ pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, metrics = pango_font_metrics_new (); metrics->ascent = CTFontGetAscent(ct_font) * PANGO_SCALE; - metrics->descent = -CTFontGetDescent(ct_font) * PANGO_SCALE; + metrics->descent = CTFontGetDescent(ct_font) * PANGO_SCALE; metrics->underline_position = CTFontGetUnderlinePosition(ct_font) * PANGO_SCALE; metrics->underline_thickness = CTFontGetUnderlineThickness(ct_font) * PANGO_SCALE; -- cgit v1.2.1 From 3230261dd6f856b77688cad7c40b7b83b63c17ed Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 Nov 2009 11:20:48 -0500 Subject: Simplify make rules --- pango/Makefile.am | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pango/Makefile.am b/pango/Makefile.am index 3480af04..cff1de1a 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -131,8 +131,7 @@ pangoinclude_HEADERS = \ pango-enum-types.h pango-enum-types.h: s-enum-types-h - $(AM_V_GEN) true -s-enum-types-h: $(pango_headers) Makefile +s-enum-types-h: $(pango_headers) Makefile.am $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#ifndef __PANGO_ENUM_TYPES_H__\n#define __PANGO_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ @@ -144,8 +143,7 @@ s-enum-types-h: $(pango_headers) Makefile && echo timestamp > $(@F) pango-enum-types.c: s-enum-types-c - $(AM_V_GEN) true -s-enum-types-c: $(pango_headers) Makefile +s-enum-types-c: $(pango_headers) Makefile.am $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#include " \ --fprod "\n/* enumerations from \"@filename@\" */" \ -- cgit v1.2.1 From ee573c4e722c8ef7aff41c6cc98eaeab1ac57aec Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 14 Dec 2009 15:42:50 -0500 Subject: Release 1.26.2 --- NEWS | 9 +++++++++ configure.in | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fd6743aa..a82f56c0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +Overview of changes between 1.26.1 and 1.26.2 +============================================= +- Fix non-standard C++ usage +- Fix OpenType mark ligation +- Bugs fixed: + Bug 602823 - void function cannot return value + Bug 602660 - [HB] don't use flexible arrays + Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler + Overview of changes between 1.26.0 and 1.26.1 ============================================= - Finally fix GPOS positioning and kerning with non-identity cairo matrices diff --git a/configure.in b/configure.in index 259c0832..751a320e 100644 --- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ dnl dnl The triplet m4_define([pango_version_major], [1]) m4_define([pango_version_minor], [26]) -m4_define([pango_version_micro], [1]) +m4_define([pango_version_micro], [2]) m4_define([pango_version], [pango_version_major.pango_version_minor.pango_version_micro]) -- cgit v1.2.1 From aad6150aa47601dcc1c3aa7766dec828197b5919 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Wed, 16 Dec 2009 17:51:45 -0200 Subject: Pass in --enable-introspection to distcheck https://bugzilla.gnome.org/show_bug.cgi?id=604770 --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 01aa688f..8b0889f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -98,6 +98,6 @@ if HAVE_WIN32 pkgconfig_DATA += pangowin32.pc endif -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references --enable-introspection -include $(top_srcdir)/git.mk -- cgit v1.2.1 From f9adbd0a57b3f43451e6d1e05d75c96fd116c7ec Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Wed, 16 Dec 2009 17:53:29 -0200 Subject: Use Makefile.introspection To simplify the introspection scanner/compiler build rules. This also changes to the girs are included in the dist. https://bugzilla.gnome.org/show_bug.cgi?id=604770 --- pango/Makefile.am | 145 ++++++++++++++++++++++-------------------------------- 1 file changed, 59 insertions(+), 86 deletions(-) diff --git a/pango/Makefile.am b/pango/Makefile.am index cff1de1a..fb05d0ba 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -4,12 +4,17 @@ # which are more like other make's VPATH. GPATH = $(srcdir) +include $(INTROSPECTION_MAKEFILE) + +INTROSPECTION_GIRS = +INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --add-include-path=. +INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=. + if HAVE_FREETYPE OPENTYPE_SUBDIR=opentype endif EXTRA_DIST = -BUILT_GIRSOURCES = FRIBIDI_SUBDIR=mini-fribidi @@ -43,7 +48,7 @@ endif # ------------------- libpango ------------------- lib_LTLIBRARIES = libpango-1.0.la -BUILT_GIRSOURCES += Pango-1.0.gir +INTROSPECTION_GIRS += Pango-1.0.gir libpango_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) libpango_1_0_la_LIBADD = \ @@ -158,25 +163,17 @@ s-enum-types-c: $(pango_headers) Makefile.am pango-features.h: $(AM_V_GEN) cd $(top_builddir) && ./config.status pango/pango-features.h -Pango-1.0.gir: $(libpango_1_0_la_SOURCES) -Pango-1.0.gir: $(pango_headers) -Pango-1.0.gir: libpango-1.0.la -Pango-1.0.gir: $(G_IR_SCANNER) Makefile - $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace Pango --nsversion=1.0 \ - --add-include-path=$(srcdir) --add-include-path=. \ - --include=GObject-2.0 \ - --include=cairo-1.0 \ - --library=libpango-1.0.la \ - --libtool="$(LIBTOOL)" \ - --output $@ \ - --pkg gobject-2.0 \ - --pkg cairo \ - --pkg freetype2 \ - -I$(top_srcdir) \ - $(PANGO_CFLAGS) \ - $(libpango_1_0_la_SOURCES) \ +pango_introspection_files = \ + $(libpango_1_0_la_SOURCES) \ $(pango_headers) \ - pango-enum-types.h + pango-enum-types.h +Pango-1.0.gir: libpango-1.0.la + +Pango_1_0_gir_PACKAGES = gobject-2.0 cairo freetype2 +Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 +Pango_1_0_gir_LIBS = libpango-1.0.la +Pango_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) +Pango_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pango_introspection_files)) # ------------------- libpangox ------------------- @@ -222,7 +219,7 @@ libpangox_1_0_la_SOURCES = \ if HAVE_FREETYPE pangoinclude_HEADERS += $(pangoft2_headers) lib_LTLIBRARIES += libpangoft2-1.0.la -BUILT_GIRSOURCES += PangoFT2-1.0.gir +INTROSPECTION_GIRS += PangoFT2-1.0.gir endif pangoft2_headers = \ @@ -273,32 +270,25 @@ endif pangoft2-win32-res.o: pangoft2.rc $(AM_V_GEN) $(WINDRES) $< $@ -PangoFT2-1.0.gir: $(pangoft2_headers) -PangoFT2-1.0.gir: $(libpangoft2_1_0_la_SOURCES) +pangoft2_introspection_files = \ + $(pangoft2_headers) \ + $(pangoft2_public_sources) + PangoFT2-1.0.gir: libpangoft2-1.0.la -PangoFT2-1.0.gir: Pango-1.0.gir $(G_IR_SCANNER) Makefile - $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace PangoFT2 --nsversion=1.0 \ - --add-include-path=$(srcdir) --add-include-path=. \ - --include=GObject-2.0 \ - --include=Pango-1.0 \ - --include=freetype2-2.0 \ - --include=fontconfig-2.0 \ - --library=libpangoft2-1.0.la \ - --libtool="$(LIBTOOL)" \ - --output $@ \ - --pkg gobject-2.0 \ - --pkg freetype2 \ - --pkg pangoft2 \ - -I$(top_srcdir) \ - $(pangoft2_headers) \ - $(pangoft2_public_sources) +PangoFT2-1.0.gir: Pango-1.0.gir + +PangoFT2_1_0_gir_PACKAGES = gobject-2.0 freetype2 pangoft2 +PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 freetype2-2.0 fontconfig-2.0 +PangoFT2_1_0_gir_LIBS = libpangoft2-1.0.la +PangoFT2_1_0_gir_CFLAGS = -I$(top_srcdir) +PangoFT2_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pangoft2_introspection_files)) # ------------------- libpangoxft ------------------- if HAVE_XFT pangoinclude_HEADERS += $(pangoxft_headers) lib_LTLIBRARIES += libpangoxft-1.0.la -BUILT_GIRSOURCES += PangoXft-1.0.gir +INTROSPECTION_GIRS += PangoXft-1.0.gir endif pangoxft_headers = pangoxft.h pangoxft-render.h @@ -329,33 +319,25 @@ libpangoxft_1_0_la_SOURCES = \ pangoxft-private.h \ pangoxft-render.c +pangoxft_introspection_files = \ + $(pangoxft_headers) \ + $(libpangoxft_1_0_la_SOURCES) -PangoXft-1.0.gir: $(pangoxft_headers) -PangoXft-1.0.gir: $(libpangoxft_1_0_la_SOURCES) PangoXft-1.0.gir: libpangoxft-1.0.la -PangoXft-1.0.gir: Pango-1.0.gir PangoFT2-1.0.gir $(G_IR_SCANNER) Makefile - $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace PangoXft --nsversion=1.0 \ - --add-include-path=$(srcdir) --add-include-path=. \ - --include=GObject-2.0 \ - --include=xft-2.0 \ - --include=xlib-2.0 \ - --include=PangoFT2-1.0 \ - --library=libpangoxft-1.0.la \ - --libtool="$(LIBTOOL)" \ - --output $@ \ - --pkg gobject-2.0 \ - --pkg freetype2 \ - -I$(top_srcdir) \ - $(PANGO_CFLAGS) \ - $(pangoxft_headers) \ - $(libpangoxft_1_0_la_SOURCES) +PangoXft-1.0.gir: PangoFT2-1.0.gir + +PangoXft_1_0_gir_PACKAGES = gobject-2.0 freetype2 +PangoXft_1_0_gir_INCLUDES = GObject-2.0 PangoFT2-1.0 xft-2.0 xlib-2.0 +PangoXft_1_0_gir_LIBS = libpangoxft-1.0.la +PangoXft_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) +PangoXft_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pangoxft_introspection_files)) # ------------------- libpangocairo ------------------- if HAVE_CAIRO pangoinclude_HEADERS += $(pangocairo_headers) lib_LTLIBRARIES += libpangocairo-1.0.la -BUILT_GIRSOURCES += PangoCairo-1.0.gir +INTROSPECTION_GIRS += PangoCairo-1.0.gir endif pangocairo_headers = pangocairo.h @@ -419,26 +401,18 @@ libpangocairo_1_0_la_LIBADD += $(INCLUDED_ATSUI_MODULES) PANGOCAIRO_FONT_BACKEND_GI_MODULE = PangoATSUI-1.0 endif -PangoCairo-1.0.gir: $(libpangocairo_1_0_la_SOURCES) -PangoCairo-1.0.gir: $(pangocairo_headers) +pangocairo_introspection_files = \ + $(libpangocairo_1_0_la_SOURCES) \ + $(pangocairo_headers) + PangoCairo-1.0.gir: libpangocairo-1.0.la -PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE).gir $(G_IR_SCANNER) Makefile - $(AM_V_GEN) $(G_IR_SCANNER) -v --namespace PangoCairo --nsversion=1.0 \ - --add-include-path=$(srcdir) --add-include-path=. \ - --include=GObject-2.0 \ - --include=cairo-1.0 \ - --include=Pango-1.0 \ - --add-include-path=. \ - --include=$(PANGOCAIRO_FONT_BACKEND_GI_MODULE) \ - --library=libpangocairo-1.0.la \ - --libtool="$(LIBTOOL)" \ - --output $@ \ - --pkg gobject-2.0 \ - --pkg cairo \ - -I$(top_srcdir) \ - $(PANGO_CFLAGS) \ - $(libpangocairo_1_0_la_SOURCES) \ - $(pangocairo_headers) +PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE).gir + +PangoCairo_1_0_gir_PACKAGES = gobject-2.0 cairo +PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 $(PANGOCAIRO_FONT_BACKEND_GI_MODULE) +PangoCairo_1_0_gir_LIBS = libpangocairo-1.0.la +PangoCairo_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) +PangoCairo_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pangocairo_introspection_files)) # ------------------- libpangowin32 ------------------- @@ -549,14 +523,11 @@ pangocairo-$(PANGO_API_VERSION).lib: libpangocairo-$(PANGO_API_VERSION).la $(src if HAVE_INTROSPECTION -girdir = $(GIRDIR) -gir_DATA = $(BUILT_GIRSOURCES) - -typelibsdir = $(TYPELIBDIR) -typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) +girdir = $(INTROSPECTION_GIRDIR) +dist_gir_DATA = $(INTROSPECTION_GIRS) -%.typelib: %.gir $(G_IR_COMPILER) - $(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $(builddir)/$(@F) +typelibsdir = $(INTROSPECTION_TYPELIBDIR) +typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) endif # HAVE_INTROSPECTION @@ -634,7 +605,9 @@ CLEANFILES = \ pango-enum-types.h \ s-enum-types-h \ pango-enum-types.c \ - s-enum-types-c + s-enum-types-c \ + $(INTROSPECTION_GIRS) \ + $(INTROSPECTION_GIRS:.gir=.typelib) MOSTLYCLEANFILES = \ *.list \ -- cgit v1.2.1 From fd15a3a04c69af0f5c04cde8c659269d0b139c28 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Fri, 18 Dec 2009 09:14:50 -0200 Subject: Use introspection.m4 Use introspection.m4 without requiring it to be included in the tree. https://bugzilla.gnome.org/show_bug.cgi?id=604770 --- autogen.sh | 1 + configure.in | 23 ++--------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/autogen.sh b/autogen.sh index 2482946f..e50757fe 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,6 +7,7 @@ test -z "$srcdir" && srcdir=. REQUIRED_AUTOMAKE_VERSION=1.9 PKG_NAME="pango" +REQUIRED_M4MACROS=introspection.m4 (test -f $srcdir/configure.in \ && test -f $srcdir/README \ diff --git a/configure.in b/configure.in index 751a320e..6848d593 100644 --- a/configure.in +++ b/configure.in @@ -483,27 +483,8 @@ PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=tr # # Checks for GObject Introspection # -have_introspection=false -PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.4, have_introspection=true, have_introspection=false) -AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection) - -G_IR_SCANNER= -G_IR_COMPILER= -G_IR_GENERATE= -GIRDIR= -TYPELIBDIR= -if $have_introspection; then - G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` - G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` - G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` - GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` - TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" -fi -AC_SUBST(G_IR_SCANNER) -AC_SUBST(G_IR_COMPILER) -AC_SUBST(G_IR_GENERATE) -AC_SUBST(GIRDIR) -AC_SUBST(TYPELIBDIR) + +GOBJECT_INTROSPECTION_CHECK([0.6.7]) # # Modules to build -- cgit v1.2.1 From c39acaa75e118261838f74ce568c23f6643f9352 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 6 Nov 2009 15:20:29 -0500 Subject: Fix FT_Face finalizer call --- pango/pango-ot-info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index d6fa0da2..167f553c 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -137,7 +137,7 @@ pango_ot_info_get (FT_Face face) else { if (face->generic.finalizer) - face->generic.finalizer (face->generic.data); + face->generic.finalizer (face); info = face->generic.data = g_object_new (PANGO_TYPE_OT_INFO, NULL); face->generic.finalizer = pango_ot_info_finalizer; -- cgit v1.2.1 From 0f06d7758bc37a4942342d2c17a88944cbc88adb Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 22 Dec 2009 12:26:12 +0100 Subject: Revert usage of CoreText in ATSUI backend Next to CGFontRef we also store an ATSFontRef now. This required the addition of the public for backends function pango_atsui_font_get_atsfont(). I have marked this call to be available starting version 1.27, as Pango is now in the midst of the 1.26 series. Since we now store the ATSFontRef next to CGFontRef, we can continue to make use of the ATS API in pango_cairo_atsui_font_create_metrics_for_context(). The CoreText calls have been removed. Both Tiger and earlier, and Leopard and later machines will now use the ATS API. It is well known that the ATS API has been deprecated in Leopard. In the near future a brand-new CoreText backend has to be written (from scratch) that should be installed and used on Macs running Leopard and later. This patch has been tested on 32-bit Tiger and 64-bit Snow Leopard and found to be functioning correctly. The build should now work again fine on Tiger machines, as it has been broken since the introduction of the CoreText calls. --- pango/pangoatsui-private.h | 2 ++ pango/pangoatsui.c | 30 +++++++++++++++++++++++++++++- pango/pangoatsui.h | 3 ++- pango/pangocairo-atsuifont.c | 23 +++++++++++------------ 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/pango/pangoatsui-private.h b/pango/pangoatsui-private.h index 8c734f00..a5ab0cb7 100644 --- a/pango/pangoatsui-private.h +++ b/pango/pangoatsui-private.h @@ -95,6 +95,8 @@ void _pango_atsui_font_set_context_key (PangoATSUIFont gpointer context_key); void _pango_atsui_font_set_cgfont (PangoATSUIFont *font, CGFontRef font_id); +void _pango_atsui_font_set_atsfont (PangoATSUIFont *font, + ATSFontRef font_ref); G_END_DECLS diff --git a/pango/pangoatsui.c b/pango/pangoatsui.c index 6aa970ed..e8029559 100644 --- a/pango/pangoatsui.c +++ b/pango/pangoatsui.c @@ -33,6 +33,7 @@ struct _PangoATSUIFontPrivate gpointer context_key; CGFontRef font_id; + ATSFontRef font_ref; PangoFontMap *fontmap; }; @@ -177,13 +178,22 @@ _pango_atsui_font_set_context_key (PangoATSUIFont *afont, void _pango_atsui_font_set_cgfont (PangoATSUIFont *font, - CGFontRef font_id) + CGFontRef font_id) { PangoATSUIFontPrivate *priv = font->priv; priv->font_id = font_id; } +void +_pango_atsui_font_set_atsfont (PangoATSUIFont *font, + ATSFontRef font_ref) +{ + PangoATSUIFontPrivate *priv = font->priv; + + priv->font_ref = font_ref; +} + /** * pango_atsui_font_get_cgfont: * @font: A #PangoATSUIFont @@ -201,3 +211,21 @@ pango_atsui_font_get_cgfont (PangoATSUIFont *font) return priv->font_id; } + +/** + * pango_atsui_font_get_atsfont: + * @font: A #PangoATSUIFont + * + * Returns the ATSFontRef of a font. + * + * Return value: the ATSFontRef associated to @font. + * + * Since: 1.27 + */ +ATSFontRef +pango_atsui_font_get_atsfont (PangoATSUIFont *font) +{ + PangoATSUIFontPrivate *priv = font->priv; + + return priv->font_ref; +} diff --git a/pango/pangoatsui.h b/pango/pangoatsui.h index 12db6de3..3ca558e2 100644 --- a/pango/pangoatsui.h +++ b/pango/pangoatsui.h @@ -68,7 +68,8 @@ struct _PangoATSUIFontClass #endif /* PANGO_ENABLE_BACKEND */ -CGFontRef pango_atsui_font_get_cgfont (PangoATSUIFont *font); +CGFontRef pango_atsui_font_get_cgfont (PangoATSUIFont *font); +ATSFontRef pango_atsui_font_get_atsfont (PangoATSUIFont *font); #endif /* PANGO_ENABLE_ENGINE || PANGO_ENABLE_BACKEND */ diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c index 91391e7e..057cc76c 100644 --- a/pango/pangocairo-atsuifont.c +++ b/pango/pangocairo-atsuifont.c @@ -119,8 +119,8 @@ pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, { PangoCairoATSUIFont *cafont = (PangoCairoATSUIFont *) font; PangoATSUIFont *afont = (PangoATSUIFont *) font; - CGFontRef cg_font; - CTFontRef ct_font; + ATSFontRef ats_font; + ATSFontMetrics ats_metrics; PangoFontMetrics *metrics; PangoFontDescription *font_desc; PangoLayout *layout; @@ -128,19 +128,19 @@ pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, PangoLanguage *language = pango_context_get_language (context); const char *sample_str = pango_language_get_sample_string (language); - cg_font = pango_atsui_font_get_cgfont (afont); - ct_font = CTFontCreateWithGraphicsFont(cg_font, cafont->size, NULL, NULL); - metrics = pango_font_metrics_new (); - metrics->ascent = CTFontGetAscent(ct_font) * PANGO_SCALE; - metrics->descent = CTFontGetDescent(ct_font) * PANGO_SCALE; + ats_font = pango_atsui_font_get_atsfont (afont); + ATSFontGetHorizontalMetrics (ats_font, kATSOptionFlagsDefault, &ats_metrics); + + metrics->ascent = ats_metrics.ascent * cafont->size * PANGO_SCALE; + metrics->descent = -ats_metrics.descent * cafont->size * PANGO_SCALE; - metrics->underline_position = CTFontGetUnderlinePosition(ct_font) * PANGO_SCALE; - metrics->underline_thickness = CTFontGetUnderlineThickness(ct_font) * PANGO_SCALE; + metrics->underline_position = ats_metrics.underlinePosition * cafont->size * PANGO_SCALE; + metrics->underline_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE; metrics->strikethrough_position = metrics->ascent / 3; - metrics->strikethrough_thickness = metrics->underline_thickness * PANGO_SCALE; + metrics->strikethrough_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE; layout = pango_layout_new (context); font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font); @@ -155,8 +155,6 @@ pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, pango_font_description_free (font_desc); g_object_unref (layout); - - return metrics; } @@ -270,6 +268,7 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap, size = (double) pango_font_description_get_size (desc) / PANGO_SCALE; _pango_atsui_font_set_cgfont (afont, font_id); + _pango_atsui_font_set_atsfont (afont, font_ref); if (context) { -- cgit v1.2.1 From ce6ee34f226b5f7582ea944fe8123bb0a04269d0 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Thu, 24 Dec 2009 08:49:48 +0100 Subject: Don't use devel version numbers in Since tags --- pango/pangoatsui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pangoatsui.c b/pango/pangoatsui.c index e8029559..da4b9a5a 100644 --- a/pango/pangoatsui.c +++ b/pango/pangoatsui.c @@ -220,7 +220,7 @@ pango_atsui_font_get_cgfont (PangoATSUIFont *font) * * Return value: the ATSFontRef associated to @font. * - * Since: 1.27 + * Since: 1.28 */ ATSFontRef pango_atsui_font_get_atsfont (PangoATSUIFont *font) -- cgit v1.2.1 From 0dbcc691b8e14879a72d275d188848064d8c7e40 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 15:30:57 +0100 Subject: [modules] Don't warn multiple times --- pango/modules.c | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/pango/modules.c b/pango/modules.c index e6c13349..dad8aae7 100644 --- a/pango/modules.c +++ b/pango/modules.c @@ -100,6 +100,22 @@ static void init_modules (void); static GType pango_module_get_type (void); +/* If a module cannot be used, or does not create an engine + * correctly, we print out an error containing module name and id, + * but to not flood the terminal with zillions of the message, we + * set a flag on the module to only err once per module. + */ +static GQuark +get_warned_quark (void) +{ + static GQuark warned_quark = 0; + + if (G_UNLIKELY (!warned_quark)) + warned_quark = g_quark_from_static_string ("pango-module-warned"); + + return warned_quark; +} + /** * pango_find_map: * @language: the language tag for which to find the map @@ -172,7 +188,13 @@ pango_module_load (GTypeModule *module) pango_module->library = g_module_open (pango_module->path, G_MODULE_BIND_LOCAL); if (!pango_module->library) { - g_warning ("%s", g_module_error()); + GQuark warned_quark = get_warned_quark (); + if (!g_object_get_qdata (G_OBJECT (pango_module), warned_quark)) + { + g_warning ("%s", g_module_error()); + g_object_set_qdata_full (G_OBJECT (pango_module), warned_quark, + GINT_TO_POINTER (1), NULL); + } return FALSE; } @@ -186,7 +208,14 @@ pango_module_load (GTypeModule *module) !g_module_symbol (pango_module->library, "script_engine_create", (gpointer *)(void *)&pango_module->create)) { - g_warning ("%s", g_module_error()); + GQuark warned_quark = get_warned_quark (); + if (!g_object_get_qdata (G_OBJECT (pango_module), warned_quark)) + { + g_warning ("%s", g_module_error()); + g_object_set_qdata_full (G_OBJECT (pango_module), warned_quark, + GINT_TO_POINTER (1), NULL); + } + g_module_close (pango_module->library); return FALSE; @@ -263,16 +292,7 @@ pango_engine_pair_get_engine (PangoEnginePair *pair) if (!pair->engine) { - /* If a module cannot be used, or doesn't not create an engine - * correctly, we print out an error containing module name and id, - * but to not flood the terminal with zillions of the message, we - * set a flag on the module to only err once per module. - */ - static GQuark warned_quark = 0; - - if (!warned_quark) - warned_quark = g_quark_from_static_string ("pango-module-warned"); - + GQuark warned_quark = get_warned_quark (); if (!g_object_get_qdata (G_OBJECT (pair->module), warned_quark)) { g_warning ("Failed to load Pango module '%s' for id '%s'", pair->module->path, pair->info.id); -- cgit v1.2.1 From dded011854cf721ca80587e3f7587d2af31a859d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 15:59:54 +0100 Subject: Cosmetic --- pango/pango-layout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 77270c23..42de439b 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3289,8 +3289,7 @@ process_item (PangoLayout *layout, retry_break: - /* See how much of the item we can stuff in the line - */ + /* See how much of the item we can stuff in the line. */ width = 0; for (num_chars = 0; num_chars < item->num_chars; num_chars++) { -- cgit v1.2.1 From 2cd9c4b416cbe55dd68106003f360e861a6722be Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 16:00:11 +0100 Subject: Zero the space at the end of line when breaking lines Previously we were not zeroing the final space in the line when breaking lines and were doing that only after lines were broken. This was broken since setting layout width to its own logical width (under width=-1) could result in differently broken lines. That's fixed now. Problem originally reported on gtk-list on 2009-12-22 by Ben Pfaff. --- pango/pango-layout.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 42de439b..df8207c3 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3307,6 +3307,16 @@ process_item (PangoLayout *layout, width += state->log_widths[state->log_widths_offset + num_chars]; } + /* If there's a space at the end of the line, include that also. + * The logic here should match zero_line_final_space(). + * XXX Currently it doesn't quite match the logic there. We don't check + * the cluster here. But should be fine in practice. */ + if (break_num_chars > 0 && break_num_chars < item->num_chars && + layout->log_attrs[state->start_offset + break_num_chars - 1].is_white) + { + break_width -= state->log_widths[state->log_widths_offset + break_num_chars - 1]; + } + if (layout->wrap == PANGO_WRAP_WORD_CHAR && force_fit && break_width > state->remaining_width && !retrying_with_char_breaks) { retrying_with_char_breaks = TRUE; -- cgit v1.2.1 From d52aa9ec30e74b593eee80082bf8f27bea08246f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 16:02:34 +0100 Subject: Always recalculate run width after breaking the run Before we only did this if justifying. However, computing the width is essentially free these days, so do it always. --- pango/pango-layout.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index df8207c3..f78fbb49 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3352,17 +3352,11 @@ process_item (PangoLayout *layout, length = g_utf8_offset_to_pointer (layout->text + item->offset, break_num_chars) - (layout->text + item->offset); new_item = pango_item_split (item, length, break_num_chars); - - /* reshaping may slightly change the item width. update - * remaining_width if we are justifying */ + /* Add the width back, to the line, reshape, subtract the new width */ state->remaining_width += break_width; - insert_run (line, state, new_item, FALSE); - - if (layout->justify) - break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs); - + break_width = pango_glyph_string_get_width (((PangoGlyphItem *)(line->runs->data))->glyphs); state->remaining_width -= break_width; state->log_widths_offset += break_num_chars; -- cgit v1.2.1 From 5389aa2daacc6d41e1a2adeed24ca49f30d371ec Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Dec 2009 16:03:12 +0100 Subject: Simplify cluster analysis --- pango/pango-layout.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index f78fbb49..c60c7e8f 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -4853,7 +4853,6 @@ zero_line_final_space (PangoLayoutLine *line, PangoItem *item = run->item; PangoGlyphString *glyphs = run->glyphs; int glyph = item->analysis.level % 2 ? 0 : glyphs->num_glyphs - 1; - const char *p; /* if the final char of line forms a cluster, and it's * a whitespace char, zero its glyph's width as it's been wrapped @@ -4863,8 +4862,8 @@ zero_line_final_space (PangoLayoutLine *line, !layout->log_attrs[state->start_offset - 1].is_white) return; - p = g_utf8_prev_char (layout->text + item->offset + item->length); - if (p != layout->text + item->offset + glyphs->log_clusters[glyph]) + if (glyphs->num_glyphs >= 2 && + glyphs->log_clusters[glyph] == glyphs->log_clusters[glyph + (item->analysis.level % 2 ? 1 : -1)]) return; state->remaining_width += glyphs->glyphs[glyph].geometry.width; -- cgit v1.2.1 From 0f0b9f963db52024f348359ce61c66bff6ce0531 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Thu, 31 Dec 2009 00:27:38 +0100 Subject: Do not get the gir and typelib dir for g-i Since it breaks when using a system install of gobject-introspection --- pango/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/Makefile.am b/pango/Makefile.am index fb05d0ba..cef644f1 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -523,10 +523,10 @@ pangocairo-$(PANGO_API_VERSION).lib: libpangocairo-$(PANGO_API_VERSION).la $(src if HAVE_INTROSPECTION -girdir = $(INTROSPECTION_GIRDIR) +girdir = $(datadir)/gir-1.0 dist_gir_DATA = $(INTROSPECTION_GIRS) -typelibsdir = $(INTROSPECTION_TYPELIBDIR) +typelibsdir = $(libdir)/girepository-1.0 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) endif # HAVE_INTROSPECTION -- cgit v1.2.1 From 2b3154b4b7cd9ad1cd532f095c10bedfccfae190 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 5 Jan 2010 13:21:35 +0100 Subject: Bug 582697 - Add pango-view --pixels option --- pango-view/viewer-render.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c index c698b459..e672dcd4 100644 --- a/pango-view/viewer-render.c +++ b/pango-view/viewer-render.c @@ -34,6 +34,7 @@ gboolean opt_display = TRUE; int opt_dpi = 96; +gboolean opt_pixels = FALSE; const char *opt_font = ""; gboolean opt_header = FALSE; const char *opt_output = NULL; @@ -622,7 +623,7 @@ parse_backend (const char *name G_GNUC_UNUSED, } -static gboolean +static G_GNUC_NORETURN gboolean show_version(const char *name G_GNUC_UNUSED, const char *arg G_GNUC_UNUSED, gpointer data G_GNUC_UNUSED, @@ -687,6 +688,8 @@ parse_options (int argc, char *argv[]) "Save rendered image to output file", "file"}, {"pangorc", 0, 0, G_OPTION_ARG_STRING, &opt_pangorc, "pangorc file to use (default is ./pangorc)", "file"}, + {"pixels", 0, 0, G_OPTION_ARG_NONE, &opt_pixels, + "Use pixel units instead of points (sets dpi to 72)", NULL}, {"rtl", 0, 0, G_OPTION_ARG_NONE, &opt_rtl, "Set base direction to right-to-left", NULL}, {"rotate", 0, 0, G_OPTION_ARG_DOUBLE, &opt_rotate, @@ -736,6 +739,9 @@ parse_options (int argc, char *argv[]) g_free(backend_options); g_free(backend_desc); + if (opt_pixels) + opt_dpi = 72; + if ((opt_text && argc != 1) || (!opt_text && argc != 2)) { if (opt_text && argc != 1) -- cgit v1.2.1 From 0d5ece134cb0e4866456d90ecf9ac42e8c052e6e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 12 Jan 2010 14:05:48 -0500 Subject: [configure] Remove stale code --- configure.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure.in b/configure.in index 6848d593..7eca5272 100644 --- a/configure.in +++ b/configure.in @@ -28,9 +28,6 @@ m4_define([pango_version], [pango_version_major.pango_version_minor.pango_version_micro]) dnl The X.Y in -lpango-X.Y line. This is expected to stay 1.0 until Pango 2. m4_define([pango_api_version], [1.0]) -dnl Number of releases since we've added interfaces -dnl XXX For 1.25 release simply remove it and make it automatic. -m4_define([pango_interface_age], [0]) m4_if(m4_eval(pango_version_minor % 2), [1], [ dnl for unstable releases -- cgit v1.2.1 From 558b96314f1184c5f031545ee238549ac3dd3868 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 12 Jan 2010 15:23:43 -0500 Subject: Lets see if this shuts introspection down so I can get a release out --- Makefile.am | 2 +- acinclude.m4 | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ autogen.sh | 2 +- 3 files changed, 98 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8b0889f2..01aa688f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -98,6 +98,6 @@ if HAVE_WIN32 pkgconfig_DATA += pangowin32.pc endif -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references --enable-introspection +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references -include $(top_srcdir)/git.mk diff --git a/acinclude.m4 b/acinclude.m4 index 48fd5d8e..8899c7c4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -55,3 +55,99 @@ AC_DEFUN([JH_CHECK_XML_CATALOG], ]) +dnl REMOVE THIS WHEN introspection.m4 is widely available +dnl +dnl -*- mode: autoconf -*- +dnl Copyright 2009 Johan Dahlin +dnl +dnl This file is free software; the author(s) gives unlimited +dnl permission to copy and/or distribute it, with or without +dnl modifications, as long as this notice is preserved. +dnl + +# serial 1 + +m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], +[ + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([LT_INIT],[$0])dnl setup libtool first + + dnl enable/disable introspection + m4_if([$2], [require], + [dnl + enable_introspection=yes + ],[dnl + AC_ARG_ENABLE(introspection, + AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], + [Enable introspection for this build]),, + [enable_introspection=auto]) + ])dnl + + AC_MSG_CHECKING([for gobject-introspection]) + + dnl presence/version checking + AS_CASE([$enable_introspection], + [no], [dnl + found_introspection="no (disabled, use --enable-introspection to enable)" + ],dnl + [yes],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0],, + AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], + found_introspection=yes, + AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) + ],dnl + [auto],[dnl + PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + ],dnl + [dnl + AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) + ])dnl + + AC_MSG_RESULT([$found_introspection]) + + INTROSPECTION_SCANNER= + INTROSPECTION_COMPILER= + INTROSPECTION_GENERATE= + INTROSPECTION_GIRDIR= + INTROSPECTION_TYPELIBDIR= + if test "x$found_introspection" = "xyes"; then + INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection + fi + AC_SUBST(INTROSPECTION_SCANNER) + AC_SUBST(INTROSPECTION_COMPILER) + AC_SUBST(INTROSPECTION_GENERATE) + AC_SUBST(INTROSPECTION_GIRDIR) + AC_SUBST(INTROSPECTION_TYPELIBDIR) + AC_SUBST(INTROSPECTION_CFLAGS) + AC_SUBST(INTROSPECTION_LIBS) + AC_SUBST(INTROSPECTION_MAKEFILE) + + AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") +]) + + +dnl Usage: +dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) + +AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) +]) + +dnl Usage: +dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) + + +AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], +[ + _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) +]) diff --git a/autogen.sh b/autogen.sh index e50757fe..e8a3cf7a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,7 +7,7 @@ test -z "$srcdir" && srcdir=. REQUIRED_AUTOMAKE_VERSION=1.9 PKG_NAME="pango" -REQUIRED_M4MACROS=introspection.m4 +#REQUIRED_M4MACROS=introspection.m4 (test -f $srcdir/configure.in \ && test -f $srcdir/README \ -- cgit v1.2.1 From 797d46714d27f147277fdd5346648d838c68fb8c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 26 Jan 2010 12:30:44 -0500 Subject: [HB/GDEF] Fix bug in building synthetic GDEF table --- pango/opentype/hb-ot-layout.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc index 67b2b9ae..d1bb49da 100644 --- a/pango/opentype/hb-ot-layout.cc +++ b/pango/opentype/hb-ot-layout.cc @@ -44,6 +44,8 @@ _hb_ot_layout_init (hb_face_t *face) { hb_ot_layout_t *layout = &face->ot_layout; + memset (layout, 0, sizeof (*layout)); + layout->gdef_blob = Sanitizer::sanitize (hb_face_get_table (face, HB_OT_TAG_GDEF)); layout->gdef = &Sanitizer::lock_instance (layout->gdef_blob); @@ -293,7 +295,7 @@ hb_ot_layout_build_glyph_classes (hb_face_t *face, return; if (layout->new_gdef.len == 0) { - layout->new_gdef.klasses = (unsigned char *) calloc (num_total_glyphs, sizeof (unsigned char)); + layout->new_gdef.klasses = (unsigned char *) calloc (count, sizeof (unsigned char)); layout->new_gdef.len = count; } -- cgit v1.2.1 From c7460fc1b71a491a1b33c19ba0d4cd3b8353c7cb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 26 Jan 2010 12:58:01 -0500 Subject: [HB] Remove unused argument --- pango/opentype/hb-ot-layout.cc | 1 - pango/opentype/hb-ot-layout.h | 1 - pango/pango-ot-info.c | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc index d1bb49da..8099fc5f 100644 --- a/pango/opentype/hb-ot-layout.cc +++ b/pango/opentype/hb-ot-layout.cc @@ -281,7 +281,6 @@ hb_ot_layout_set_glyph_class (hb_face_t *face, void hb_ot_layout_build_glyph_classes (hb_face_t *face, - uint16_t num_total_glyphs, hb_codepoint_t *glyphs, unsigned char *klasses, uint16_t count) diff --git a/pango/opentype/hb-ot-layout.h b/pango/opentype/hb-ot-layout.h index 54f785f6..ee615ca9 100644 --- a/pango/opentype/hb-ot-layout.h +++ b/pango/opentype/hb-ot-layout.h @@ -66,7 +66,6 @@ hb_ot_layout_set_glyph_class (hb_face_t *face, void hb_ot_layout_build_glyph_classes (hb_face_t *face, - uint16_t num_total_glyphs, hb_codepoint_t *glyphs, unsigned char *klasses, uint16_t count); diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index 167f553c..bd25fcae 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -301,8 +301,7 @@ synthesize_class_def (PangoOTInfo *info) g_array_free (glyph_infos, TRUE); - hb_ot_layout_build_glyph_classes (info->hb_face, info->face->num_glyphs, - glyph_indices, classes, j); + hb_ot_layout_build_glyph_classes (info->hb_face, glyph_indices, classes, j); g_free (glyph_indices); g_free (classes); -- cgit v1.2.1 From b6a2d2b3fc0ad9e3506b0b530346d3c044488419 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 17 Feb 2010 15:13:37 -0500 Subject: Bug 610183 - Pango doesn't compile with gcc 3.3.3 Disable some __attribute__s with gcc 3. --- pango/opentype/hb-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/opentype/hb-private.h b/pango/opentype/hb-private.h index ea29e74a..b17b24a0 100644 --- a/pango/opentype/hb-private.h +++ b/pango/opentype/hb-private.h @@ -158,7 +158,7 @@ typedef GStaticMutex hb_mutex_t; #define __attribute__(x) #endif -#if __GNUC__ >= 3 +#if __GNUC__ >= 4 #define HB_GNUC_UNUSED __attribute__((unused)) #define HB_GNUC_PURE __attribute__((pure)) #define HB_GNUC_CONST __attribute__((const)) -- cgit v1.2.1 From aae6aab95ce876f52c266bddb2b200344f8020bb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 22 Feb 2010 14:01:01 -0500 Subject: Enable introspection for dist again --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 01aa688f..8b0889f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -98,6 +98,6 @@ if HAVE_WIN32 pkgconfig_DATA += pangowin32.pc endif -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-doc-cross-references --enable-introspection -include $(top_srcdir)/git.mk -- cgit v1.2.1 From ab8d5f6df3171197a7d3913bdf2195bca90fe6de Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 22 Feb 2010 16:03:15 -0500 Subject: Ensure proper alignment of NullPool Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X --- pango/opentype/hb-open-type-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 65e4950f..f460f1a2 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -61,7 +61,7 @@ /* Null objects */ /* Global nul-content Null pool. Enlarge as necessary. */ -static const char NullPool[32] = ""; +static const void *NullPool[32 / sizeof (void *)]; /* Generic template for nul-content sizeof-sized Null objects. */ template -- cgit v1.2.1 From 728bec3cb2525b35b16cea772428a70350aba3fb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 22 Feb 2010 16:06:18 -0500 Subject: Release 1.27.1 --- NEWS | 12 ++++++++++++ configure.in | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index a82f56c0..4cc571ba 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +Overview of changes between 1.26.2 and 1.27.1 +============================================= +- Enable introspection again +- Misc HarfBuzz bug fixes +- Improve PangoLayout line breaking +- Revert usage of CoreText in ATSUI backend +- Fix FT_Face finalizer call +- Bugs fixed: + Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X + Bug 610183 - Pango doesn't compile with gcc 3.3.3 + Bug 582697 - Add pango-view --pixels option + Overview of changes between 1.26.1 and 1.26.2 ============================================= - Fix non-standard C++ usage diff --git a/configure.in b/configure.in index 7eca5272..8e2bebc5 100644 --- a/configure.in +++ b/configure.in @@ -21,8 +21,8 @@ dnl dnl The triplet m4_define([pango_version_major], [1]) -m4_define([pango_version_minor], [26]) -m4_define([pango_version_micro], [2]) +m4_define([pango_version_minor], [27]) +m4_define([pango_version_micro], [1]) m4_define([pango_version], [pango_version_major.pango_version_minor.pango_version_micro]) -- cgit v1.2.1 From 2c858fe6b36801e731fe764c1085a2cbcbc04037 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 23 Feb 2010 14:14:17 -0500 Subject: Bug 610791 - checks fail for unused documented symbols Hookup new symbol. --- docs/pango-docs.sgml | 3 +++ docs/pango-sections.txt | 1 + docs/tmpl/atsui-fonts.sgml | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/docs/pango-docs.sgml b/docs/pango-docs.sgml index a3b47612..a769ec1f 100644 --- a/docs/pango-docs.sgml +++ b/docs/pango-docs.sgml @@ -135,4 +135,7 @@ Index of new symbols in 1.26 + + Index of new symbols in 1.26 + diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt index e4cfbc92..7b89b875 100644 --- a/docs/pango-sections.txt +++ b/docs/pango-sections.txt @@ -891,6 +891,7 @@ pango_cairo_font_map_get_type atsui-fonts PANGO_RENDER_TYPE_ATSUI pango_atsui_font_get_cgfont +pango_atsui_font_get_atsfont PANGO_ATSUI_FONT PANGO_ATSUI_FONT_CLASS diff --git a/docs/tmpl/atsui-fonts.sgml b/docs/tmpl/atsui-fonts.sgml index 0d851773..19b03445 100644 --- a/docs/tmpl/atsui-fonts.sgml +++ b/docs/tmpl/atsui-fonts.sgml @@ -35,3 +35,12 @@ g_quark_from_string()) is used to identify the renderer in pango_find_map(). @Returns: + + + + + +@font: +@Returns: + + -- cgit v1.2.1 From 77f99dd9e17c5051b2b2dcfe6e7746f924e9f71b Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Sun, 28 Feb 2010 13:48:22 +0100 Subject: Bug 608923 - Incorrect/broken ligatures on MacOS Fix the basic ATSUI to probably work on 64-bit Snow Leopard. The main culprit was most probably in the usage of CGFontRef, where ATSUFontID was expected. --- modules/basic/basic-atsui.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/basic/basic-atsui.c b/modules/basic/basic-atsui.c index a3df773d..369a596a 100644 --- a/modules/basic/basic-atsui.c +++ b/modules/basic/basic-atsui.c @@ -86,21 +86,24 @@ basic_engine_shape (PangoEngineShape *engine, const char *p; PangoATSUIFont *afont = PANGO_ATSUI_FONT (font); ATSUStyle style; - CGFontRef fontID; + ATSUFontID fontID; ATSUAttributeTag styleTags[] = { kATSUFontTag }; ATSUAttributeValuePtr styleValues[] = { &fontID }; - ByteCount styleSizes[] = { sizeof (CGFontRef) }; + ByteCount styleSizes[] = { sizeof (ATSUFontID) }; utf16 = g_utf8_to_utf16 (text, length, NULL, &n16, NULL); - err = ATSUCreateTextLayout (&text_layout); - err = ATSUSetTextPointerLocation (text_layout, utf16, 0, n16, n16); + err = ATSUCreateTextLayoutWithTextPtr (utf16, 0, n16, n16, + 0, + NULL, + NULL, + &text_layout); err = ATSUCreateStyle(&style); - fontID = pango_atsui_font_get_cgfont (afont); + fontID = pango_atsui_font_get_atsfont (afont); err = ATSUSetAttributes(style, - sizeof(styleTags) / sizeof(styleTags[0]), + (ItemCount)(sizeof(styleTags) / sizeof(styleTags[0])), styleTags, styleSizes, styleValues); err = ATSUSetRunStyle(text_layout, -- cgit v1.2.1 From 8c3bffeccbd0074e04adf894199393580de88e95 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 1 Mar 2010 17:53:54 +0200 Subject: Bug 609326 - Complex script shaping failed in the FT2 backend on Windows I am not sure whether the root cause is a bug in FreeType, or the way Pango uses FreeType, or some more exotic mechanism. Anyway, add a simple workaround. --- pango/pango-ot-info.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index bd25fcae..aa885a9d 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -144,7 +144,13 @@ pango_ot_info_get (FT_Face face) info->face = face; - if (face->stream->base != NULL) { + if ( +#ifdef G_OS_WIN32 + FALSE && /* Work around possible bug in FreeType, FT_StreamRec::base + * can be non-NULL even if the stream is not memory-based. + */ +#endif + face->stream->base != NULL) { hb_blob_t *blob; blob = hb_blob_create ((const char *) face->stream->base, -- cgit v1.2.1 From 952847a6e2d53b33cea39d13255fd0f7c8075942 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 23 Feb 2010 16:44:55 -0500 Subject: Make blob unlocking 64bit-safe Bug 604128 - Applications crash when displaying Hebrew characters --- pango/opentype/hb-blob.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pango/opentype/hb-blob.c b/pango/opentype/hb-blob.c index 107cd432..3348a38b 100644 --- a/pango/opentype/hb-blob.c +++ b/pango/opentype/hb-blob.c @@ -243,18 +243,18 @@ static hb_bool_t _try_make_writable_inplace_unix_locked (hb_blob_t *blob) { #if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) - unsigned int pagesize = -1, mask, length; + uintptr_t pagesize = -1, mask, length; const char *addr; #if defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE) - pagesize = (unsigned int) sysconf (_SC_PAGE_SIZE); + pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); #elif defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) - pagesize = (unsigned int) sysconf (_SC_PAGESIZE); + pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); #elif defined(HAVE_GETPAGESIZE) - pagesize = (unsigned int) getpagesize (); + pagesize = (uintptr_t) getpagesize (); #endif - if ((unsigned int) -1 == pagesize) { + if ((uintptr_t) -1L == pagesize) { #if HB_DEBUG_BLOB fprintf (stderr, "%p %s: failed to get pagesize: %s\n", blob, __FUNCTION__, strerror (errno)); #endif @@ -265,8 +265,8 @@ _try_make_writable_inplace_unix_locked (hb_blob_t *blob) #endif mask = ~(pagesize-1); - addr = (const char *) (((size_t) blob->data) & mask); - length = (const char *) (((size_t) blob->data + blob->length + pagesize-1) & mask) - addr; + addr = (const char *) (((uintptr_t) blob->data) & mask); + length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr; #if HB_DEBUG_BLOB fprintf (stderr, "%p %s: calling mprotect on [%p..%p] (%d bytes)\n", blob, __FUNCTION__, -- cgit v1.2.1 From 8818723646aeb013dd39fca1c6e1162c7636b67f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 1 Mar 2010 22:30:51 -0500 Subject: Bug 609326 - Complex script shaping failed in the FT2 backend on Windows Check for face->stream->read == NULL instead of face->stream->base != NULL. --- pango/pango-ot-info.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index aa885a9d..9c74f917 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -144,13 +144,7 @@ pango_ot_info_get (FT_Face face) info->face = face; - if ( -#ifdef G_OS_WIN32 - FALSE && /* Work around possible bug in FreeType, FT_StreamRec::base - * can be non-NULL even if the stream is not memory-based. - */ -#endif - face->stream->base != NULL) { + if (face->stream->read == NULL) { hb_blob_t *blob; blob = hb_blob_create ((const char *) face->stream->base, -- cgit v1.2.1 From 45c5cb6acd497e159e68835cba78061793eaad98 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 3 Mar 2010 20:43:26 -0500 Subject: Bug 345066 - backspace changes independent indic characters --- modules/indic/indic-lang.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c index a3915208..dc01b6fe 100644 --- a/modules/indic/indic-lang.c +++ b/modules/indic/indic-lang.c @@ -34,6 +34,73 @@ typedef PangoEngineLangClass IndicEngineLangClass; #define INDIC_ENGINE_INFO(script) \ {#script ENGINE_SUFFIX, PANGO_ENGINE_TYPE_LANG, RENDER_TYPE, script##_scripts, G_N_ELEMENTS(script##_scripts)} +#define DEV_RRA 0x0931 /* 0930 + 093c */ +#define DEV_QA 0x0958 /* 0915 + 093c */ +#define DEV_YA 0x095F /* 092f + 003c */ +#define DEV_KHHA 0x0959 +#define DEV_GHHA 0x095A +#define DEV_ZA 0x095B +#define DEV_DDDHA 0x095C +#define DEV_RHA 0x095D +#define DEV_FA 0x095E +#define DEV_YYA 0x095F + +/* Bengali */ +/* for split matras in all brahmi based script */ +#define BENGALI_SIGN_O 0x09CB /* 09c7 + 09be */ +#define BENGALI_SIGN_AU 0x09CC /* 09c7 + 09d7 */ +#define BENGALI_RRA 0x09DC +#define BENGALI_RHA 0x09DD +#define BENGALI_YYA 0x09DF + +/* Gurumukhi */ +#define GURUMUKHI_LLA 0x0A33 +#define GURUMUKHI_SHA 0x0A36 +#define GURUMUKHI_KHHA 0x0A59 +#define GURUMUKHI_GHHA 0x0A5A +#define GURUMUKHI_ZA 0x0A5B +#define GURUMUKHI_RRA 0x0A5C +#define GURUMUKHI_FA 0x0A5E + +/* Oriya */ +#define ORIYA_AI 0x0B48 +#define ORIYA_O 0x0B4B +#define ORIYA_AU 0x0B4C + +/* Telugu */ +#define TELUGU_EE 0x0C47 +#define TELUGU_AI 0x0C48 + +/* Tamil */ +#define TAMIL_O 0x0BCA +#define TAMIL_OO 0x0BCB +#define TAMIL_AU 0x0BCC + +/* Kannada */ +#define KNDA_EE 0x0CC7 +#define KNDA_AI 0x0CC8 +#define KNDA_O 0x0CCA +#define KNDA_OO 0x0CCB + +/* Malayalam */ +#define MLYM_O 0x0D4A +#define MLYM_OO 0x0D4B +#define MLYM_AU 0x0D4C + +#define IS_COMPOSITE_WITH_BRAHMI_NUKTA(c) ( \ + (c >= BENGALI_RRA && c <= BENGALI_YYA) || \ + (c >= DEV_QA && c <= DEV_YA) || (c == DEV_RRA) || (c >= DEV_KHHA && c <= DEV_YYA) || \ + (c >= KNDA_EE && c <= KNDA_AI) ||(c >= KNDA_O && c <= KNDA_OO) || \ + (c == TAMIL_O) || (c == TAMIL_OO) || (c == TAMIL_AU) || \ + (c == TELUGU_EE) || (c == TELUGU_AI) || \ + (c == ORIYA_AI) || (c == ORIYA_O) || (c == ORIYA_AU) || \ + (c >= GURUMUKHI_KHHA && c <= GURUMUKHI_RRA) || (c == GURUMUKHI_FA)|| (c == GURUMUKHI_LLA)|| (c == GURUMUKHI_SHA) || \ + FALSE) +#define IS_SPLIT_MATRA_BRAHMI(c) ( \ + (c == BENGALI_SIGN_O) || (c == BENGALI_SIGN_AU) || \ + (c >= MLYM_O && c <= MLYM_AU) || \ + FALSE) + static PangoEngineScriptInfo deva_scripts[] = { { PANGO_SCRIPT_DEVANAGARI, "*" } @@ -110,6 +177,12 @@ indic_engine_break (PangoEngineLang *engine G_GNUC_UNUSED, { this_wc = g_utf8_get_char (p); next = g_utf8_next_char (p); + + if (G_UNLIKELY ( + IS_COMPOSITE_WITH_BRAHMI_NUKTA(this_wc) || IS_SPLIT_MATRA_BRAHMI(this_wc))) { + attrs[i+1].backspace_deletes_character = FALSE; + } + if (next != NULL && next < (text + length)) { next_wc = g_utf8_get_char (next); -- cgit v1.2.1 From 238d7a23d619f842953ee41f9592bbf8c6c409c7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 3 Mar 2010 21:43:09 -0500 Subject: Bug 594101 - [Indic] needed character class data updates to support unicode 5.1 Random character class changes... It's all Chinese to me. --- modules/indic/indic-ot-class-tables.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/indic/indic-ot-class-tables.c b/modules/indic/indic-ot-class-tables.c index a2dc7613..fca63aec 100644 --- a/modules/indic/indic-ot-class-tables.c +++ b/modules/indic/indic-ot-class-tables.c @@ -123,7 +123,7 @@ static const IndicOTCharClass bengCharClasses[] = _rv, _xx, _ct, _xx, _xx, _xx, _ct, _ct, _ct, _ct, _xx, _xx, _nu, _xx, _dr, _dl, /* 09B0 - 09BF */ _dr, _db, _db, _db, _db, _xx, _xx, _dl, _dl, _xx, _xx, _s1, _s2, _vr, _xx, _xx, /* 09C0 - 09CF */ _xx, _xx, _xx, _xx, _xx, _xx, _xx, _dr, _xx, _xx, _xx, _xx, _cn, _cn, _xx, _cn, /* 09D0 - 09DF */ - _iv, _iv, _dv, _dv, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 09E0 - 09EF */ + _iv, _iv, _db, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 09E0 - 09EF */ _rv, _ct, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx /* 09F0 - 09FA */ }; @@ -136,7 +136,7 @@ static const IndicOTCharClass guruCharClasses[] = _dr, _db, _db, _xx, _xx, _xx, _xx, _da, _da, _xx, _xx, _da, _da, _vr, _xx, _xx, /* 0A40 - 0A4F */ _xx, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _cn, _cn, _cn, _ct, _xx, _cn, _xx, /* 0A50 - 0A5F */ _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0A60 - 0A6F */ - _ma, _ma, _ct, _ct, _xx, _db /* 0A70 - 0A75 */ + _ma, _ma, _iv, _iv, _xx, _db /* 0A70 - 0A75 */ }; static const IndicOTCharClass gujrCharClasses[] = @@ -164,7 +164,7 @@ static const IndicOTCharClass oryaCharClasses[] = static const IndicOTCharClass tamlCharClasses[] = { - _xx, _xx, _ma, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _iv, _iv, /* 0B80 - 0B8F */ + _xx, _xx, _ma, _xx, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _xx, _xx, _iv, _iv, /* 0B80 - 0B8F */ _iv, _xx, _iv, _iv, _iv, _ct, _xx, _xx, _xx, _ct, _ct, _xx, _ct, _xx, _ct, _ct, /* 0B90 - 0B9F */ _xx, _xx, _xx, _ct, _ct, _xx, _xx, _xx, _ct, _ct, _ct, _xx, _xx, _xx, _ct, _ct, /* 0BA0 - 0BAF */ _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _ct, _xx, _xx, _xx, _xx, _dr, _dr, /* 0BB0 - 0BBF */ @@ -181,9 +181,9 @@ static const IndicOTCharClass teluCharClasses[] = _iv, _xx, _iv, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, /* 0C10 - 0C1F */ _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _bb, /* 0C20 - 0C2F */ _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _xx, _xx, _da, _da, /* 0C30 - 0C3F */ - _da, _dr, _dr, _dr, _dr, _xx, _da, _da, _s1, _xx, _da, _da, _da, _vr, _xx, _xx, /* 0C40 - 0C4F */ + _da, _dr, _dr, _lm, _lm, _xx, _da, _da, _s1, _xx, _da, _da, _da, _vr, _xx, _xx, /* 0C40 - 0C4F */ _xx, _xx, _xx, _xx, _xx, _da, _db, _xx, _bb, _bb, _xx, _xx, _xx, _xx, _xx, _xx, /* 0C50 - 0C5F */ - _iv, _iv, _db, _db, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0C60 - 0C6F */ + _iv, _iv, _lm, _lm, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, /* 0C60 - 0C6F */ _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx /* 0C70 - 0C7F */ }; @@ -200,7 +200,7 @@ static const IndicOTCharClass kndaCharClasses[] = _xx, _xx, _mp, _mp, _xx, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _iv, _xx, _iv, _iv, /* 0C80 - 0C8F */ _iv, _xx, _iv, _iv, _iv, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, /* 0C90 - 0C9F */ _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _bb, /* 0CA0 - 0CAF */ - _rb, _ct, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _nu, _xx, _dr, _da, /* 0CB0 - 0CBF */ + _rb, _bb, _bb, _bb, _xx, _bb, _bb, _bb, _bb, _bb, _xx, _xx, _nu, _xx, _dr, _da, /* 0CB0 - 0CBF */ _s1, _dr, _dr, _lm, _lm, _xx, _da, _s2, _s3, _xx, _s4, _s5, _da, _vr, _xx, _xx, /* 0CC0 - 0CCF */ _xx, _xx, _xx, _xx, _xx, _lm, _lm, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _ct, _xx, /* 0CD0 - 0CDF */ _iv, _iv, _lm, _lm, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx, _xx /* 0CE0 - 0CEF */ -- cgit v1.2.1 From 6118d5891fee776a087855c335a73c79fdaf036c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 13 Mar 2010 00:02:30 -0500 Subject: [git.mk] Fix bug with parallel make and subdirs --- git.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git.mk b/git.mk index 088ef0b5..5ab41bab 100644 --- a/git.mk +++ b/git.mk @@ -172,8 +172,11 @@ gitignore-recurse-maybe: $(MAKE) $(AM_MAKEFLAGS) gitignore-recurse; \ fi; gitignore-recurse: - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \ + @for subdir in $(DIST_SUBDIRS); do \ + case " $(SUBDIRS) " in \ + *" $$subdir "*) :;; \ + *) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir");; \ + esac; \ done gitignore: $(srcdir)/.gitignore gitignore-recurse -- cgit v1.2.1 From b68d520e9ff526be4301f6db09c0faa077cd864a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 10 Feb 2010 15:30:12 +0200 Subject: Add solution and project files for Visual Studio builds The VS files are kept in build/win32/vs9, the same relative location as in GLib, mostly for historical reasons. Update README.win32 to reflect the VS possibility. Include the VS solution and project files in the tarball when doing a release. To avoid having to list source files in several locations, generate files listing source files at "make dist" time in the corresponding source directories. Use the C preprocessor to preprocess .vcprojin files that include said list files into the actual .vcproj project files. Provide a rc file for the pangocairo DLL, too. Construct and provide in the tarball a pregenerated config.h.win32 which can be used as config.h when building with Visual C without running any configure script. Provide pregenerarated module-defs.h.win32, module-defs-lang.c.win32 files too. Define PANGO_MODULE_PREFIX appropriately in the relevant module source files if not available from the compilation command line. Update module-defs-fc.c.win32 and module-defs-win32.c.win32 to match what the configure script provides. --- Makefile.am | 4 +- README.win32 | 28 ++---- build/win32/vs9/Makefile.am | 8 ++ build/win32/vs9/README.txt | 35 +++++++ build/win32/vs9/install.vcproj | 78 +++++++++++++++ build/win32/vs9/pango.sln | 79 ++++++++++++++++ build/win32/vs9/pango.vcprojin | 161 +++++++++++++++++++++++++++++++ build/win32/vs9/pango.vsprops | 137 +++++++++++++++++++++++++++ build/win32/vs9/pangocairo.vcprojin | 170 +++++++++++++++++++++++++++++++++ build/win32/vs9/pangoft2.vcprojin | 183 ++++++++++++++++++++++++++++++++++++ build/win32/vs9/pangowin32.vcproj | 165 ++++++++++++++++++++++++++++++++ build/win32/vs9/stdint.h | 36 +++++++ build/win32/vs9/unistd.h | 1 + configure.in | 9 +- modules/arabic/arabic-fc.c | 4 + modules/arabic/arabic-lang.c | 4 + modules/basic/basic-fc.c | 5 + modules/basic/basic-win32.c | 5 + modules/hangul/hangul-fc.c | 4 + modules/hebrew/hebrew-fc.c | 5 + modules/indic/indic-fc.c | 4 + modules/indic/indic-lang.c | 4 + modules/khmer/khmer-fc.c | 4 + modules/syriac/syriac-fc.c | 4 + modules/thai/thai-fc.c | 5 + modules/tibetan/tibetan-fc.c | 4 + pango/Makefile.am | 55 +++++++++-- pango/mini-fribidi/Makefile.am | 10 ++ pango/module-defs-fc.c.win32 | 40 +++----- pango/module-defs-lang.c.win32 | 11 +++ pango/module-defs-win32.c.win32 | 26 +---- pango/module-defs.h.win32 | 74 +++++++++++++++ pango/opentype/Makefile.am | 10 ++ 33 files changed, 1293 insertions(+), 79 deletions(-) create mode 100644 build/win32/vs9/Makefile.am create mode 100644 build/win32/vs9/README.txt create mode 100644 build/win32/vs9/install.vcproj create mode 100644 build/win32/vs9/pango.sln create mode 100644 build/win32/vs9/pango.vcprojin create mode 100644 build/win32/vs9/pango.vsprops create mode 100644 build/win32/vs9/pangocairo.vcprojin create mode 100644 build/win32/vs9/pangoft2.vcprojin create mode 100644 build/win32/vs9/pangowin32.vcproj create mode 100644 build/win32/vs9/stdint.h create mode 100644 build/win32/vs9/unistd.h create mode 100644 pango/module-defs-lang.c.win32 create mode 100644 pango/module-defs.h.win32 diff --git a/Makefile.am b/Makefile.am index 8b0889f2..b0b56ec6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to create Makefile.in. -SUBDIRS= pango modules pango-view examples docs tools tests +SUBDIRS= pango modules pango-view examples docs tools tests build EXTRA_DIST = \ autogen.sh \ @@ -31,9 +31,11 @@ EXTRA_DIST = \ MAINTAINERS \ HACKING \ README.win32 \ + config.h.win32 \ pango-zip.sh.in \ sanitize-la.sh \ pango.doap + MAINTAINERCLEANFILES = \ $(srcdir)/INSTALL \ $(srcdir)/aclocal.m4 \ diff --git a/README.win32 b/README.win32 index 68fcd8ab..283b6cb8 100644 --- a/README.win32 +++ b/README.win32 @@ -6,11 +6,11 @@ pangowin32). Much of the GDI font API calls are in cairo. The pangoft2 backend was originally written with Win32 in mind, but its main use nowadays is on other platforms than Win32. -There are two ways to build Pango for Win32: +There are three ways to build Pango for Win32: 1) Use gcc (mingw), libtool, make, like on Unix. -If building from CVS, run the autogen.sh script that runs aclocal, +If building from git, run the autogen.sh script that runs aclocal, automake, autoconf and configure to build makefiles etc. This is what tml@novell.com uses. Pass the same switches to autogen.sh that you would pass to the configure script. @@ -20,31 +20,15 @@ make should be enough. But, as always, you need to understand what is happening and follow the progress in case manual intervention is needed. -If you want to support complex scripts (which you should!), you need -the usp10.h header from the Platform SDK. Otherwise the basic-win32 -shaper module won' use Uniscribe and for instance Arabic and Indic -scripts will look like crap. (Yes, complex script support *is* -important. It is one of the main selling points of GTK+ and Pango.) -Pass the --with-usp10 flag to the configure script to tell it where -you have the Platform SDK (or other source of an "usp10.h" or -"include/usp10.h" file). - tml ran the configure script like this when building binaries for Pango 1.10.0: -PATH=/devel/dist/glib-2.8.0/bin:$PATH ACLOCAL_FLAGS="-I /devel/dist/glib-2.8.0/share/aclocal" PKG_CONFIG_PATH=/devel/dist/glib-2.8.0/lib/pkgconfig:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3' CPPFLAGS='-I/opt/gnu/include' LDFLAGS='-L/opt/gnu/lib' CFLAGS=-O ./configure --disable-gtk-doc --with-usp10=/opt/psdk --without-x --prefix=c:/devel/target/pango-1.10.0 - -The pango.modules file tends not to get automatically set up correctly -on Win32. Check that. Also make sure you set up a pango.aliases file -if you want to support non-Latin scripts. pango.aliases file used by -tml looks like this: +PATH=/devel/dist/glib-2.8.0/bin:$PATH ACLOCAL_FLAGS="-I /devel/dist/glib-2.8.0/share/aclocal" PKG_CONFIG_PATH=/devel/dist/glib-2.8.0/lib/pkgconfig:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3' CPPFLAGS='-I/opt/gnu/include' LDFLAGS='-L/opt/gnu/lib' CFLAGS=-O ./configure --disable-gtk-doc --without-x --prefix=c:/devel/target/pango-1.10.0 -tahoma = "tahoma,browallia new,mingliu,simhei,gulimche,ms gothic,latha,mangal" -sans = "arial,browallia new,mingliu,simhei,gulimche,ms gothic,latha,mangal" -serif = "times new roman,angsana new,mingliu,simsun,gulimche,ms gothic,latha,mangal" -monospace = "courier new,courier monothai,mingliu,simsun,gulimche,ms gothic,latha,mangal" +2) Use Visual Studio 2008. Use the solution file in +build/win32/vs9. See the README.txt there for more information. -2) Use MSVC and nmake. Use the makefile.msc makefiles. These makefiles +3) Use MSVC and nmake. Use the makefile.msc makefiles. These makefiles are supported by Hans Breuer. They requires manual editing. You need to have the source code to some suitable version of glib in a sibling directory. Ask Hans for advice. diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am new file mode 100644 index 00000000..b654ba36 --- /dev/null +++ b/build/win32/vs9/Makefile.am @@ -0,0 +1,8 @@ +EXTRA_DIST = \ + pango.sln \ + pango.vsprops \ + pango.vcproj \ + pangoft2.vcproj \ + pangowin32.vcproj \ + pangocairo.vcproj \ + install.vcproj diff --git a/build/win32/vs9/README.txt b/build/win32/vs9/README.txt new file mode 100644 index 00000000..b7c4e908 --- /dev/null +++ b/build/win32/vs9/README.txt @@ -0,0 +1,35 @@ +Note that all this is rather experimental. + +This VS9 solution and the projects it includes are intented to be used +in a Pango source tree unpacked from a tarball. In a git checkout you +first need to use some Unix-like environment or manual work to expand +files as needed, for instance the .vcprojin files here into .vcproj +files. + +Set up the source tree as follows under some arbitrary top folder +: + +\pango\ +\vs9\ + +*this* file you are now reading is thus located at +\pango\\build\win32\vs9\README.txt. + + is either Win32 or x64, as in VS9 project files. + +You should unpack the glib-dev zip file into +\vs9\, so that for instance glib.h ends up at +\vs9\\include\glib-2.0\glib.h. + +The "install" project will copy build results and headers into their +appropriate location under \vs9\. For instance, +built DLLs go into \vs9\\bin, built LIBs into +\vs9\\lib and headers into +\vs9\\include\pangpo-1.0. This is then from where +project files higher in the stack are supposed to look for them, not +from a specific Pango source tree like this one. It is important to +keep separate the concept of a "source tree", where also non-public +headers are present, and an "install tree" where only public headers +are present. + +--Tor Lillqvist diff --git a/build/win32/vs9/install.vcproj b/build/win32/vs9/install.vcproj new file mode 100644 index 00000000..3b9dad66 --- /dev/null +++ b/build/win32/vs9/install.vcproj @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/win32/vs9/pango.sln b/build/win32/vs9/pango.sln new file mode 100644 index 00000000..ededa745 --- /dev/null +++ b/build/win32/vs9/pango.sln @@ -0,0 +1,79 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pango", "pango.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangoft2", "pangoft2.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangowin32", "pangowin32.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pangocairo", "pangocairo.vcproj", "{68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install", "install.vcproj", "{FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}" + ProjectSection(ProjectDependencies) = postProject + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73} + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} = {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C72}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C73}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|Win32.Build.0 = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.ActiveCfg = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|Win32.Build.0 = Release|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C74}.Release|x64.Build.0 = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|Win32.ActiveCfg = Debug|Win32 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.ActiveCfg = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Debug|x64.Build.0 = Debug|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|Win32.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.ActiveCfg = Release|x64 + {68CC80B9-7225-4FB5-B9AB-9C1DF50B6C76}.Release|x64.Build.0 = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|Win32.Build.0 = Debug|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.ActiveCfg = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Debug|x64.Build.0 = Debug|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.ActiveCfg = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|Win32.Build.0 = Release|Win32 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.ActiveCfg = Release|x64 + {FC5AADB5-95CD-4BF0-BA8B-0C16FE7073FB}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/build/win32/vs9/pango.vcprojin b/build/win32/vs9/pango.vcprojin new file mode 100644 index 00000000..a68229e7 --- /dev/null +++ b/build/win32/vs9/pango.vcprojin @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "libpango.sourcefiles" +#include "mini-fribidi/libmini-fribidi.sourcefiles" + + + diff --git a/build/win32/vs9/pango.vsprops b/build/win32/vs9/pango.vsprops new file mode 100644 index 00000000..f2350069 --- /dev/null +++ b/build/win32/vs9/pango.vsprops @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + diff --git a/build/win32/vs9/pangocairo.vcprojin b/build/win32/vs9/pangocairo.vcprojin new file mode 100644 index 00000000..8b30b3ed --- /dev/null +++ b/build/win32/vs9/pangocairo.vcprojin @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "libpangocairo.sourcefiles" + + + diff --git a/build/win32/vs9/pangoft2.vcprojin b/build/win32/vs9/pangoft2.vcprojin new file mode 100644 index 00000000..50a757a3 --- /dev/null +++ b/build/win32/vs9/pangoft2.vcprojin @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "opentype/libharfbuzz.sourcefiles" +#include "libpangoft2.sourcefiles" + + + diff --git a/build/win32/vs9/pangowin32.vcproj b/build/win32/vs9/pangowin32.vcproj new file mode 100644 index 00000000..80e1f205 --- /dev/null +++ b/build/win32/vs9/pangowin32.vcproj @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/win32/vs9/stdint.h b/build/win32/vs9/stdint.h new file mode 100644 index 00000000..fcab43a8 --- /dev/null +++ b/build/win32/vs9/stdint.h @@ -0,0 +1,36 @@ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef long long int_least64_t; +typedef unsigned long long uint_least64_t; +typedef char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +typedef long long int_fast64_t; +typedef unsigned long long uint_fast64_t; +#ifdef _WIN64 +typedef __int64 intptr_t; +#else +typedef int intptr_t; +#endif +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +typedef __int64 intmax_t; +typedef unsigned __int64 uintmax_t; diff --git a/build/win32/vs9/unistd.h b/build/win32/vs9/unistd.h new file mode 100644 index 00000000..8655b1d5 --- /dev/null +++ b/build/win32/vs9/unistd.h @@ -0,0 +1 @@ +#include diff --git a/configure.in b/configure.in index 8e2bebc5..2e03066a 100644 --- a/configure.in +++ b/configure.in @@ -758,9 +758,9 @@ for module in $included_modules; do module_c=`echo $module | sed s/-/_/` cat >> pango/module-defs.h < +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_arabic_lang +#endif + #include "pango-engine.h" #include "pango-break.h" diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c index 6e0d2ef2..c3907785 100644 --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@ -26,6 +26,11 @@ #include #include + +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_basic_fc +#endif + #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index ecb139e0..1565a7c7 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -30,6 +30,11 @@ #include #include "pangowin32.h" + +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_basic_win32 +#endif + #include "pango-engine.h" #include "pango-utils.h" diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 7692a843..ab542e8f 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -23,6 +23,10 @@ #include "config.h" #include +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_hangul_fc +#endif + #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c index fcfed2b4..056a4ff2 100644 --- a/modules/hebrew/hebrew-fc.c +++ b/modules/hebrew/hebrew-fc.c @@ -27,6 +27,11 @@ #include #include + +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_hebrew_fc +#endif + #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index 3a232be4..ef94a4d4 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -27,6 +27,10 @@ #include "indic-ot.h" +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_indic_fc +#endif + #include "pango-engine.h" #include "pango-ot.h" #include "pango-utils.h" diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c index dc01b6fe..f8b563ed 100644 --- a/modules/indic/indic-lang.c +++ b/modules/indic/indic-lang.c @@ -23,6 +23,10 @@ #include "config.h" #include +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_indic_lang +#endif + #include "pango-engine.h" #include "pango-break.h" diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c index 14357d78..7fb21723 100644 --- a/modules/khmer/khmer-fc.c +++ b/modules/khmer/khmer-fc.c @@ -59,6 +59,10 @@ #include "config.h" #include +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_khmer_fc +#endif + #include "pango-engine.h" #include "pango-ot.h" #include "pango-utils.h" diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c index 7ba05fb4..6d7ed634 100644 --- a/modules/syriac/syriac-fc.c +++ b/modules/syriac/syriac-fc.c @@ -28,6 +28,10 @@ #include "syriac-ot.h" +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_syriac_fc +#endif + #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c index 837a0286..f41135a5 100644 --- a/modules/thai/thai-fc.c +++ b/modules/thai/thai-fc.c @@ -32,6 +32,11 @@ #include #include "pango-ot.h" + +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_thai_fc +#endif + #include "pango-engine.h" #include "pangofc-font.h" diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c index 4e894165..c49f4007 100644 --- a/modules/tibetan/tibetan-fc.c +++ b/modules/tibetan/tibetan-fc.c @@ -67,6 +67,10 @@ #include "config.h" #include +#ifndef PANGO_MODULE_PREFIX +#define PANGO_MODULE_PREFIX _pango_tibetan_fc +#endif + #include "pango-engine.h" #include "pango-ot.h" #include "pango-utils.h" diff --git a/pango/Makefile.am b/pango/Makefile.am index cef644f1..ce3d0b77 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -14,8 +14,6 @@ if HAVE_FREETYPE OPENTYPE_SUBDIR=opentype endif -EXTRA_DIST = - FRIBIDI_SUBDIR=mini-fribidi SUBDIRS = $(OPENTYPE_SUBDIR) $(FRIBIDI_SUBDIR) @@ -350,18 +348,23 @@ libpangocairo_1_0_la_LIBADD = \ $(libm) libpangocairo_1_0_la_DEPENDENCIES = \ libpango-$(PANGO_API_VERSION).la -libpangocairo_1_0_la_SOURCES = \ +pangocairo_core_sources = \ pangocairo-context.c \ pangocairo-font.c \ pangocairo-fontmap.c \ pangocairo-render.c \ pangocairo-private.h +libpangocairo_1_0_la_SOURCES = $(pangocairo_core_sources) + if HAVE_CAIRO_WIN32 if PLATFORM_WIN32 -libpangocairo_1_0_la_LDFLAGS += -export-symbols $(srcdir)/pangocairo.def -libpangocairo_1_0_la_DEPENDENCIES += pangocairo.def +libpangocairo_1_0_la_LDFLAGS += -export-symbols $(srcdir)/pangocairo.def -Wl,pangocairo-win32-res.o +libpangocairo_1_0_la_DEPENDENCIES += pangocairo-win32-res.o pangocairo.def endif +pangocairo-win32-res.o: pangocairo.rc + $(AM_V_GEN) $(WINDRES) $< $@ + libpangocairo_1_0_la_LIBADD += libpangowin32-$(PANGO_API_VERSION).la $(WIN32_LIBS) libpangocairo_1_0_la_DEPENDENCIES += libpangowin32-$(PANGO_API_VERSION).la @@ -556,9 +559,11 @@ pango_querymodules_LDADD += libpangowin32-$(PANGO_API_VERSION).la endif pango_querymodules_LDADD += libpango-$(PANGO_API_VERSION).la $(GLIB_LIBS) -EXTRA_DIST += \ +EXTRA_DIST = \ pango-enum-types.h \ module-defs.h \ + module-defs.h.win32 \ + module-defs-lang.c.win32 \ module-defs-fc.c.win32 \ module-defs-win32.c.win32 \ pango.def \ @@ -573,6 +578,8 @@ EXTRA_DIST += \ pangoft2.rc.in \ pangowin32.rc \ pangowin32.rc.in \ + pangocairo.rc \ + pangocairo.rc.in \ pangox.rc \ pangox.rc.in \ pangoxft.rc \ @@ -630,4 +637,40 @@ uninstall-local: uninstall-ms-lib uninstall-def-files TESTS = check.defs +dist-hook: \ + ../build/win32/vs9/pango.vcproj \ + ../build/win32/vs9/pangoft2.vcproj \ + ../build/win32/vs9/pangocairo.vcproj + +# pangowin32.vcproj is not automatically built, it is not being changed + +../build/win32/vs9/pango.vcproj: $(top_srcdir)/build/win32/vs9/pango.vcprojin mini-fribidi/libmini-fribidi.sourcefiles + for F in $(libpango_1_0_la_SOURCES); do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >libpango.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pango.vcprojin >$@ + +../build/win32/vs9/pangoft2.vcproj: $(top_srcdir)/build/win32/vs9/pangoft2.vcprojin opentype/libharfbuzz.sourcefiles + for F in $(libpangoft2_1_0_la_SOURCES); do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >libpangoft2.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pangoft2.vcprojin >$@ + +../build/win32/vs9/pangocairo.vcproj: $(top_srcdir)/build/win32/vs9/pangocairo.vcprojin +# Backend-specific sources for the libpangocairo DLL are explicitly +# listed in the vcprojin file + for F in $(pangocairo_core_sources); do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >libpangocairo.sourcefiles + $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pangocairo.vcprojin >$@ + -include $(top_srcdir)/git.mk diff --git a/pango/mini-fribidi/Makefile.am b/pango/mini-fribidi/Makefile.am index a9e08d6e..a0baa6b0 100644 --- a/pango/mini-fribidi/Makefile.am +++ b/pango/mini-fribidi/Makefile.am @@ -30,4 +30,14 @@ EXTRA_DIST = \ fribidi_types.i +dist-hook: libmini-fribidi.sourcefiles + +libmini-fribidi.sourcefiles: Makefile + for F in $(libmini_fribidi_la_SOURCES); do \ + case $$F in \ + *.c) echo ' ' \ + ;; \ + esac; \ + done >libmini-fribidi.sourcefiles + -include $(top_srcdir)/git.mk diff --git a/pango/module-defs-fc.c.win32 b/pango/module-defs-fc.c.win32 index a6ae1cff..7a44537c 100644 --- a/pango/module-defs-fc.c.win32 +++ b/pango/module-defs-fc.c.win32 @@ -1,31 +1,17 @@ -/* Hand-written. Once the GNU configure mechanism is used - * on Win32, too, can be generated. -*/ +/* Autogenerated by configure and then saved for use when compiling with + Visual C. */ -#include "modules.h" - -#ifdef PANGO_MODULE_PREFIX -/* by defining PANGO_MODULE_PREFIX the basic module gets include in the - * backend library, here ../modules/basic/basic-fc.c - * It helps the backend to not fall on its nose even with a screwed module - * configuration. There should be at least enough fonts available to show - * an error message ... - */ -void _pango_basic_ft2_script_engine_list (PangoEngineInfo **engines, - gint *n_engines); -void _pango_basic_ft2_script_engine_init (GTypeModule *module); -void _pango_basic_ft2_script_engine_exit (void); -PangoEngine *_pango_basic_ft2_script_engine_create (const char *id); -#endif +#include "module-defs.h" PangoIncludedModule _pango_included_fc_modules[] = { -#ifdef PANGO_MODULE_PREFIX - { - _pango_basic_ft2_script_engine_list, - _pango_basic_ft2_script_engine_init, - _pango_basic_ft2_script_engine_exit, - _pango_basic_ft2_script_engine_create - }, -#endif - { NULL, NULL, NULL }, + { _pango_arabic_fc_script_engine_list, _pango_arabic_fc_script_engine_init, _pango_arabic_fc_script_engine_exit, _pango_arabic_fc_script_engine_create }, + { _pango_basic_fc_script_engine_list, _pango_basic_fc_script_engine_init, _pango_basic_fc_script_engine_exit, _pango_basic_fc_script_engine_create }, + { _pango_hangul_fc_script_engine_list, _pango_hangul_fc_script_engine_init, _pango_hangul_fc_script_engine_exit, _pango_hangul_fc_script_engine_create }, + { _pango_hebrew_fc_script_engine_list, _pango_hebrew_fc_script_engine_init, _pango_hebrew_fc_script_engine_exit, _pango_hebrew_fc_script_engine_create }, + { _pango_indic_fc_script_engine_list, _pango_indic_fc_script_engine_init, _pango_indic_fc_script_engine_exit, _pango_indic_fc_script_engine_create }, + { _pango_khmer_fc_script_engine_list, _pango_khmer_fc_script_engine_init, _pango_khmer_fc_script_engine_exit, _pango_khmer_fc_script_engine_create }, + { _pango_syriac_fc_script_engine_list, _pango_syriac_fc_script_engine_init, _pango_syriac_fc_script_engine_exit, _pango_syriac_fc_script_engine_create }, + { _pango_thai_fc_script_engine_list, _pango_thai_fc_script_engine_init, _pango_thai_fc_script_engine_exit, _pango_thai_fc_script_engine_create }, + { _pango_tibetan_fc_script_engine_list, _pango_tibetan_fc_script_engine_init, _pango_tibetan_fc_script_engine_exit, _pango_tibetan_fc_script_engine_create }, + { NULL, NULL, NULL, NULL }, }; diff --git a/pango/module-defs-lang.c.win32 b/pango/module-defs-lang.c.win32 new file mode 100644 index 00000000..d1fe979d --- /dev/null +++ b/pango/module-defs-lang.c.win32 @@ -0,0 +1,11 @@ +/* Autogenerated and saved for builds using Microsoft's compiler, + * when the configure mechanism isn't used. + */ + +#include "module-defs.h" + +PangoIncludedModule _pango_included_lang_modules[] = { + { _pango_arabic_lang_script_engine_list, _pango_arabic_lang_script_engine_init, _pango_arabic_lang_script_engine_exit, _pango_arabic_lang_script_engine_create }, + { _pango_indic_lang_script_engine_list, _pango_indic_lang_script_engine_init, _pango_indic_lang_script_engine_exit, _pango_indic_lang_script_engine_create }, + { NULL, NULL, NULL, NULL }, +}; diff --git a/pango/module-defs-win32.c.win32 b/pango/module-defs-win32.c.win32 index 80fc90a3..5c1698c6 100644 --- a/pango/module-defs-win32.c.win32 +++ b/pango/module-defs-win32.c.win32 @@ -1,25 +1,9 @@ -/* Hand-written, for builds using Microsoft's compiler and makefile.msc, - * where the configure mechanism isn't used. - */ +/* Autogenerated by configure and then saved for use when compiling with + Visual C. */ -#include "modules.h" - -#ifdef PANGO_MODULE_PREFIX -void _pango_basic_win32_script_engine_list (PangoEngineInfo **engines, - gint *n_engines); -void _pango_basic_win32_script_engine_init (GTypeModule *module); -void _pango_basic_win32_script_engine_exit (void); -PangoEngine *_pango_basic_win32_script_engine_create (const char *id); -#endif +#include "module-defs.h" PangoIncludedModule _pango_included_win32_modules[] = { -#ifdef PANGO_MODULE_PREFIX - { - _pango_basic_win32_script_engine_list, - _pango_basic_win32_script_engine_init, - _pango_basic_win32_script_engine_exit, - _pango_basic_win32_script_engine_create - }, -#endif - { NULL, NULL, NULL }, + { _pango_basic_win32_script_engine_list, _pango_basic_win32_script_engine_init, _pango_basic_win32_script_engine_exit, _pango_basic_win32_script_engine_create }, + { NULL, NULL, NULL, NULL }, }; diff --git a/pango/module-defs.h.win32 b/pango/module-defs.h.win32 new file mode 100644 index 00000000..463935ef --- /dev/null +++ b/pango/module-defs.h.win32 @@ -0,0 +1,74 @@ +/* Autogenerated by configure and then saved for use when compiling with + Visual C. */ + +#include "modules.h" + +extern void _pango_arabic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_arabic_fc_script_engine_init (GTypeModule *module); +extern void _pango_arabic_fc_script_engine_exit (void); +extern PangoEngine *_pango_arabic_fc_script_engine_create (const char *id); + +extern void _pango_arabic_lang_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_arabic_lang_script_engine_init (GTypeModule *module); +extern void _pango_arabic_lang_script_engine_exit (void); +extern PangoEngine *_pango_arabic_lang_script_engine_create (const char *id); + +extern void _pango_basic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_basic_fc_script_engine_init (GTypeModule *module); +extern void _pango_basic_fc_script_engine_exit (void); +extern PangoEngine *_pango_basic_fc_script_engine_create (const char *id); + +extern void _pango_basic_win32_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_basic_win32_script_engine_init (GTypeModule *module); +extern void _pango_basic_win32_script_engine_exit (void); +extern PangoEngine *_pango_basic_win32_script_engine_create (const char *id); + +extern void _pango_basic_x_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_basic_x_script_engine_init (GTypeModule *module); +extern void _pango_basic_x_script_engine_exit (void); +extern PangoEngine *_pango_basic_x_script_engine_create (const char *id); + +extern void _pango_basic_atsui_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_basic_atsui_script_engine_init (GTypeModule *module); +extern void _pango_basic_atsui_script_engine_exit (void); +extern PangoEngine *_pango_basic_atsui_script_engine_create (const char *id); + +extern void _pango_hangul_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_hangul_fc_script_engine_init (GTypeModule *module); +extern void _pango_hangul_fc_script_engine_exit (void); +extern PangoEngine *_pango_hangul_fc_script_engine_create (const char *id); + +extern void _pango_hebrew_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_hebrew_fc_script_engine_init (GTypeModule *module); +extern void _pango_hebrew_fc_script_engine_exit (void); +extern PangoEngine *_pango_hebrew_fc_script_engine_create (const char *id); + +extern void _pango_indic_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_indic_fc_script_engine_init (GTypeModule *module); +extern void _pango_indic_fc_script_engine_exit (void); +extern PangoEngine *_pango_indic_fc_script_engine_create (const char *id); + +extern void _pango_indic_lang_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_indic_lang_script_engine_init (GTypeModule *module); +extern void _pango_indic_lang_script_engine_exit (void); +extern PangoEngine *_pango_indic_lang_script_engine_create (const char *id); + +extern void _pango_khmer_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_khmer_fc_script_engine_init (GTypeModule *module); +extern void _pango_khmer_fc_script_engine_exit (void); +extern PangoEngine *_pango_khmer_fc_script_engine_create (const char *id); + +extern void _pango_syriac_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_syriac_fc_script_engine_init (GTypeModule *module); +extern void _pango_syriac_fc_script_engine_exit (void); +extern PangoEngine *_pango_syriac_fc_script_engine_create (const char *id); + +extern void _pango_thai_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_thai_fc_script_engine_init (GTypeModule *module); +extern void _pango_thai_fc_script_engine_exit (void); +extern PangoEngine *_pango_thai_fc_script_engine_create (const char *id); + +extern void _pango_tibetan_fc_script_engine_list (PangoEngineInfo **engines, int *n_engines); +extern void _pango_tibetan_fc_script_engine_init (GTypeModule *module); +extern void _pango_tibetan_fc_script_engine_exit (void); +extern PangoEngine *_pango_tibetan_fc_script_engine_create (const char *id); diff --git a/pango/opentype/Makefile.am b/pango/opentype/Makefile.am index ebec8ce6..23bb55b3 100644 --- a/pango/opentype/Makefile.am +++ b/pango/opentype/Makefile.am @@ -55,4 +55,14 @@ main_LDADD = libharfbuzz.la $(GLIB_LIBS) EXTRA_DIST = README COPYING +dist-hook: libharfbuzz.sourcefiles + +libharfbuzz.sourcefiles: Makefile + for F in $(libharfbuzz_la_SOURCES); do \ + case $$F in \ + *.c|*.cc) echo ' ' \ + ;; \ + esac; \ + done >libharfbuzz.sourcefiles + -include $(top_srcdir)/git.mk -- cgit v1.2.1 From d5264003d594ae5e4d24eda4942a7cae0d39cbba Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 15 Mar 2010 23:28:51 +0200 Subject: Add a couple of files accidentally left out in previous commit --- build/Makefile.am | 1 + build/win32/Makefile.am | 1 + config.h.win32.in | 151 ++++++++++++++++++++++++++++++++++++++++++++++++ pango/pangocairo.rc.in | 30 ++++++++++ 4 files changed, 183 insertions(+) create mode 100644 build/Makefile.am create mode 100644 build/win32/Makefile.am create mode 100644 config.h.win32.in create mode 100644 pango/pangocairo.rc.in diff --git a/build/Makefile.am b/build/Makefile.am new file mode 100644 index 00000000..0f81afe3 --- /dev/null +++ b/build/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = win32 diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am new file mode 100644 index 00000000..ea035c25 --- /dev/null +++ b/build/win32/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = vs9 diff --git a/config.h.win32.in b/config.h.win32.in new file mode 100644 index 00000000..1864ad04 --- /dev/null +++ b/config.h.win32.in @@ -0,0 +1,151 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ +/* Actually, this version of config.h is manually edited from the above */ + +/* Have usable Cairo library and font backend */ +#define HAVE_CAIRO 1 + +/* Whether Cairo can use ATSUI for fonts */ +/* #undef HAVE_CAIRO_ATSUI */ + +/* Whether Cairo can use FreeType for fonts */ +#define HAVE_CAIRO_FREETYPE 1 + +/* Whether Cairo has PDF support */ +#define HAVE_CAIRO_PDF 1 + +/* Whether Cairo has PNG support */ +#define HAVE_CAIRO_PNG 1 + +/* Whether Cairo has PS support */ +#define HAVE_CAIRO_PS 1 + +/* Whether Cairo can use the Win32 GDI for fonts */ +#define HAVE_CAIRO_WIN32 1 + +/* Whether Cairo has Xlib support */ +/* #undef HAVE_CAIRO_XLIB */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_DIRENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ + +/* Define to 1 if you have the `flockfile' function. */ +/* #undef HAVE_FLOCKFILE */ + +/* Have FreeType 2 library */ +#define HAVE_FREETYPE 1 + +/* Define to 1 if you have the `getpagesize' function. */ +/* #undef HAVE_GETPAGESIZE */ + +/* Define to 1 if you have the header file. */ +/*#undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ + +/* Define to 1 if you have the `mprotect' function. */ +/* #undef HAVE_MPROTECT */ + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDINT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtok_r' function. */ +/* #undef HAVE_STRTOK_R */ + +/* Define to 1 if you have the `sysconf' function. */ +/* #undef HAVE_SYSCONF */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MMAN_H */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Have X libraries */ +/* #undef HAVE_X */ + +/* Have Xft library */ +/* #undef HAVE_XFT */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Module interface version */ +#define MODULE_VERSION "1.6.0" + +/* Name of package */ +#define PACKAGE "pango" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=pango" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pango" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pango @PANGO_VERSION" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pango" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "@PANGO_VERSION@" + +/* PANGO binary age */ +#define PANGO_BINARY_AGE @PANGO_BINARY_AGE@ + +/* PANGO interface age */ +#define PANGO_INTERFACE_AGE @PANGO_INTERFACE_AGE@ + +/* PANGO major version */ +#define PANGO_VERSION_MAJOR @PANEG_VERSION_MAJOR@ + +/* PANGO micro version */ +#define PANGO_VERSION_MICRO @PANGO_VERSION_MICRO@ + +/* PANGO minor version */ +#define PANGO_VERSION_MINOR @PANGO_VERSION_MINOR@ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Whether to load modules via .la files rather than directly */ +/* #undef USE_LA_MODULES */ + +/* Version number of package */ +#define VERSION "@PANGO_VERSION@" + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ diff --git a/pango/pangocairo.rc.in b/pango/pangocairo.rc.in new file mode 100644 index 00000000..728cce70 --- /dev/null +++ b/pango/pangocairo.rc.in @@ -0,0 +1,30 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + PRODUCTVERSION @PANGO_VERSION_MAJOR@,@PANGO_VERSION_MINOR@,@PANGO_VERSION_MICRO@,0 + FILEFLAGSMASK 0 + FILEFLAGS 0 + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "Red Hat Software" + VALUE "FileDescription", "PangoCairo" + VALUE "FileVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@.0" + VALUE "InternalName", "pangocairo-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@" + VALUE "LegalCopyright", "Copyright © 2010 Red Hat Software." + VALUE "OriginalFilename", "pangocairo-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll" + VALUE "ProductName", "PangoCairo" + VALUE "ProductVersion", "@PANGO_VERSION_MAJOR@.@PANGO_VERSION_MINOR@.@PANGO_VERSION_MICRO@" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END + END -- cgit v1.2.1 From 27c81605322cab7ed738f51627a33ce640327d17 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 15 Mar 2010 23:44:01 +0200 Subject: Build fix on Linux after previous commits --- modules/arabic/arabic-fc.c | 2 +- modules/arabic/arabic-lang.c | 2 +- modules/basic/basic-fc.c | 2 +- modules/hangul/hangul-fc.c | 2 +- modules/hebrew/hebrew-fc.c | 2 +- modules/indic/indic-fc.c | 2 +- modules/indic/indic-lang.c | 2 +- modules/khmer/khmer-fc.c | 2 +- modules/syriac/syriac-fc.c | 2 +- modules/thai/thai-fc.c | 2 +- modules/tibetan/tibetan-fc.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c index ff1ef0ab..0710ac94 100644 --- a/modules/arabic/arabic-fc.c +++ b/modules/arabic/arabic-fc.c @@ -27,7 +27,7 @@ #include "arabic-ot.h" -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_arabic_fc #endif diff --git a/modules/arabic/arabic-lang.c b/modules/arabic/arabic-lang.c index e17486c9..60fa11e3 100644 --- a/modules/arabic/arabic-lang.c +++ b/modules/arabic/arabic-lang.c @@ -25,7 +25,7 @@ #include "config.h" #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_arabic_lang #endif diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c index c3907785..3f349d22 100644 --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@ -27,7 +27,7 @@ #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_basic_fc #endif diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index ab542e8f..18a9c61f 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -23,7 +23,7 @@ #include "config.h" #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_hangul_fc #endif diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c index 056a4ff2..e668b871 100644 --- a/modules/hebrew/hebrew-fc.c +++ b/modules/hebrew/hebrew-fc.c @@ -28,7 +28,7 @@ #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_hebrew_fc #endif diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index ef94a4d4..0f8a767a 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -27,7 +27,7 @@ #include "indic-ot.h" -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_indic_fc #endif diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c index f8b563ed..84f3e49a 100644 --- a/modules/indic/indic-lang.c +++ b/modules/indic/indic-lang.c @@ -23,7 +23,7 @@ #include "config.h" #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_indic_lang #endif diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c index 7fb21723..eb5e24b1 100644 --- a/modules/khmer/khmer-fc.c +++ b/modules/khmer/khmer-fc.c @@ -59,7 +59,7 @@ #include "config.h" #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_khmer_fc #endif diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c index 6d7ed634..9b8e3c9b 100644 --- a/modules/syriac/syriac-fc.c +++ b/modules/syriac/syriac-fc.c @@ -28,7 +28,7 @@ #include "syriac-ot.h" -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_syriac_fc #endif diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c index f41135a5..7e4f2d0a 100644 --- a/modules/thai/thai-fc.c +++ b/modules/thai/thai-fc.c @@ -33,7 +33,7 @@ #include #include "pango-ot.h" -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_thai_fc #endif diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c index c49f4007..0c94f211 100644 --- a/modules/tibetan/tibetan-fc.c +++ b/modules/tibetan/tibetan-fc.c @@ -67,7 +67,7 @@ #include "config.h" #include -#ifndef PANGO_MODULE_PREFIX +#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) #define PANGO_MODULE_PREFIX _pango_tibetan_fc #endif -- cgit v1.2.1 From d9e254f3220337577b22f229839e036f344ce048 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 16 Mar 2010 00:46:24 +0200 Subject: Put the PANGO_MODULE_PREFIX defines in the project files Put the PANGO_MODULE_PREFIX defines in the project files instead of having them behind an ifdef in the source files. --- build/win32/vs9/pango.vcprojin | 54 ++++++++- build/win32/vs9/pangoft2.vcprojin | 243 ++++++++++++++++++++++++++++++++++++-- modules/arabic/arabic-fc.c | 4 - modules/arabic/arabic-lang.c | 4 - modules/basic/basic-fc.c | 4 - modules/hangul/hangul-fc.c | 4 - modules/hebrew/hebrew-fc.c | 4 - modules/indic/indic-fc.c | 4 - modules/indic/indic-lang.c | 4 - modules/khmer/khmer-fc.c | 4 - modules/syriac/syriac-fc.c | 4 - modules/thai/thai-fc.c | 4 - modules/tibetan/tibetan-fc.c | 4 - 13 files changed, 286 insertions(+), 55 deletions(-) diff --git a/build/win32/vs9/pango.vcprojin b/build/win32/vs9/pango.vcprojin index a68229e7..ad7db04f 100644 --- a/build/win32/vs9/pango.vcprojin +++ b/build/win32/vs9/pango.vcprojin @@ -152,8 +152,58 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + #include "libpango.sourcefiles" #include "mini-fribidi/libmini-fribidi.sourcefiles" diff --git a/build/win32/vs9/pangoft2.vcprojin b/build/win32/vs9/pangoft2.vcprojin index 50a757a3..caf6e928 100644 --- a/build/win32/vs9/pangoft2.vcprojin +++ b/build/win32/vs9/pangoft2.vcprojin @@ -159,23 +159,248 @@ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + #include "opentype/libharfbuzz.sourcefiles" #include "libpangoft2.sourcefiles" diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c index 0710ac94..4b024e14 100644 --- a/modules/arabic/arabic-fc.c +++ b/modules/arabic/arabic-fc.c @@ -27,10 +27,6 @@ #include "arabic-ot.h" -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_arabic_fc -#endif - #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/arabic/arabic-lang.c b/modules/arabic/arabic-lang.c index 60fa11e3..ee23bad1 100644 --- a/modules/arabic/arabic-lang.c +++ b/modules/arabic/arabic-lang.c @@ -25,10 +25,6 @@ #include "config.h" #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_arabic_lang -#endif - #include "pango-engine.h" #include "pango-break.h" diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c index 3f349d22..e3852c39 100644 --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@ -27,10 +27,6 @@ #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_basic_fc -#endif - #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 18a9c61f..7692a843 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -23,10 +23,6 @@ #include "config.h" #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_hangul_fc -#endif - #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c index e668b871..12f25c5e 100644 --- a/modules/hebrew/hebrew-fc.c +++ b/modules/hebrew/hebrew-fc.c @@ -28,10 +28,6 @@ #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_hebrew_fc -#endif - #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c index 0f8a767a..3a232be4 100644 --- a/modules/indic/indic-fc.c +++ b/modules/indic/indic-fc.c @@ -27,10 +27,6 @@ #include "indic-ot.h" -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_indic_fc -#endif - #include "pango-engine.h" #include "pango-ot.h" #include "pango-utils.h" diff --git a/modules/indic/indic-lang.c b/modules/indic/indic-lang.c index 84f3e49a..dc01b6fe 100644 --- a/modules/indic/indic-lang.c +++ b/modules/indic/indic-lang.c @@ -23,10 +23,6 @@ #include "config.h" #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_indic_lang -#endif - #include "pango-engine.h" #include "pango-break.h" diff --git a/modules/khmer/khmer-fc.c b/modules/khmer/khmer-fc.c index eb5e24b1..14357d78 100644 --- a/modules/khmer/khmer-fc.c +++ b/modules/khmer/khmer-fc.c @@ -59,10 +59,6 @@ #include "config.h" #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_khmer_fc -#endif - #include "pango-engine.h" #include "pango-ot.h" #include "pango-utils.h" diff --git a/modules/syriac/syriac-fc.c b/modules/syriac/syriac-fc.c index 9b8e3c9b..7ba05fb4 100644 --- a/modules/syriac/syriac-fc.c +++ b/modules/syriac/syriac-fc.c @@ -28,10 +28,6 @@ #include "syriac-ot.h" -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_syriac_fc -#endif - #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c index 7e4f2d0a..80c945da 100644 --- a/modules/thai/thai-fc.c +++ b/modules/thai/thai-fc.c @@ -33,10 +33,6 @@ #include #include "pango-ot.h" -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_thai_fc -#endif - #include "pango-engine.h" #include "pangofc-font.h" diff --git a/modules/tibetan/tibetan-fc.c b/modules/tibetan/tibetan-fc.c index 0c94f211..4e894165 100644 --- a/modules/tibetan/tibetan-fc.c +++ b/modules/tibetan/tibetan-fc.c @@ -67,10 +67,6 @@ #include "config.h" #include -#if defined(G_OS_WIN32) && !defined(PANGO_MODULE_PREFIX) -#define PANGO_MODULE_PREFIX _pango_tibetan_fc -#endif - #include "pango-engine.h" #include "pango-ot.h" #include "pango-utils.h" -- cgit v1.2.1 From 7ee9ab4b2519131a9753499175ec43871232c84d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 16 Mar 2010 03:15:00 -0400 Subject: [HB] Cosmetic --- pango/opentype/hb-ot-layout-common-private.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index 70c8774a..442aad26 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -593,9 +593,9 @@ struct Device } private: - USHORT startSize; /* Smallest size to correct--in ppem */ - USHORT endSize; /* Largest size to correct--in ppem */ - USHORT deltaFormat; /* Format of DeltaValue array data: 1, 2, or 3 */ + USHORT startSize; /* Smallest size to correct--in ppem */ + USHORT endSize; /* Largest size to correct--in ppem */ + USHORT deltaFormat; /* Format of DeltaValue array data: 1, 2, or 3 */ USHORT deltaValue[VAR]; /* Array of compressed data */ }; ASSERT_SIZE_VAR (Device, 6, USHORT); -- cgit v1.2.1 From 9cac172f82dd492d068590434199989021be236e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 16 Mar 2010 03:46:17 -0400 Subject: [HB] Fix the mystery bug! A couple bugs joined forces to exhibit the mystery behavior of crashes / infinite loops on OS X / wrong kerning / invalid memory access. Pooh! The bugs were involved: - Wrong pointer math with ValueRecord in PairPosFormat1 - Fallout from avoiding flex arrays, code not correctly updated to remove sizeof() usage. We strictly never use sizeof() directly now. And the PairPos code is cleaned up. Should fix them all. Bugs are: Bug 605655 - Pango 1.26.2 introduces kerning bug Bug 611229 - Pango reads from uninitialized memory Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X We were also doing wrong math converting Device adjustments to hb_position_t. Fallout from FreeType days. Should shift 16, not 6. Fixed that too. There's still another bug: we don't sanitize Device records referenced from value records. Fixing that also. --- pango/opentype/hb-open-file-private.hh | 4 ++- pango/opentype/hb-open-type-private.hh | 11 ++++---- pango/opentype/hb-ot-layout-common-private.hh | 10 +++++-- pango/opentype/hb-ot-layout-gpos-private.hh | 37 ++++++++++++++----------- pango/opentype/hb-ot-layout-gsubgpos-private.hh | 15 +++++----- 5 files changed, 46 insertions(+), 31 deletions(-) diff --git a/pango/opentype/hb-open-file-private.hh b/pango/opentype/hb-open-file-private.hh index dda6b945..0947747d 100644 --- a/pango/opentype/hb-open-file-private.hh +++ b/pango/opentype/hb-open-file-private.hh @@ -47,6 +47,8 @@ struct TTCHeader; typedef struct TableDirectory { + static inline unsigned int get_size () { return sizeof (TableDirectory); } + inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE (tag) && @@ -108,7 +110,7 @@ typedef struct OffsetTable public: inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { TRACE_SANITIZE (); - if (!(SANITIZE_SELF () && SANITIZE_MEM (tableDir, sizeof (tableDir[0]) * numTables))) return false; + if (!(SANITIZE_SELF () && SANITIZE_MEM (tableDir, tableDir[0].get_size () * numTables))) return false; unsigned int count = numTables; for (unsigned int i = 0; i < count; i++) if (!SANITIZE_BASE (tableDir[i], base)) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index f460f1a2..06324ee3 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -50,8 +50,8 @@ #define CONST_NEXT(T,X) (*(reinterpret_cast(CONST_CHARP(&(X)) + (X).get_size ()))) #define NEXT(T,X) (*(reinterpret_cast(CHARP(&(X)) + (X).get_size ()))) -#define CONST_ARRAY_AFTER(T,X) ((reinterpret_cast(CONST_CHARP(&(X)) + sizeof (X)))) -#define ARRAY_AFTER(T,X) ((reinterpret_cast(CHARP(&(X)) + sizeof (X)))) +#define CONST_ARRAY_AFTER(T,X) ((reinterpret_cast(CONST_CHARP(&(X)) + X.get_size ()))) +#define ARRAY_AFTER(T,X) ((reinterpret_cast(CHARP(&(X)) + X.get_size ()))) /* * Class features @@ -362,6 +362,7 @@ struct Sanitizer #define DEFINE_INT_TYPE1(NAME, TYPE, BIG_ENDIAN, BYTES) \ struct NAME \ { \ + static inline unsigned int get_size () { return BYTES; } \ inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \ inline bool operator== (NAME o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ @@ -424,7 +425,7 @@ struct CheckSum : ULONG static uint32_t CalcTableChecksum (ULONG *Table, uint32_t Length) { uint32_t Sum = 0L; - ULONG *EndPtr = Table+((Length+3) & ~3) / sizeof(ULONG); + ULONG *EndPtr = Table+((Length+3) & ~3) / ULONG::get_size (); while (Table < EndPtr) Sum += *Table++; @@ -517,7 +518,7 @@ struct GenericArrayOf return const_array()[i]; } inline unsigned int get_size () const - { return sizeof (len) + len * sizeof (Type); } + { return len.get_size () + len * Type::get_size (); } inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); @@ -620,7 +621,7 @@ struct HeadlessArrayOf return const_array()[i-1]; } inline unsigned int get_size () const - { return sizeof (len) + (len ? len - 1 : 0) * sizeof (Type); } + { return len.get_size () + (len ? len - 1 : 0) * Type::get_size (); } inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index 442aad26..aff14689 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -51,6 +51,8 @@ template struct Record { + static inline unsigned int get_size () { return sizeof (Record); } + inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { TRACE_SANITIZE (); return SANITIZE (tag) && SANITIZE_BASE (offset, base); @@ -348,6 +350,8 @@ struct CoverageRangeRecord { friend struct CoverageFormat2; + static inline unsigned int get_size () { return sizeof (CoverageRangeRecord); } + private: inline unsigned int get_coverage (hb_codepoint_t glyph_id) const { @@ -466,6 +470,8 @@ struct ClassRangeRecord { friend struct ClassDefFormat2; + static inline unsigned int get_size () { return sizeof (ClassRangeRecord); } + private: inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const { @@ -583,8 +589,8 @@ struct Device inline unsigned int get_size () const { unsigned int f = deltaFormat; - if (HB_UNLIKELY (f < 1 || f > 3 || startSize > endSize)) return sizeof (*this); - return sizeof (*this) + ((endSize - startSize + (1 << (4 - f)) - 1) >> (4 - f)); + if (HB_UNLIKELY (f < 1 || f > 3 || startSize > endSize)) return 3 * USHORT::get_size (); + return 3 * USHORT::get_size () + ((endSize - startSize + (1 << (4 - f)) - 1) >> (4 - f)); } inline bool sanitize (SANITIZE_ARG_DEF) { diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index 81b7fa15..be7b5a5c 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -57,7 +57,7 @@ struct ValueFormat : USHORT inline unsigned int get_len () const { return _hb_popcount32 ((unsigned int) *this); } inline unsigned int get_size () const - { return get_len () * sizeof (Value); } + { return get_len () * Value::get_size (); } void apply_value (hb_ot_layout_context_t *context, const char *base, @@ -117,25 +117,25 @@ struct ValueRecord { /* pixel -> fractional pixel */ if (format & xPlaDevice) { if (x_ppem) - glyph_pos->x_pos += (base+*(OffsetTo*)values++).get_delta (x_ppem) << 6; + glyph_pos->x_pos += (base+*(OffsetTo*)values++).get_delta (x_ppem) << 16; else values++; } if (format & yPlaDevice) { if (y_ppem) - glyph_pos->y_pos += (base+*(OffsetTo*)values++).get_delta (y_ppem) << 6; + glyph_pos->y_pos += (base+*(OffsetTo*)values++).get_delta (y_ppem) << 16; else values++; } if (format & xAdvDevice) { if (x_ppem) - glyph_pos->x_advance += (base+*(OffsetTo*)values++).get_delta (x_ppem) << 6; + glyph_pos->x_advance += (base+*(OffsetTo*)values++).get_delta (x_ppem) << 16; else values++; } if (format & yAdvDevice) { if (y_ppem) - glyph_pos->y_advance += (base+*(OffsetTo*)values++).get_delta (y_ppem) << 6; + glyph_pos->y_advance += (base+*(OffsetTo*)values++).get_delta (y_ppem) << 16; else values++; } @@ -205,10 +205,11 @@ struct AnchorFormat3 *x = _hb_16dot16_mul_trunc (context->font->x_scale, xCoordinate); *y = _hb_16dot16_mul_trunc (context->font->y_scale, yCoordinate); + /* pixel -> fractional pixel */ if (context->font->x_ppem) - *x += (this+xDeviceTable).get_delta (context->font->x_ppem) << 6; + *x += (this+xDeviceTable).get_delta (context->font->x_ppem) << 16; if (context->font->y_ppem) - *y += (this+yDeviceTable).get_delta (context->font->y_ppem) << 6; + *y += (this+yDeviceTable).get_delta (context->font->y_ppem) << 16; } inline bool sanitize (SANITIZE_ARG_DEF) { @@ -277,7 +278,7 @@ struct AnchorMatrix TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int count = rows * cols; - if (!SANITIZE_ARRAY (matrix, sizeof (matrix[0]), count)) return false; + if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false; for (unsigned int i = 0; i < count; i++) if (!SANITIZE_THIS (matrix[i])) return false; return true; @@ -296,6 +297,8 @@ struct MarkRecord { friend struct MarkArray; + static inline unsigned int get_size () { return sizeof (MarkRecord); } + inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_BASE (markAnchor, base); @@ -406,7 +409,7 @@ struct SinglePosFormat2 return false; valueFormat.apply_value (context, CONST_CHARP(this), - values + index * valueFormat.get_len (), + &values[index * valueFormat.get_len ()], CURPOSITION ()); buffer->in_pos++; @@ -487,7 +490,7 @@ struct PairSet TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; unsigned int count = (1 + format_len) * len; - return SANITIZE_MEM (array, sizeof (array[0]) * count); + return SANITIZE_MEM (array, USHORT::get_size () * count); } private: @@ -526,7 +529,7 @@ struct PairPosFormat1 unsigned int len1 = valueFormat1.get_len (); unsigned int len2 = valueFormat2.get_len (); - unsigned int record_len = 1 + len1 + len2; + unsigned int record_size = USHORT::get_size () * (1 + len1 + len2); unsigned int count = pair_set.len; const PairValueRecord *record = pair_set.array; @@ -534,14 +537,14 @@ struct PairPosFormat1 { if (IN_GLYPH (j) == record->secondGlyph) { - valueFormat1.apply_value (context, CONST_CHARP(this), record->values, CURPOSITION ()); - valueFormat2.apply_value (context, CONST_CHARP(this), record->values + len1, POSITION (j)); + valueFormat1.apply_value (context, CONST_CHARP(this), &record->values[0], CURPOSITION ()); + valueFormat2.apply_value (context, CONST_CHARP(this), &record->values[len1], POSITION (j)); if (len2) j++; buffer->in_pos = j; return true; } - record += record_len; + record = &CONST_CAST (PairValueRecord, *record, record_size); } return false; @@ -604,7 +607,7 @@ struct PairPosFormat2 if (HB_UNLIKELY (klass1 >= class1Count || klass2 >= class2Count)) return false; - const Value *v = values + record_len * (klass1 * class2Count + klass2); + const Value *v = &values[record_len * (klass1 * class2Count + klass2)]; valueFormat1.apply_value (context, CONST_CHARP(this), v, CURPOSITION ()); valueFormat2.apply_value (context, CONST_CHARP(this), v + len1, POSITION (j)); @@ -620,7 +623,7 @@ struct PairPosFormat2 if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) && SANITIZE_THIS2 (classDef1, classDef2))) return false; - unsigned int record_size =valueFormat1.get_size () + valueFormat2.get_size (); + unsigned int record_size = valueFormat1.get_size () + valueFormat2.get_size (); unsigned int len = class1Count * class2Count; return SANITIZE_ARRAY (values, record_size, len); } @@ -690,6 +693,8 @@ struct PairPos struct EntryExitRecord { + static inline unsigned int get_size () { return sizeof (EntryExitRecord); } + inline bool sanitize (SANITIZE_ARG_DEF, const void *base) { TRACE_SANITIZE (); return SANITIZE_BASE2 (entryAnchor, exitAnchor, base); diff --git a/pango/opentype/hb-ot-layout-gsubgpos-private.hh b/pango/opentype/hb-ot-layout-gsubgpos-private.hh index 91703da3..0e15cf60 100644 --- a/pango/opentype/hb-ot-layout-gsubgpos-private.hh +++ b/pango/opentype/hb-ot-layout-gsubgpos-private.hh @@ -194,7 +194,8 @@ static inline bool match_lookahead (APPLY_ARG_DEF, struct LookupRecord { - public: + static inline unsigned int get_size () { return sizeof (LookupRecord); } + inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); return SANITIZE_SELF (); @@ -297,7 +298,7 @@ struct Rule inline bool apply (APPLY_ARG_DEF, ContextLookupContext &lookup_context) const { TRACE_APPLY (); - const LookupRecord *lookupRecord = &CONST_CAST (LookupRecord, input, sizeof (input[0]) * (inputCount ? inputCount - 1 : 0)); + const LookupRecord *lookupRecord = &CONST_CAST (LookupRecord, input, input[0].get_size () * (inputCount ? inputCount - 1 : 0)); return context_lookup (APPLY_ARG, inputCount, input, lookupCount, lookupRecord, @@ -309,8 +310,8 @@ struct Rule TRACE_SANITIZE (); if (!(SANITIZE (inputCount) && SANITIZE (lookupCount))) return false; return SANITIZE_MEM (input, - sizeof (input[0]) * inputCount + - sizeof (lookupRecordX[0]) * lookupCount); + input[0].get_size () * inputCount + + lookupRecordX[0].get_size () * lookupCount); } private: @@ -446,7 +447,7 @@ struct ContextFormat3 if (HB_LIKELY (index == NOT_COVERED)) return false; - const LookupRecord *lookupRecord = &CONST_CAST(LookupRecord, coverage, sizeof (coverage[0]) * glyphCount); + const LookupRecord *lookupRecord = &CONST_CAST(LookupRecord, coverage, coverage[0].get_size () * glyphCount); struct ContextLookupContext lookup_context = { {match_coverage, apply_func}, DECONST_CHARP(this) @@ -463,8 +464,8 @@ struct ContextFormat3 unsigned int count = glyphCount; for (unsigned int i = 0; i < count; i++) if (!SANITIZE_THIS (coverage[i])) return false; - LookupRecord *lookupRecord = &CAST(LookupRecord, coverage, sizeof (coverage[0]) * glyphCount); - return SANITIZE_MEM (lookupRecord, sizeof (lookupRecord[0]) * lookupCount); + LookupRecord *lookupRecord = &CAST(LookupRecord, coverage, coverage[0].get_size () * glyphCount); + return SANITIZE_MEM (lookupRecord, lookupRecord[0].get_size () * lookupCount); } private: -- cgit v1.2.1 From 7e2abeb19c4b0760d60ec8b388c9f98075700004 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 16 Mar 2010 10:37:00 +0200 Subject: Dist also the .vcprojin files It has to be possible to run "make dist" also in an unpacked tarball. --- build/win32/vs9/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am index b654ba36..88ec9805 100644 --- a/build/win32/vs9/Makefile.am +++ b/build/win32/vs9/Makefile.am @@ -1,8 +1,11 @@ EXTRA_DIST = \ pango.sln \ pango.vsprops \ + pango.vcprojin \ pango.vcproj \ + pangoft2.vcprojin \ pangoft2.vcproj \ pangowin32.vcproj \ + pangocairo.vcprojin \ pangocairo.vcproj \ install.vcproj -- cgit v1.2.1 From f4201009d192300442e76d25a83c0dab8022d0d6 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Sun, 21 Mar 2010 21:23:56 +0100 Subject: Bug 611033 - Layout using ATSUI fontmap treats absolute font sizes a... pango_atsui_font_map_load_font() has been corrected to take into account whether the size retrieved from the given font description is absolute when setting this size again on best_description. _pango_cairo_atsui_font_new() has been cleaned up with regard to size conversion and usage. The code now properly takes the absolute property into account and is more clear. --- pango/pangoatsui-fontmap.c | 8 +++++++- pango/pangocairo-atsuifont.c | 47 ++++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/pango/pangoatsui-fontmap.c b/pango/pangoatsui-fontmap.c index f433440d..12b86bba 100644 --- a/pango/pangoatsui-fontmap.c +++ b/pango/pangoatsui-fontmap.c @@ -672,11 +672,14 @@ pango_atsui_font_map_load_font (PangoFontMap *fontmap, const gchar *family; gchar *name; gint size; + gboolean is_absolute; size = pango_font_description_get_size (description); if (size < 0) return NULL; + is_absolute = pango_font_description_get_size_is_absolute (description); + family = pango_font_description_get_family (description); family = family ? family : ""; name = g_utf8_casefold (family, -1); @@ -695,7 +698,10 @@ pango_atsui_font_map_load_font (PangoFontMap *fontmap, if (!find_best_match (font_family, description, &best_description, &best_face)) return NULL; - pango_font_description_set_size (best_description, size); + if (is_absolute) + pango_font_description_set_absolute_size (best_description, size); + else + pango_font_description_set_size (best_description, size); best_font = pango_atsui_font_map_lookup (atsuifontmap, context, diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c index 057cc76c..3abaffff 100644 --- a/pango/pangocairo-atsuifont.c +++ b/pango/pangocairo-atsuifont.c @@ -36,8 +36,7 @@ struct _PangoCairoATSUIFont PangoATSUIFont font; PangoCairoFontPrivate cf_priv; - double size; - int absolute_size; + double size; /* Absolute size */ }; struct _PangoCairoATSUIFontClass @@ -166,7 +165,8 @@ pango_cairo_atsui_font_describe_absolute (PangoFont *font) PangoCairoATSUIFont *cafont = (PangoCairoATSUIFont *) font; desc = pango_font_describe (font); - pango_font_description_set_absolute_size (desc, cafont->absolute_size); + pango_font_description_set_absolute_size (desc, + cafont->size * PANGO_SCALE); return desc; } @@ -212,7 +212,7 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap, CFStringRef cfstr; ATSFontRef font_ref; CGFontRef font_id; - double size; + double size, abs_size; double dpi; double m; cairo_matrix_t font_matrix; @@ -224,6 +224,23 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap, font_ref = ATSFontFindFromPostScriptName (cfstr, kATSOptionFlagsDefault); CFRelease (cfstr); + abs_size = size = pango_units_to_double (pango_font_description_get_size (desc)); + + if (context) + { + dpi = pango_cairo_context_get_resolution (context); + + if (dpi <= 0) + dpi = cafontmap->dpi; + } + else + dpi = cafontmap->dpi; + + if (pango_font_description_get_size_is_absolute (desc)) + size *= 72. / dpi; + else + abs_size *= dpi / 72.; + /* We synthesize italic in two cases. The first is when * NSFontManager has handed out a face that it claims has italic but * it doesn't. The other is when an italic face is requested that @@ -236,8 +253,6 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap, NSString *nsname; NSFont *nsfont, *converted_font; - size = (double) pango_font_description_get_size (desc) / PANGO_SCALE; - nsname = [NSString stringWithUTF8String:postscript_name]; nsfont = [NSFont fontWithName:nsname size:size]; @@ -266,26 +281,10 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap, _pango_atsui_font_set_font_description (afont, desc); _pango_atsui_font_set_face (afont, face); - size = (double) pango_font_description_get_size (desc) / PANGO_SCALE; _pango_atsui_font_set_cgfont (afont, font_id); _pango_atsui_font_set_atsfont (afont, font_ref); - if (context) - { - dpi = pango_cairo_context_get_resolution (context); - - if (dpi <= 0) - dpi = cafontmap->dpi; - } - else - dpi = cafontmap->dpi; - - cafont->absolute_size = pango_font_description_get_size (desc); - - if (!pango_font_description_get_size_is_absolute (desc)) - size *= dpi / 72.; - - cafont->size = size; + cafont->size = abs_size; /* When synthesizing italics, apply a shear matrix matching what Cocoa * does. Cairo quartz had transformed text wrong before 1.5.13, stay @@ -304,7 +303,7 @@ _pango_cairo_atsui_font_new (PangoCairoATSUIFontMap *cafontmap, else cairo_matrix_init_identity (&font_matrix); - cairo_matrix_scale (&font_matrix, size, size); + cairo_matrix_scale (&font_matrix, abs_size, abs_size); _pango_cairo_font_private_initialize (&cafont->cf_priv, (PangoCairoFont *) cafont, -- cgit v1.2.1 From 5f32f21772954f40d337a1e60299be47fc8be572 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 27 Mar 2010 17:00:19 -0400 Subject: [HB] Fix leak when duplicating blob --- pango/opentype/hb-blob.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pango/opentype/hb-blob.c b/pango/opentype/hb-blob.c index 3348a38b..3e787fcb 100644 --- a/pango/opentype/hb-blob.c +++ b/pango/opentype/hb-blob.c @@ -359,9 +359,11 @@ hb_blob_try_writable (hb_blob_t *blob) fprintf (stderr, "%p %s: dupped successfully -> %p\n", blob, __FUNCTION__, blob->data); #endif memcpy (new_data, blob->data, blob->length); - blob->data = new_data; - blob->mode = HB_MEMORY_MODE_WRITABLE; _hb_blob_destroy_user_data (blob); + blob->mode = HB_MEMORY_MODE_WRITABLE; + blob->data = new_data; + blob->destroy = free; + blob->user_data = new_data; } } else if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE) -- cgit v1.2.1 From 91d8773a88938aaa0a78de9bc6f768baf7021bc8 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 30 Mar 2010 10:28:51 +0300 Subject: Remove the .vcproj files before rewriting them In case they are write protected for some reason. Might help Behdad's problem with make dist. --- pango/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pango/Makefile.am b/pango/Makefile.am index ce3d0b77..37510fa0 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -645,6 +645,7 @@ dist-hook: \ # pangowin32.vcproj is not automatically built, it is not being changed ../build/win32/vs9/pango.vcproj: $(top_srcdir)/build/win32/vs9/pango.vcprojin mini-fribidi/libmini-fribidi.sourcefiles + -rm $@ for F in $(libpango_1_0_la_SOURCES); do \ case $$F in \ *.c) echo ' ' \ @@ -654,6 +655,7 @@ dist-hook: \ $(CPP) -P - <$(top_srcdir)/build/win32/vs9/pango.vcprojin >$@ ../build/win32/vs9/pangoft2.vcproj: $(top_srcdir)/build/win32/vs9/pangoft2.vcprojin opentype/libharfbuzz.sourcefiles + -rm $@ for F in $(libpangoft2_1_0_la_SOURCES); do \ case $$F in \ *.c) echo ' ' \ @@ -665,6 +667,7 @@ dist-hook: \ ../build/win32/vs9/pangocairo.vcproj: $(top_srcdir)/build/win32/vs9/pangocairo.vcprojin # Backend-specific sources for the libpangocairo DLL are explicitly # listed in the vcprojin file + -rm $@ for F in $(pangocairo_core_sources); do \ case $$F in \ *.c) echo ' ' \ -- cgit v1.2.1 From 1a36b77ee5030c099eff8a6ac7f0081a4a46d69d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 1 Apr 2010 03:33:22 -0400 Subject: Bug 582698 - Support CSS-style margin specification --- pango-view/viewer-render.c | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c index e672dcd4..8e3cc7f8 100644 --- a/pango-view/viewer-render.c +++ b/pango-view/viewer-render.c @@ -38,7 +38,10 @@ gboolean opt_pixels = FALSE; const char *opt_font = ""; gboolean opt_header = FALSE; const char *opt_output = NULL; -int opt_margin = 10; +int opt_margin_t = 10; +int opt_margin_r = 10; +int opt_margin_b = 10; +int opt_margin_l = 10; int opt_markup = FALSE; gboolean opt_rtl = FALSE; double opt_rotate = 0; @@ -248,8 +251,8 @@ do_output (PangoContext *context, PangoMatrix *orig_matrix; gboolean supports_matrix; int rotated_width, rotated_height; - int x = opt_margin; - int y = opt_margin; + int x = opt_margin_l; + int y = opt_margin_t; int width, height; width = 0; @@ -331,8 +334,8 @@ do_output (PangoContext *context, width = MAX (width, rect.width); height += rect.height; - width += 2 * opt_margin; - height += 2 * opt_margin; + width += opt_margin_l + opt_margin_r; + height += opt_margin_t + opt_margin_b; if (width_out) *width_out = width; @@ -543,6 +546,30 @@ parse_background (const char *name, name, arg, data, error); } +static gboolean +parse_margin (const char *name G_GNUC_UNUSED, + const char *arg, + gpointer data G_GNUC_UNUSED, + GError **error) +{ + switch (sscanf (arg, "%d %d %d %d", &opt_margin_t, &opt_margin_r, &opt_margin_b, &opt_margin_l)) + { + case 0: + { + g_set_error(error, + G_OPTION_ERROR, + G_OPTION_ERROR_BAD_VALUE, + "Argument for --margin must be one to four space-separated numbers"); + return FALSE; + } + case 1: opt_margin_r = opt_margin_t; + case 2: opt_margin_b = opt_margin_t; + case 3: opt_margin_l = opt_margin_r; + } + return TRUE; +} + + static gchar * backends_to_string (void) { @@ -680,8 +707,8 @@ parse_options (int argc, char *argv[]) "Align paragraph lines to be justified", NULL}, {"language", 0, 0, G_OPTION_ARG_STRING, &opt_language, "Language to use for font selection", "en_US/etc"}, - {"margin", 0, 0, G_OPTION_ARG_INT, &opt_margin, - "Set the margin on the output in pixels", "pixels"}, + {"margin", 0, 0, G_OPTION_ARG_CALLBACK, &parse_margin, + "Set the margin on the output in pixels", "CSS-style numbers in pixels"}, {"markup", 0, 0, G_OPTION_ARG_NONE, &opt_markup, "Interpret text as Pango markup", NULL}, {"output", 'o', 0, G_OPTION_ARG_STRING, &opt_output, -- cgit v1.2.1 From 52ab3d508ad900cc435aa6529cd4a333db43af78 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 19 Apr 2010 02:27:56 -0400 Subject: [HB] Fix debug build --- pango/opentype/hb-open-type-private.hh | 2 +- pango/opentype/hb-ot-layout-gsubgpos-private.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 06324ee3..77c5dfe4 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -124,7 +124,7 @@ struct Null \ HB_STMT_START { \ if (sanitize_depth < HB_DEBUG_SANITIZE) \ fprintf (stderr, "SANITIZE(%p) %-*d-> %s\n", \ - (CONST_CHARP (this) == NullPool) ? 0 : this, \ + (CONST_CHARP (this) == CONST_CHARP (&NullPool)) ? 0 : this, \ sanitize_depth, sanitize_depth, \ __PRETTY_FUNCTION__); \ } HB_STMT_END diff --git a/pango/opentype/hb-ot-layout-gsubgpos-private.hh b/pango/opentype/hb-ot-layout-gsubgpos-private.hh index 0e15cf60..13e74759 100644 --- a/pango/opentype/hb-ot-layout-gsubgpos-private.hh +++ b/pango/opentype/hb-ot-layout-gsubgpos-private.hh @@ -43,7 +43,7 @@ HB_STMT_START { \ if (apply_depth < HB_DEBUG_APPLY) \ fprintf (stderr, "APPLY(%p) %-*d-> %s\n", \ - (CONST_CHARP (this) == NullPool) ? 0 : this, \ + (CONST_CHARP (this) == CONST_CHARP (&NullPool)) ? 0 : this, \ apply_depth, apply_depth, \ __PRETTY_FUNCTION__); \ } HB_STMT_END -- cgit v1.2.1 From 5383831f1c73eaed7696fddad3e2fb823858a8ff Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 19 Apr 2010 02:29:04 -0400 Subject: [HB] Fix warnings --- pango/opentype/hb-open-type-private.hh | 2 +- pango/opentype/hb-ot-layout-gdef-private.hh | 4 ++-- pango/opentype/hb-ot-layout-gpos-private.hh | 4 ++-- pango/opentype/hb-ot-layout-gsubgpos-private.hh | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 77c5dfe4..98d46bd9 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -117,7 +117,7 @@ struct Null \ #endif #if HB_DEBUG_SANITIZE -#define TRACE_SANITIZE_ARG_DEF , unsigned int sanitize_depth +#define TRACE_SANITIZE_ARG_DEF , unsigned int sanitize_depth HB_GNUC_UNUSED #define TRACE_SANITIZE_ARG , sanitize_depth + 1 #define TRACE_SANITIZE_ARG_INIT , 1 #define TRACE_SANITIZE() \ diff --git a/pango/opentype/hb-ot-layout-gdef-private.hh b/pango/opentype/hb-ot-layout-gdef-private.hh index 69f90fec..f6480542 100644 --- a/pango/opentype/hb-ot-layout-gdef-private.hh +++ b/pango/opentype/hb-ot-layout-gdef-private.hh @@ -87,7 +87,7 @@ struct CaretValueFormat1 friend struct CaretValue; private: - inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const + inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED) const { /* TODO vertical */ return context->font->x_scale * coordinate / 0x10000; @@ -129,7 +129,7 @@ struct CaretValueFormat3 { friend struct CaretValue; - inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const + inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED) const { /* TODO vertical */ return context->font->x_scale * coordinate / 0x10000 + diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index be7b5a5c..e4ec9fcf 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -149,7 +149,7 @@ struct AnchorFormat1 friend struct Anchor; private: - inline void get_anchor (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id, + inline void get_anchor (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED, hb_position_t *x, hb_position_t *y) const { *x = _hb_16dot16_mul_trunc (context->font->x_scale, xCoordinate); @@ -199,7 +199,7 @@ struct AnchorFormat3 friend struct Anchor; private: - inline void get_anchor (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id, + inline void get_anchor (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED, hb_position_t *x, hb_position_t *y) const { *x = _hb_16dot16_mul_trunc (context->font->x_scale, xCoordinate); diff --git a/pango/opentype/hb-ot-layout-gsubgpos-private.hh b/pango/opentype/hb-ot-layout-gsubgpos-private.hh index 13e74759..0bb96a41 100644 --- a/pango/opentype/hb-ot-layout-gsubgpos-private.hh +++ b/pango/opentype/hb-ot-layout-gsubgpos-private.hh @@ -36,7 +36,7 @@ #endif #if HB_DEBUG_APPLY -#define TRACE_APPLY_ARG_DEF , unsigned int apply_depth +#define TRACE_APPLY_ARG_DEF , unsigned int apply_depth HB_GNUC_UNUSED #define TRACE_APPLY_ARG , apply_depth + 1 #define TRACE_APPLY_ARG_INIT , 1 #define TRACE_APPLY() \ @@ -59,7 +59,7 @@ hb_buffer_t *buffer, \ unsigned int context_length HB_GNUC_UNUSED, \ unsigned int nesting_level_left HB_GNUC_UNUSED, \ - unsigned int lookup_flag, \ + unsigned int lookup_flag HB_GNUC_UNUSED, \ unsigned int property HB_GNUC_UNUSED /* propety of first glyph */ \ TRACE_APPLY_ARG_DEF #define APPLY_ARG \ @@ -90,7 +90,7 @@ struct ContextFuncs }; -static inline bool match_glyph (hb_codepoint_t glyph_id, const USHORT &value, char *data) +static inline bool match_glyph (hb_codepoint_t glyph_id, const USHORT &value, char *data HB_GNUC_UNUSED) { return glyph_id == value; } -- cgit v1.2.1 From 0d0cbf451613c301ae358cc4dbe54fb63ae5fc9e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 19 Apr 2010 02:34:10 -0400 Subject: [HB] Round instead of trunc --- pango/opentype/hb-ot-layout-gpos-private.hh | 20 ++++++++++---------- pango/opentype/hb-private.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index e4ec9fcf..dcbbf0f5 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -104,13 +104,13 @@ struct ValueRecord { y_scale = context->font->y_scale; /* design units -> fractional pixel */ if (format & xPlacement) - glyph_pos->x_pos += _hb_16dot16_mul_trunc (x_scale, *(SHORT*)values++); + glyph_pos->x_pos += _hb_16dot16_mul_round (x_scale, *(SHORT*)values++); if (format & yPlacement) - glyph_pos->y_pos += _hb_16dot16_mul_trunc (y_scale, *(SHORT*)values++); + glyph_pos->y_pos += _hb_16dot16_mul_round (y_scale, *(SHORT*)values++); if (format & xAdvance) - glyph_pos->x_advance += _hb_16dot16_mul_trunc (x_scale, *(SHORT*)values++); + glyph_pos->x_advance += _hb_16dot16_mul_round (x_scale, *(SHORT*)values++); if (format & yAdvance) - glyph_pos->y_advance += _hb_16dot16_mul_trunc (y_scale, *(SHORT*)values++); + glyph_pos->y_advance += _hb_16dot16_mul_round (y_scale, *(SHORT*)values++); x_ppem = context->font->x_ppem; y_ppem = context->font->y_ppem; @@ -152,8 +152,8 @@ struct AnchorFormat1 inline void get_anchor (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED, hb_position_t *x, hb_position_t *y) const { - *x = _hb_16dot16_mul_trunc (context->font->x_scale, xCoordinate); - *y = _hb_16dot16_mul_trunc (context->font->y_scale, yCoordinate); + *x = _hb_16dot16_mul_round (context->font->x_scale, xCoordinate); + *y = _hb_16dot16_mul_round (context->font->y_scale, yCoordinate); } inline bool sanitize (SANITIZE_ARG_DEF) { @@ -177,8 +177,8 @@ struct AnchorFormat2 hb_position_t *x, hb_position_t *y) const { /* TODO Contour */ - *x = _hb_16dot16_mul_trunc (context->font->x_scale, xCoordinate); - *y = _hb_16dot16_mul_trunc (context->font->y_scale, yCoordinate); + *x = _hb_16dot16_mul_round (context->font->x_scale, xCoordinate); + *y = _hb_16dot16_mul_round (context->font->y_scale, yCoordinate); } inline bool sanitize (SANITIZE_ARG_DEF) { @@ -202,8 +202,8 @@ struct AnchorFormat3 inline void get_anchor (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED, hb_position_t *x, hb_position_t *y) const { - *x = _hb_16dot16_mul_trunc (context->font->x_scale, xCoordinate); - *y = _hb_16dot16_mul_trunc (context->font->y_scale, yCoordinate); + *x = _hb_16dot16_mul_round (context->font->x_scale, xCoordinate); + *y = _hb_16dot16_mul_round (context->font->y_scale, yCoordinate); /* pixel -> fractional pixel */ if (context->font->x_ppem) diff --git a/pango/opentype/hb-private.h b/pango/opentype/hb-private.h index b17b24a0..92e514f7 100644 --- a/pango/opentype/hb-private.h +++ b/pango/opentype/hb-private.h @@ -207,7 +207,7 @@ _hb_popcount32 (uint32_t mask) /* Multiplies a 16dot16 value by another value, then truncates the result */ -#define _hb_16dot16_mul_trunc(A,B) ((int64_t) (A) * (B) / 0x10000) +#define _hb_16dot16_mul_round(A,B) (((int64_t) (A) * (B) + 0x8000) / 0x10000) #include "hb-object-private.h" -- cgit v1.2.1 From 1c90dc64539551c8e0b86415a4949b8eb21b5b1c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 29 Mar 2010 00:04:12 -0400 Subject: GNOME Bug 613015 - [HB] Does not sanitize Device tables referenced from ValueRecords --- pango/opentype/hb-ot-layout-gpos-private.hh | 147 ++++++++++++++++++++++------ 1 file changed, 116 insertions(+), 31 deletions(-) diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index dcbbf0f5..1624e83e 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -51,30 +51,13 @@ struct ValueFormat : USHORT xAdvDevice = 0x0040, /* Includes horizontal Device table for advance */ yAdvDevice = 0x0080, /* Includes vertical Device table for advance */ ignored = 0x0F00, /* Was used in TrueType Open for MM fonts */ - reserved = 0xF000 /* For future use */ - }; - - inline unsigned int get_len () const - { return _hb_popcount32 ((unsigned int) *this); } - inline unsigned int get_size () const - { return get_len () * Value::get_size (); } - - void apply_value (hb_ot_layout_context_t *context, - const char *base, - const Value *values, - hb_internal_glyph_position_t *glyph_pos) const - { - unsigned int x_ppem, y_ppem; - hb_16dot16_t x_scale, y_scale; - unsigned int format = *this; + reserved = 0xF000, /* For future use */ - if (!format) - return; + devices = 0x00F0, /* Mask for having any Device table */ + }; - /* All fields are options. Only those available advance the value - * pointer. */ +/* All fields are options. Only those available advance the value pointer. */ #if 0 -struct ValueRecord { SHORT xPlacement; /* Horizontal adjustment for * placement--in design units */ SHORT yPlacement; /* Vertical adjustment for @@ -97,9 +80,24 @@ struct ValueRecord { Offset yAdvDevice; /* Offset to Device table for vertical * advance--measured from beginning of * PosTable (may be NULL) */ -}; #endif + inline unsigned int get_len () const + { return _hb_popcount32 ((unsigned int) *this); } + inline unsigned int get_size () const + { return get_len () * Value::get_size (); } + + void apply_value (hb_ot_layout_context_t *context, + const char *base, + const Value *values, + hb_internal_glyph_position_t *glyph_pos) const + { + unsigned int x_ppem, y_ppem; + hb_16dot16_t x_scale, y_scale; + unsigned int format = *this; + + if (!format) return; + x_scale = context->font->x_scale; y_scale = context->font->y_scale; /* design units -> fractional pixel */ @@ -140,6 +138,68 @@ struct ValueRecord { values++; } } + + private: + inline bool sanitize_value_devices (SANITIZE_ARG_DEF, void *base, const Value *values) { + unsigned int format = *this; + + if (format & xPlacement) values++; + if (format & yPlacement) values++; + if (format & xAdvance) values++; + if (format & yAdvance) values++; + + if ((format & xPlaDevice) && !SANITIZE_BASE (*(OffsetTo*)values++, base)) return false; + if ((format & yPlaDevice) && !SANITIZE_BASE (*(OffsetTo*)values++, base)) return false; + if ((format & xAdvDevice) && !SANITIZE_BASE (*(OffsetTo*)values++, base)) return false; + if ((format & yAdvDevice) && !SANITIZE_BASE (*(OffsetTo*)values++, base)) return false; + + return true; + } + + public: + + inline bool has_device () { + unsigned int format = *this; + return (format & devices) != 0; + } + + inline bool sanitize_value (SANITIZE_ARG_DEF, void *base, const Value *values) { + TRACE_SANITIZE (); + + return SANITIZE_MEM (values, get_size ()) && + (!has_device () || sanitize_value_devices (SANITIZE_ARG, base, values)); + } + + inline bool sanitize_values (SANITIZE_ARG_DEF, void *base, const Value *values, unsigned int count) { + TRACE_SANITIZE (); + unsigned int len = get_len (); + + if (!SANITIZE_ARRAY (values, get_size (), count)) return false; + + if (!has_device ()) return true; + + for (unsigned int i = 0; i < count; i++) { + if (!sanitize_value_devices (SANITIZE_ARG, base, values)) + return false; + values += len; + } + + return true; + } + + inline bool sanitize_values_stride_unsafe (SANITIZE_ARG_DEF, void *base, const Value *values, unsigned int count, unsigned int stride) { + TRACE_SANITIZE (); + + if (!has_device ()) return true; + + for (unsigned int i = 0; i < count; i++) { + if (!sanitize_value_devices (SANITIZE_ARG, base, values)) + return false; + values += stride; + } + + return true; + } }; ASSERT_SIZE (ValueFormat, 2); @@ -377,7 +437,7 @@ struct SinglePosFormat1 inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS (coverage) && - SANITIZE_MEM (values, valueFormat.get_size ()); + valueFormat.sanitize_value (SANITIZE_ARG, CHARP(this), values); } private: @@ -419,7 +479,7 @@ struct SinglePosFormat2 inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); return SANITIZE_SELF () && SANITIZE_THIS (coverage) && - SANITIZE_MEM (values, valueFormat.get_size () * valueCount); + valueFormat.sanitize_values (SANITIZE_ARG, CHARP(this), values, valueCount); } private: @@ -486,6 +546,7 @@ struct PairSet { friend struct PairPosFormat1; + /* Note: Doesn't sanitize the Device entries in the ValueRecord */ inline bool sanitize (SANITIZE_ARG_DEF, unsigned int format_len) { TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; @@ -525,12 +586,11 @@ struct PairPosFormat1 j++; } - const PairSet &pair_set = this+pairSet[index]; - unsigned int len1 = valueFormat1.get_len (); unsigned int len2 = valueFormat2.get_len (); unsigned int record_size = USHORT::get_size () * (1 + len1 + len2); + const PairSet &pair_set = this+pairSet[index]; unsigned int count = pair_set.len; const PairValueRecord *record = pair_set.array; for (unsigned int i = 0; i < count; i++) @@ -552,9 +612,29 @@ struct PairPosFormat1 inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); - return SANITIZE_SELF () && SANITIZE_THIS (coverage) && - pairSet.sanitize (SANITIZE_ARG, CONST_CHARP(this), - valueFormat1.get_len () + valueFormat2.get_len ()); + + unsigned int len1 = valueFormat1.get_len (); + unsigned int len2 = valueFormat2.get_len (); + + if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) && + pairSet.sanitize (SANITIZE_ARG, CONST_CHARP(this), len1 + len2))) return false; + + if (!(valueFormat1.has_device () || valueFormat2.has_device ())) return true; + + unsigned int stride = 1 + len1 + len2; + unsigned int count1 = pairSet.len; + for (unsigned int i = 0; i < count1; i++) + { + const PairSet &pair_set = this+pairSet[i]; + + unsigned int count2 = pair_set.len; + const PairValueRecord *record = pair_set.array; + if (!(valueFormat1.sanitize_values_stride_unsafe (SANITIZE_ARG, CHARP(this), &record->values[0], count2, stride) && + valueFormat2.sanitize_values_stride_unsafe (SANITIZE_ARG, CHARP(this), &record->values[len1], count2, stride))) + return false; + } + + return true; } private: @@ -623,9 +703,14 @@ struct PairPosFormat2 if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) && SANITIZE_THIS2 (classDef1, classDef2))) return false; + unsigned int len1 = valueFormat1.get_len (); + unsigned int len2 = valueFormat2.get_len (); + unsigned int stride = len1 + len2; unsigned int record_size = valueFormat1.get_size () + valueFormat2.get_size (); - unsigned int len = class1Count * class2Count; - return SANITIZE_ARRAY (values, record_size, len); + unsigned int count = (unsigned int) class1Count * (unsigned int) class2Count; + return SANITIZE_ARRAY (values, record_size, count) && + valueFormat1.sanitize_values_stride_unsafe (SANITIZE_ARG, CHARP(this), &values[0], count, stride) && + valueFormat2.sanitize_values_stride_unsafe (SANITIZE_ARG, CHARP(this), &values[len1], count, stride); } private: -- cgit v1.2.1 From fc23518fc6fb391a0e7dc872c6a2e89a09cad018 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 20 Apr 2010 15:25:27 -0400 Subject: [HB] Remove ASSERT_SIZE_DATA --- pango/opentype/hb-open-type-private.hh | 4 ---- pango/opentype/hb-ot-layout-common-private.hh | 9 ++++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 98d46bd9..e146a2d3 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -84,10 +84,6 @@ struct Null \ #define Null(Type) (Null::get()) -#define ASSERT_SIZE_DATA(Type, size, data) \ - ASSERT_SIZE (Type, size); \ - DEFINE_NULL_DATA (Type, size, data) - /* get_for_data() is a static class method returning a reference to an * instance of Type located at the input data location. It's just a * fancy, NULL-safe, cast! */ diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index aff14689..0c0a768e 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -171,7 +171,8 @@ struct LangSys * = 0xFFFF */ IndexArray featureIndex; /* Array of indices into the FeatureList */ }; -ASSERT_SIZE_DATA (LangSys, 6, "\0\0\xFF\xFF"); +ASSERT_SIZE (LangSys, 6); +DEFINE_NULL_DATA (LangSys, 6, "\0\0\xFF\xFF"); struct Script @@ -372,7 +373,8 @@ struct CoverageRangeRecord USHORT startCoverageIndex; /* Coverage Index of first GlyphID in * range */ }; -ASSERT_SIZE_DATA (CoverageRangeRecord, 6, "\000\001"); +ASSERT_SIZE (CoverageRangeRecord, 6); +DEFINE_NULL_DATA (CoverageRangeRecord, 6, "\000\001"); struct CoverageFormat2 { @@ -491,7 +493,8 @@ struct ClassRangeRecord GlyphID end; /* Last GlyphID in the range */ USHORT classValue; /* Applied to all glyphs in the range */ }; -ASSERT_SIZE_DATA (ClassRangeRecord, 6, "\000\001"); +ASSERT_SIZE (ClassRangeRecord, 6); +DEFINE_NULL_DATA (ClassRangeRecord, 6, "\000\001"); struct ClassDefFormat2 { -- cgit v1.2.1 From 851f873072b26b32c514c459ba2ca141dd1b79e0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 20 Apr 2010 15:51:53 -0400 Subject: [HB] Add couple consts to operators --- pango/opentype/hb-open-type-private.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index e146a2d3..ea6ba5b4 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007,2008,2009 Red Hat, Inc. + * Copyright (C) 2007,2008,2009,2010 Red Hat, Inc. * * This is part of HarfBuzz, an OpenType Layout engine library. * @@ -346,7 +346,7 @@ struct Sanitizer { \ inline NAME& set (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN ((TYPE&) v); } \ - inline bool operator== (NAME o) const { return (TYPE&) v == (TYPE&) o.v; } \ + inline bool operator== (const NAME &o) const { return (TYPE&) v == (TYPE&) o.v; } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ TRACE_SANITIZE (); \ return SANITIZE_SELF (); \ @@ -361,7 +361,7 @@ struct Sanitizer static inline unsigned int get_size () { return BYTES; } \ inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \ - inline bool operator== (NAME o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ + inline bool operator== (const NAME &o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ TRACE_SANITIZE (); \ return SANITIZE_SELF (); \ -- cgit v1.2.1 From 5453f4b097811e31e8205d3729bee1fc97d2e541 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 20 Apr 2010 15:52:47 -0400 Subject: [HB] Fix Class operator return type --- pango/opentype/hb-ot-layout-common-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index 0c0a768e..e3171e36 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -528,7 +528,7 @@ ASSERT_SIZE (ClassDefFormat2, 4); struct ClassDef { - inline unsigned int operator() (hb_codepoint_t glyph_id) const { return get_class (glyph_id); } + inline hb_ot_layout_class_t operator() (hb_codepoint_t glyph_id) const { return get_class (glyph_id); } inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const { -- cgit v1.2.1 From b11755c2f68d0dfe1dac7a7bce29defa25255bc9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 20 Apr 2010 23:50:45 -0400 Subject: [HB] Cosmetic --- pango/opentype/hb-open-type-private.hh | 8 ++++---- pango/opentype/hb-ot-layout-common-private.hh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index ea6ba5b4..590b0d98 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -346,7 +346,7 @@ struct Sanitizer { \ inline NAME& set (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN ((TYPE&) v); } \ - inline bool operator== (const NAME &o) const { return (TYPE&) v == (TYPE&) o.v; } \ + inline bool operator == (const NAME &o) const { return (TYPE&) v == (TYPE&) o.v; } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ TRACE_SANITIZE (); \ return SANITIZE_SELF (); \ @@ -361,7 +361,7 @@ struct Sanitizer static inline unsigned int get_size () { return BYTES; } \ inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \ inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \ - inline bool operator== (const NAME &o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ + inline bool operator == (const NAME &o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ TRACE_SANITIZE (); \ return SANITIZE_SELF (); \ @@ -386,7 +386,7 @@ struct Tag : ULONG inline Tag (const Tag &o) { *(ULONG*)this = (ULONG&) o; } inline Tag (uint32_t i) { (*(ULONG*)this).set (i); } inline Tag (const char *c) { *(ULONG*)this = *(ULONG*)c; } - inline bool operator== (const char *c) const { return *(ULONG*)this == *(ULONG*)c; } + inline bool operator == (const char *c) const { return *(ULONG*)this == *(ULONG*)c; } /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ inline operator const char* (void) const { return CONST_CHARP(this); } inline operator char* (void) { return CHARP(this); } @@ -459,7 +459,7 @@ ASSERT_SIZE (FixedVersion, 4); template struct GenericOffsetTo : OffsetType { - inline const Type& operator() (const void *base) const + inline const Type& operator () (const void *base) const { unsigned int offset = *this; if (HB_UNLIKELY (!offset)) return Null(Type); diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index e3171e36..2cb59d64 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -410,7 +410,7 @@ ASSERT_SIZE (CoverageFormat2, 4); struct Coverage { - inline unsigned int operator() (hb_codepoint_t glyph_id) const { return get_coverage (glyph_id); } + inline unsigned int operator () (hb_codepoint_t glyph_id) const { return get_coverage (glyph_id); } inline unsigned int get_coverage (hb_codepoint_t glyph_id) const { @@ -528,7 +528,7 @@ ASSERT_SIZE (ClassDefFormat2, 4); struct ClassDef { - inline hb_ot_layout_class_t operator() (hb_codepoint_t glyph_id) const { return get_class (glyph_id); } + inline hb_ot_layout_class_t operator () (hb_codepoint_t glyph_id) const { return get_class (glyph_id); } inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const { @@ -564,7 +564,7 @@ struct ClassDef struct Device { - inline int operator() (unsigned int ppem_size) const { return get_delta (ppem_size); } + inline int operator () (unsigned int ppem_size) const { return get_delta (ppem_size); } inline int get_delta (unsigned int ppem_size) const { -- cgit v1.2.1 From 39620ce42fa212d4e76f49ac257d2b2cf6da20fa Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Apr 2010 00:14:12 -0400 Subject: [HB] Simplify Tag struct --- pango/opentype/hb-open-file-private.hh | 3 ++- pango/opentype/hb-open-type-private.hh | 6 +----- pango/opentype/hb-ot-layout-common-private.hh | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pango/opentype/hb-open-file-private.hh b/pango/opentype/hb-open-file-private.hh index 0947747d..080975b7 100644 --- a/pango/opentype/hb-open-file-private.hh +++ b/pango/opentype/hb-open-file-private.hh @@ -84,7 +84,8 @@ typedef struct OffsetTable } inline bool find_table_index (hb_tag_t tag, unsigned int *table_index) const { - const Tag t = tag; + Tag t; + t.set (tag); // TODO bsearch unsigned int count = numTables; for (unsigned int i = 0; i < count; i++) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 590b0d98..4dbff0dc 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -359,7 +359,7 @@ struct Sanitizer struct NAME \ { \ static inline unsigned int get_size () { return BYTES; } \ - inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \ + inline void set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); } \ inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \ inline bool operator == (const NAME &o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \ inline bool sanitize (SANITIZE_ARG_DEF) { \ @@ -383,10 +383,6 @@ DEFINE_INT_TYPE (LONG, , 32); /* 32-bit signed integer. */ * system, feature, or baseline */ struct Tag : ULONG { - inline Tag (const Tag &o) { *(ULONG*)this = (ULONG&) o; } - inline Tag (uint32_t i) { (*(ULONG*)this).set (i); } - inline Tag (const char *c) { *(ULONG*)this = *(ULONG*)c; } - inline bool operator == (const char *c) const { return *(ULONG*)this == *(ULONG*)c; } /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ inline operator const char* (void) const { return CONST_CHARP(this); } inline operator char* (void) { return CHARP(this); } diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh index 2cb59d64..1f6cf4a2 100644 --- a/pango/opentype/hb-ot-layout-common-private.hh +++ b/pango/opentype/hb-ot-layout-common-private.hh @@ -84,7 +84,8 @@ struct RecordArrayOf : ArrayOf > { } inline bool find_index (hb_tag_t tag, unsigned int *index) const { - const Tag t = tag; + Tag t; + t.set (tag); // TODO bsearch const Record *a = this->const_array(); unsigned int count = this->len; -- cgit v1.2.1 From 9091e0f4d59b4f6dec4b0992f86ddcc141c0b919 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Apr 2010 00:32:47 -0400 Subject: [HB] Use a function template instead of struct template for Null --- pango/opentype/hb-open-type-private.hh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 4dbff0dc..832d2ad1 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -61,27 +61,25 @@ /* Null objects */ /* Global nul-content Null pool. Enlarge as necessary. */ -static const void *NullPool[32 / sizeof (void *)]; +static const void *_NullPool[32 / sizeof (void *)]; /* Generic template for nul-content sizeof-sized Null objects. */ template -struct Null -{ - ASSERT_STATIC (sizeof (Type) <= sizeof (NullPool)); - static inline const Type &get () { return CONST_CAST (Type, *NullPool, 0); } -}; +static inline const Type& Null () { + ASSERT_STATIC (sizeof (Type) <= sizeof (_NullPool)); + return CONST_CAST (Type, *_NullPool, 0); +} /* Specializaiton for arbitrary-content arbitrary-sized Null objects. */ #define DEFINE_NULL_DATA(Type, size, data) \ -static const char _Null##Type[size] = data; \ +static const char _Null##Type[size + 1] = data; \ template <> \ -struct Null \ -{ \ - static inline const Type &get () { return CONST_CAST (Type, *_Null##Type, 0); } \ +inline const Type& Null () { \ + return CONST_CAST (Type, *_Null##Type, 0); \ } /* Accessor macro. */ -#define Null(Type) (Null::get()) +#define Null(Type) Null() /* get_for_data() is a static class method returning a reference to an @@ -397,9 +395,7 @@ struct Tag : ULONG } }; ASSERT_SIZE (Tag, 4); -#define _NULL_TAG_INIT {' ', ' ', ' ', ' '} -DEFINE_NULL_DATA (Tag, 4, _NULL_TAG_INIT); -#undef _NULL_TAG_INIT +DEFINE_NULL_DATA (Tag, 4, " "); /* Glyph index number, same as uint16 (length = 16 bits) */ typedef USHORT GlyphID; -- cgit v1.2.1 From 4eca6bc0c98b573cc28005413e40790af8b10930 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Apr 2010 00:40:50 -0400 Subject: [HB] Remove stale TODO item --- pango/opentype/hb-open-type-private.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 832d2ad1..994f6d8d 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -247,7 +247,6 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF, #define SANITIZE_OBJ(X) SANITIZE_MEM(&(X), sizeof (X)) #define SANITIZE_GET_SIZE() SANITIZE_SELF() && SANITIZE_MEM (this, this->get_size ()) -/* TODO Optimize this if L is fixed (gcc magic) */ #define SANITIZE_MEM(B,L) HB_LIKELY (_hb_sanitize_check (SANITIZE_ARG, CONST_CHARP(B), (L))) #define SANITIZE_ARRAY(A,S,L) HB_LIKELY (_hb_sanitize_array (SANITIZE_ARG, CONST_CHARP(A), S, L)) -- cgit v1.2.1 From 140cfe4b4a40f95a379c1b78881b1edf12f72145 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Apr 2010 00:49:40 -0400 Subject: [HB] Improve comments --- pango/opentype/hb-open-type-private.hh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 994f6d8d..9e99175a 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -510,11 +510,14 @@ struct GenericArrayOf inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; - /* Note: - * for non-recursive types, this is not much needed. - * But we keep the code to make sure the objects pointed to - * do have a simple sanitize(). */ + /* Note: for structs that do not reference other structs, + * we do not need to call their sanitize() as we already did + * a bound check on the aggregate array size, hence the return. + */ return true; + /* We do keep this code though to make sure the structs pointed + * to do have a simple sanitize(), ie. they do not reference + * other structs. */ unsigned int count = len; for (unsigned int i = 0; i < count; i++) if (!SANITIZE (array()[i])) @@ -613,11 +616,14 @@ struct HeadlessArrayOf inline bool sanitize (SANITIZE_ARG_DEF) { TRACE_SANITIZE (); if (!SANITIZE_GET_SIZE()) return false; - /* Note: - * for non-recursive types, this is not much needed. - * But we keep the code to make sure the objects pointed to - * do have a simple sanitize(). */ + /* Note: for structs that do not reference other structs, + * we do not need to call their sanitize() as we already did + * a bound check on the aggregate array size, hence the return. + */ return true; + /* We do keep this code though to make sure the structs pointed + * to do have a simple sanitize(), ie. they do not reference + * other structs. */ unsigned int count = len ? len - 1 : 0; Type *a = array(); for (unsigned int i = 0; i < count; i++) -- cgit v1.2.1 From fd31122c5a153c3a21ae015cdd1c72aef79671d0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Apr 2010 02:04:22 -0400 Subject: [HB] Minor --- pango/opentype/hb-ot-layout-gpos-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index 1624e83e..44d15688 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -53,7 +53,7 @@ struct ValueFormat : USHORT ignored = 0x0F00, /* Was used in TrueType Open for MM fonts */ reserved = 0xF000, /* For future use */ - devices = 0x00F0, /* Mask for having any Device table */ + devices = 0x00F0 /* Mask for having any Device table */ }; /* All fields are options. Only those available advance the value pointer. */ -- cgit v1.2.1 From 34e05035af0ce854df1cc2f77c0b11dbc1a3cb36 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 4 May 2010 11:55:27 -0400 Subject: [cairo] Refactor common code in create_metrics_for_context() --- pango/pangocairo-atsuifont.c | 31 ++++++--------------------- pango/pangocairo-fcfont.c | 8 +++---- pango/pangocairo-font.c | 48 ++++++++++++++++++++++++++++++++++++++++- pango/pangocairo-private.h | 4 ++-- pango/pangocairo-win32font.c | 31 ++++++--------------------- pango/pangofc-font.c | 51 +++----------------------------------------- pango/pangofc-private.h | 4 ++-- 7 files changed, 70 insertions(+), 107 deletions(-) diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c index 3abaffff..1c1ba550 100644 --- a/pango/pangocairo-atsuifont.c +++ b/pango/pangocairo-atsuifont.c @@ -46,15 +46,15 @@ struct _PangoCairoATSUIFontClass -static cairo_font_face_t *pango_cairo_atsui_font_create_font_face (PangoCairoFont *font); -static PangoFontMetrics *pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, - PangoContext *context); +static cairo_font_face_t *pango_cairo_atsui_font_create_font_face (PangoCairoFont *font); +static PangoFontMetrics *pango_cairo_atsui_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context); static void cairo_font_iface_init (PangoCairoFontIface *iface) { iface->create_font_face = pango_cairo_atsui_font_create_font_face; - iface->create_metrics_for_context = pango_cairo_atsui_font_create_metrics_for_context; + iface->create_base_metrics_for_context = pango_cairo_atsui_font_create_base_metrics_for_context; iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoATSUIFont, cf_priv); } @@ -113,19 +113,14 @@ max_glyph_width (PangoLayout *layout) } static PangoFontMetrics * -pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, - PangoContext *context) +pango_cairo_atsui_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context) { PangoCairoATSUIFont *cafont = (PangoCairoATSUIFont *) font; PangoATSUIFont *afont = (PangoATSUIFont *) font; ATSFontRef ats_font; ATSFontMetrics ats_metrics; PangoFontMetrics *metrics; - PangoFontDescription *font_desc; - PangoLayout *layout; - PangoRectangle extents; - PangoLanguage *language = pango_context_get_language (context); - const char *sample_str = pango_language_get_sample_string (language); metrics = pango_font_metrics_new (); @@ -141,20 +136,6 @@ pango_cairo_atsui_font_create_metrics_for_context (PangoCairoFont *font, metrics->strikethrough_position = metrics->ascent / 3; metrics->strikethrough_thickness = ats_metrics.underlineThickness * cafont->size * PANGO_SCALE; - layout = pango_layout_new (context); - font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font); - pango_layout_set_font_description (layout, font_desc); - pango_layout_set_text (layout, sample_str, -1); - pango_layout_get_extents (layout, NULL, &extents); - - metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str); - - pango_layout_set_text (layout, "0123456789", -1); - metrics->approximate_digit_width = max_glyph_width (layout); - - pango_font_description_free (font_desc); - g_object_unref (layout); - return metrics; } diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c index 8401ed8d..1393ce8e 100644 --- a/pango/pangocairo-fcfont.c +++ b/pango/pangocairo-fcfont.c @@ -64,19 +64,19 @@ pango_cairo_fc_font_create_font_face (PangoCairoFont *cfont) } static PangoFontMetrics * -pango_cairo_fc_font_create_metrics_for_context (PangoCairoFont *cfont, - PangoContext *context) +pango_cairo_fc_font_create_base_metrics_for_context (PangoCairoFont *cfont, + PangoContext *context) { PangoFcFont *fcfont = (PangoFcFont *) (cfont); - return pango_fc_font_create_metrics_for_context (fcfont, context); + return pango_fc_font_create_base_metrics_for_context (fcfont, context); } static void cairo_font_iface_init (PangoCairoFontIface *iface) { iface->create_font_face = pango_cairo_fc_font_create_font_face; - iface->create_metrics_for_context = pango_cairo_fc_font_create_metrics_for_context; + iface->create_base_metrics_for_context = pango_cairo_fc_font_create_base_metrics_for_context; iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoFcFont, cf_priv); } diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c index 35da71ce..ace2a575 100644 --- a/pango/pangocairo-font.c +++ b/pango/pangocairo-font.c @@ -206,6 +206,30 @@ _pango_cairo_font_install (PangoFont *font, } +static int +max_glyph_width (PangoLayout *layout) +{ + int max_width = 0; + GSList *l, *r; + + for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) + { + PangoLayoutLine *line = l->data; + + for (r = line->runs; r; r = r->next) + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } + } + + return max_width; +} + typedef struct _PangoCairoFontMetricsInfo { const char *sample_str; @@ -239,6 +263,10 @@ _pango_cairo_font_get_metrics (PangoFont *font, PangoFontMap *fontmap; PangoContext *context; cairo_font_options_t *font_options; + PangoLayout *layout; + PangoRectangle extents; + PangoFontDescription *desc; + int height, shift; /* XXX this is racy. need a ref'ing getter... */ @@ -260,7 +288,25 @@ _pango_cairo_font_get_metrics (PangoFont *font, pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); - info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_metrics_for_context) (cfont, context); + info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_base_metrics_for_context) (cfont, context); + + /* Update approximate_*_width now */ + + layout = pango_layout_new (context); + desc = pango_font_describe_with_absolute_size (font); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, sample_str, -1); + pango_layout_get_extents (layout, NULL, &extents); + + info->metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str); + + pango_layout_set_text (layout, "0123456789", -1); + info->metrics->approximate_digit_width = max_glyph_width (layout); + + g_object_unref (layout); + /* We may actually reuse ascent/descent we got from cairo here. that's * in cf_priv->font_extents. diff --git a/pango/pangocairo-private.h b/pango/pangocairo-private.h index 3a4a9d0e..4e64f25d 100644 --- a/pango/pangocairo-private.h +++ b/pango/pangocairo-private.h @@ -95,8 +95,8 @@ struct _PangoCairoFontIface GTypeInterface g_iface; cairo_font_face_t *(*create_font_face) (PangoCairoFont *cfont); - PangoFontMetrics *(*create_metrics_for_context) (PangoCairoFont *cfont, - PangoContext *context); + PangoFontMetrics *(*create_base_metrics_for_context) (PangoCairoFont *cfont, + PangoContext *context); gssize cf_priv_offset; }; diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c index 3493d582..59f7c0f6 100644 --- a/pango/pangocairo-win32font.c +++ b/pango/pangocairo-win32font.c @@ -54,16 +54,16 @@ struct _PangoCairoWin32FontClass GType pango_cairo_win32_font_get_type (void); -static cairo_font_face_t *pango_cairo_win32_font_create_font_face (PangoCairoFont *font); -static PangoFontMetrics *pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font, - PangoContext *context); +static cairo_font_face_t *pango_cairo_win32_font_create_font_face (PangoCairoFont *font); +static PangoFontMetrics *pango_cairo_win32_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context); static void cairo_font_iface_init (PangoCairoFontIface *iface) { iface->create_font_face = pango_cairo_win32_font_create_font_face; - iface->create_metrics_for_context = pango_cairo_win32_font_create_metrics_for_context; + iface->create_base_metrics_for_context = pango_cairo_win32_font_create_base_metrics_for_context; iface->cf_priv_offset = G_STRUCT_OFFSET (PangoCairoWin32Font, cf_priv); } @@ -104,15 +104,10 @@ max_glyph_width (PangoLayout *layout) } static PangoFontMetrics * -pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font, - PangoContext *context) +pango_cairo_win32_font_create_base_metrics_for_context (PangoCairoFont *font, + PangoContext *context) { PangoFontMetrics *metrics; - PangoFontDescription *font_desc; - PangoLayout *layout; - PangoRectangle extents; - PangoLanguage *language = pango_context_get_language (context); - const char *sample_str = pango_language_get_sample_string (language); cairo_scaled_font_t *scaled_font; cairo_font_extents_t font_extents; double height; @@ -144,20 +139,6 @@ pango_cairo_win32_font_create_metrics_for_context (PangoCairoFont *font, if (metrics->underline_position == 0) metrics->underline_position = - metrics->underline_thickness; - layout = pango_layout_new (context); - font_desc = pango_font_describe_with_absolute_size ((PangoFont *) font); - pango_layout_set_font_description (layout, font_desc); - pango_layout_set_text (layout, sample_str, -1); - pango_layout_get_extents (layout, NULL, &extents); - - metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str); - - pango_layout_set_text (layout, "0123456789", -1); - metrics->approximate_digit_width = max_glyph_width (layout); - - pango_font_description_free (font_desc); - g_object_unref (layout); - return metrics; } diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c index ad234beb..7c38ab76 100644 --- a/pango/pangofc-font.c +++ b/pango/pangofc-font.c @@ -479,60 +479,15 @@ get_face_metrics (PangoFcFont *fcfont, PANGO_FC_FONT_UNLOCK_FACE (fcfont); } -static int -max_glyph_width (PangoLayout *layout) -{ - int max_width = 0; - GSList *l, *r; - - for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) - { - PangoLayoutLine *line = l->data; - - for (r = line->runs; r; r = r->next) - { - PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; - int i; - - for (i = 0; i < glyphs->num_glyphs; i++) - if (glyphs->glyphs[i].geometry.width > max_width) - max_width = glyphs->glyphs[i].geometry.width; - } - } - - return max_width; -} - PangoFontMetrics * -pango_fc_font_create_metrics_for_context (PangoFcFont *fcfont, - PangoContext *context) +pango_fc_font_create_base_metrics_for_context (PangoFcFont *fcfont, + PangoContext *context) { PangoFontMetrics *metrics; - PangoLayout *layout; - PangoRectangle extents; - PangoLanguage *language = pango_context_get_language (context); - const char *sample_str = pango_language_get_sample_string (language); - PangoFontDescription *desc = pango_font_describe_with_absolute_size (PANGO_FONT (fcfont)); - metrics = pango_font_metrics_new (); get_face_metrics (fcfont, metrics); - layout = pango_layout_new (context); - pango_layout_set_font_description (layout, desc); - pango_font_description_free (desc); - - pango_layout_set_text (layout, sample_str, -1); - pango_layout_get_extents (layout, NULL, &extents); - - metrics->approximate_char_width = - extents.width / pango_utf8_strwidth (sample_str); - - pango_layout_set_text (layout, "0123456789", -1); - metrics->approximate_digit_width = max_glyph_width (layout); - - g_object_unref (layout); - return metrics; } @@ -581,7 +536,7 @@ pango_fc_font_get_metrics (PangoFont *font, context = pango_font_map_create_context (fontmap); pango_context_set_language (context, language); - info->metrics = pango_fc_font_create_metrics_for_context (fcfont, context); + info->metrics = pango_fc_font_create_base_metrics_for_context (fcfont, context); g_object_unref (context); g_object_unref (fontmap); diff --git a/pango/pangofc-private.h b/pango/pangofc-private.h index e7c08bff..f200c8c0 100644 --- a/pango/pangofc-private.h +++ b/pango/pangofc-private.h @@ -90,8 +90,8 @@ void pango_fc_font_get_raw_extents (PangoFcFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect); -PangoFontMetrics *pango_fc_font_create_metrics_for_context (PangoFcFont *font, - PangoContext *context); +PangoFontMetrics *pango_fc_font_create_base_metrics_for_context (PangoFcFont *font, + PangoContext *context); -- cgit v1.2.1 From 1caf2947f0941e2354dd4f43d56934e1ec706b6e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 4 May 2010 13:40:35 -0400 Subject: [cairo] Scale font metrics to user space Bug 457990 - font metrics are not converted to user space in cairo backend --- pango/pangocairo-font.c | 37 +++++++++++++++++++++++++++++++++++-- pango/pangocairo-private.h | 2 +- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c index ace2a575..1f6382b8 100644 --- a/pango/pangocairo-font.c +++ b/pango/pangocairo-font.c @@ -22,6 +22,7 @@ #include "config.h" #include +#include #include "pangocairo.h" #include "pangocairo-private.h" @@ -266,6 +267,10 @@ _pango_cairo_font_get_metrics (PangoFont *font, PangoLayout *layout; PangoRectangle extents; PangoFontDescription *desc; + cairo_scaled_font_t *scaled_font; + cairo_matrix_t cairo_matrix; + PangoMatrix pango_matrix; + PangoMatrix identity = PANGO_MATRIX_INIT; int height, shift; @@ -281,17 +286,45 @@ _pango_cairo_font_get_metrics (PangoFont *font, info->sample_str = sample_str; + scaled_font = _pango_cairo_font_private_get_scaled_font (cf_priv); + context = pango_font_map_create_context (fontmap); pango_context_set_language (context, language); + font_options = cairo_font_options_create (); - cairo_scaled_font_get_font_options (_pango_cairo_font_private_get_scaled_font (cf_priv), font_options); + cairo_scaled_font_get_font_options (scaled_font, font_options); pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); info->metrics = (* PANGO_CAIRO_FONT_GET_IFACE (font)->create_base_metrics_for_context) (cfont, context); - /* Update approximate_*_width now */ + /* We now need to adjust the base metrics for ctm */ + cairo_scaled_font_get_ctm (scaled_font, &cairo_matrix); + pango_matrix.xx = cairo_matrix.xx; + pango_matrix.yx = cairo_matrix.yx; + pango_matrix.xy = cairo_matrix.xy; + pango_matrix.yy = cairo_matrix.yy; + pango_matrix.x0 = 0; + pango_matrix.y0 = 0; + if (G_UNLIKELY (0 != memcmp (&identity, &pango_matrix, 4 * sizeof (double)))) + { + double xscale = pango_matrix_get_font_scale_factor (&pango_matrix); + if (xscale) xscale = 1 / xscale; + + info->metrics->ascent *= xscale; + info->metrics->descent *= xscale; + info->metrics->underline_position *= xscale; + info->metrics->underline_thickness *= xscale; + info->metrics->strikethrough_position *= xscale; + info->metrics->strikethrough_thickness *= xscale; + } + + /* Set the matrix on the context so we don't have to adjust the derived + * metrics. */ + pango_context_set_matrix (context, &pango_matrix); + + /* Update approximate_*_width now */ layout = pango_layout_new (context); desc = pango_font_describe_with_absolute_size (font); pango_layout_set_font_description (layout, desc); diff --git a/pango/pangocairo-private.h b/pango/pangocairo-private.h index 4e64f25d..52a8b2f4 100644 --- a/pango/pangocairo-private.h +++ b/pango/pangocairo-private.h @@ -75,7 +75,7 @@ struct _PangoCairoFontPrivateScaledFontData struct _PangoCairoFontPrivate { PangoCairoFont *cfont; - + PangoCairoFontPrivateScaledFontData *data; cairo_scaled_font_t *scaled_font; -- cgit v1.2.1 From 495932623fb3390dd4249e08a3fd8593ebceaef4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 10 May 2010 20:45:07 -0400 Subject: Fix glyph class building. Oops! Bug 605870 - Incorrect shaping for Syriac --- pango/pango-ot-info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index 9c74f917..51aa50de 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -211,14 +211,14 @@ get_glyph_class (gunichar charcode, case G_UNICODE_COMBINING_MARK: case G_UNICODE_ENCLOSING_MARK: case G_UNICODE_NON_SPACING_MARK: - *class = 3; /* Mark glyph (non-spacing combining glyph) */ + *class = HB_OT_LAYOUT_GLYPH_CLASS_MARK; /* Mark glyph (non-spacing combining glyph) */ return TRUE; case G_UNICODE_UNASSIGNED: case G_UNICODE_PRIVATE_USE: return FALSE; /* Unknown, don't assign a class; classes get * propagated during GSUB application */ default: - *class = 1; /* Base glyph (single character, spacing glyph) */ + *class = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH; /* Base glyph (single character, spacing glyph) */ return TRUE; } } -- cgit v1.2.1 From 8be1be82dbea3e81596366d1fa65d9b79d73850c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 26 May 2010 16:21:47 -0400 Subject: Cypriot is RTL --- pango/pango-gravity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c index 297199a5..7553a07e 100644 --- a/pango/pango-gravity.c +++ b/pango/pango-gravity.c @@ -182,7 +182,7 @@ const PangoScriptProperties script_properties[] = /* Unicode-4.0 additions */ {LTR, NONE, S, FALSE}, /* Brai */ - {LTR, NONE, S, FALSE}, /* Cprt */ + {RTL, NONE, S, FALSE}, /* Cprt */ {LTR, NONE, S, FALSE}, /* Limb */ {LTR, NONE, S, FALSE}, /* Osma */ {LTR, NONE, S, FALSE}, /* Shaw */ -- cgit v1.2.1 From a30783a14c4dc69adc43922474e79721fec54829 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 3 Jun 2010 11:53:21 -0400 Subject: Fix a test failure See http://build.gnome.org/builders/pango-RHEL5/builds/310/steps/pango%20check/logs/stdio --- pango/pangoft2.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pangoft2.def b/pango/pangoft2.def index 57294318..f2082ccb 100644 --- a/pango/pangoft2.def +++ b/pango/pangoft2.def @@ -2,7 +2,7 @@ EXPORTS pango_fc_decoder_get_charset pango_fc_decoder_get_glyph pango_fc_decoder_get_type - pango_fc_font_create_metrics_for_context + pango_fc_font_create_base_metrics_for_context pango_fc_font_description_from_pattern pango_fc_font_get_glyph pango_fc_font_get_raw_extents -- cgit v1.2.1 From 14763c551fa3c68bfe8ba02389a5f07ab65153b2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 15 Jun 2010 08:38:59 -0400 Subject: Bug 621612 - VPATH build fix --- pango-view/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango-view/Makefile.am b/pango-view/Makefile.am index 2721f970..dbfd81a0 100644 --- a/pango-view/Makefile.am +++ b/pango-view/Makefile.am @@ -93,7 +93,7 @@ nodist_man_MANS = pango-view.1 # The indirection through pango-view.1.in is to make parallel build work. # See bug 587768. $(srcdir)/pango-view.1.in: ../configure.in $(pango_view_SOURCES) - $(AM_V_GEN) $(top_builddir)/missing --run \ + $(AM_V_GEN) $(top_srcdir)/missing --run \ help2man --no-info --section=1 \ --help-option="--help-all" --output="$@.tmp" \ --name 'Pango text viewer' ./pango-view \ -- cgit v1.2.1 From cf1022c02c89d50a64743b1cf8d989817e4e1fd1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 15 Jun 2010 10:05:16 -0400 Subject: Backport this commit from harfbuzz-ng repo: Fix awful confusion between lookup format and subtable format As reported by John Daggett. --- pango/opentype/hb-ot-layout-gpos-private.hh | 12 ++++++------ pango/opentype/hb-ot-layout-gsub-private.hh | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index 44d15688..e68739ed 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -1419,10 +1419,10 @@ struct PosLookupSubTable } } - inline bool sanitize (SANITIZE_ARG_DEF) { + inline bool sanitize (SANITIZE_ARG_DEF, unsigned int lookup_type) { TRACE_SANITIZE (); - if (!SANITIZE (u.format)) return false; - switch (u.format) { + if (!SANITIZE (u.sub_format)) return false; + switch (lookup_type) { case Single: return u.single->sanitize (SANITIZE_ARG); case Pair: return u.pair->sanitize (SANITIZE_ARG); case Cursive: return u.cursive->sanitize (SANITIZE_ARG); @@ -1438,7 +1438,7 @@ struct PosLookupSubTable private: union { - USHORT format; + USHORT sub_format; SinglePos single[VAR]; PairPos pair[VAR]; CursivePos cursive[VAR]; @@ -1535,7 +1535,7 @@ struct PosLookup : Lookup TRACE_SANITIZE (); if (!Lookup::sanitize (SANITIZE_ARG)) return false; OffsetArrayOf &list = (OffsetArrayOf &) subTable; - return SANITIZE_THIS (list); + return list.sanitize (SANITIZE_ARG, this, get_type ()); } }; @@ -1591,7 +1591,7 @@ inline bool ExtensionPos::sanitize (SANITIZE_ARG_DEF) return Extension::sanitize (SANITIZE_ARG) && (&(Extension::get_subtable ()) == &Null(LookupSubTable) || get_type () == PosLookupSubTable::Extension || - DECONST_CAST (PosLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG)); + DECONST_CAST (PosLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG, get_type ())); } static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index) diff --git a/pango/opentype/hb-ot-layout-gsub-private.hh b/pango/opentype/hb-ot-layout-gsub-private.hh index d35aaff1..a9f78c24 100644 --- a/pango/opentype/hb-ot-layout-gsub-private.hh +++ b/pango/opentype/hb-ot-layout-gsub-private.hh @@ -702,10 +702,10 @@ struct SubstLookupSubTable } } - inline bool sanitize (SANITIZE_ARG_DEF) { + inline bool sanitize (SANITIZE_ARG_DEF, unsigned int lookup_type) { TRACE_SANITIZE (); - if (!SANITIZE (u.format)) return false; - switch (u.format) { + if (!SANITIZE (u.sub_format)) return false; + switch (lookup_type) { case Single: return u.single->sanitize (SANITIZE_ARG); case Multiple: return u.multiple->sanitize (SANITIZE_ARG); case Alternate: return u.alternate->sanitize (SANITIZE_ARG); @@ -720,7 +720,7 @@ struct SubstLookupSubTable private: union { - USHORT format; + USHORT sub_format; SingleSubst single[VAR]; MultipleSubst multiple[VAR]; AlternateSubst alternate[VAR]; @@ -830,7 +830,7 @@ struct SubstLookup : Lookup TRACE_SANITIZE (); if (!Lookup::sanitize (SANITIZE_ARG)) return false; OffsetArrayOf &list = (OffsetArrayOf &) subTable; - return SANITIZE_THIS (list); + return list.sanitize (SANITIZE_ARG, this, get_type ()); } }; @@ -887,7 +887,7 @@ inline bool ExtensionSubst::sanitize (SANITIZE_ARG_DEF) return Extension::sanitize (SANITIZE_ARG) && (&(Extension::get_subtable ()) == &Null(LookupSubTable) || get_type () == SubstLookupSubTable::Extension || - DECONST_CAST (SubstLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG)); + DECONST_CAST (SubstLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG, get_type ())); } static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index) -- cgit v1.2.1 From e4880b237e9056a95ad2ca25798f84d7372629f1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 15 Jun 2010 11:36:18 -0400 Subject: Bump version to 1.29 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 2e03066a..86eb4df9 100644 --- a/configure.in +++ b/configure.in @@ -21,8 +21,8 @@ dnl dnl The triplet m4_define([pango_version_major], [1]) -m4_define([pango_version_minor], [27]) -m4_define([pango_version_micro], [1]) +m4_define([pango_version_minor], [29]) +m4_define([pango_version_micro], [0]) m4_define([pango_version], [pango_version_major.pango_version_minor.pango_version_micro]) -- cgit v1.2.1 From 3882c7dcaa00c0489c4bfdd582b3fefe5e3741b9 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 26 Jun 2010 16:05:13 +0300 Subject: Improve performance on Windows especially for non-Latin scripts The use of Uniscribe script caches was decidedly suboptimal. Use one persistent SCRIPT_CACHE per Win32 font and script. Patch by by David E. Hollingsworth and Fredrik Corneliusson, from bug --- modules/basic/basic-win32.c | 50 ++++++++++++++++++++++++++++++++++----------- pango/pangowin32-private.h | 7 +++---- pango/pangowin32.c | 29 ++++++++++---------------- pango/pangowin32.def | 1 + 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index 1565a7c7..22aafdb5 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -31,6 +31,8 @@ #include "pangowin32.h" +extern HFONT _pango_win32_font_get_hfont (PangoFont *font); + #ifndef PANGO_MODULE_PREFIX #define PANGO_MODULE_PREFIX _pango_basic_win32 #endif @@ -500,8 +502,7 @@ itemize_shape_and_place (PangoFont *font, wchar_t *wtext, int wlen, const PangoAnalysis *analysis, - PangoGlyphString *glyphs, - SCRIPT_CACHE *script_cache) + PangoGlyphString *glyphs) { int i; int item, nitems, item_step; @@ -510,6 +511,11 @@ itemize_shape_and_place (PangoFont *font, SCRIPT_STATE state; SCRIPT_ITEM items[100]; double scale = pango_win32_font_get_metrics_factor (font); + HFONT hfont = _pango_win32_font_get_hfont (font); + static GHashTable *script_cache_hash = NULL; + + if (!script_cache_hash) + script_cache_hash = g_hash_table_new (g_int64_hash, g_int64_equal); memset (&control, 0, sizeof (control)); memset (&state, 0, sizeof (state)); @@ -556,9 +562,11 @@ itemize_shape_and_place (PangoFont *font, int advances[1000]; GOFFSET offsets[1000]; ABC abc; - int script = items[item].a.eScript; + gint32 script = items[item].a.eScript; int ng; int char_offset; + SCRIPT_CACHE *script_cache; + gint64 font_and_script_key; memset (advances, 0, sizeof (advances)); memset (offsets, 0, sizeof (offsets)); @@ -584,9 +592,33 @@ itemize_shape_and_place (PangoFont *font, items[item].a.fNoGlyphIndex ? " fNoGlyphIndex" : "", items[item].iCharPos, items[item+1].iCharPos-1, itemlen); #endif + /* Create a hash key based on hfont and script engine */ + font_and_script_key = (((gint64) ((gint32) hfont)) << 32) | script; + + /* Get the script cache for this hfont and script */ + script_cache = g_hash_table_lookup (script_cache_hash, &font_and_script_key); + if (!script_cache) + { + gint64 *key_n; + SCRIPT_CACHE *new_script_cache; + + key_n = g_new (gint64, 1); + *key_n = font_and_script_key; + + new_script_cache = g_new0 (SCRIPT_CACHE, 1); + script_cache = new_script_cache; + + /* Insert the new value */ + g_hash_table_insert (script_cache_hash, key_n, new_script_cache); + +#ifdef BASIC_WIN32_DEBUGGING + if (pango_win32_debug) + g_print (" New SCRIPT_CACHE for font %p and script %d\n", hfont, script); +#endif + } items[item].a.fRTL = analysis->level % 2; - if ((*script_shape) (hdc, &script_cache[script], + if ((*script_shape) (hdc, script_cache, wtext + items[item].iCharPos, itemlen, G_N_ELEMENTS (iglyphs), &items[item].a, @@ -616,7 +648,7 @@ itemize_shape_and_place (PangoFont *font, nglyphs, glyphs->log_clusters + ng, char_offset); - if ((*script_place) (hdc, &script_cache[script], iglyphs, nglyphs, + if ((*script_place) (hdc, script_cache, iglyphs, nglyphs, visattrs, &items[item].a, advances, offsets, &abc)) { @@ -676,9 +708,7 @@ uniscribe_shape (PangoFont *font, { wchar_t *wtext; long wlen; - int i; gboolean retval = TRUE; - SCRIPT_CACHE script_cache[100]; if (!pango_win32_font_select_font (font, hdc)) return FALSE; @@ -689,11 +719,7 @@ uniscribe_shape (PangoFont *font, if (retval) { - memset (script_cache, 0, sizeof (script_cache)); - retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs, script_cache); - for (i = 0; i < G_N_ELEMENTS (script_cache); i++) - if (script_cache[i]) - (*script_free_cache)(&script_cache[i]); + retval = itemize_shape_and_place (font, hdc, wtext, wlen, analysis, glyphs); } if (retval) diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h index 9f358230..73df2e99 100644 --- a/pango/pangowin32-private.h +++ b/pango/pangowin32-private.h @@ -129,11 +129,8 @@ struct _PangoWin32Font PangoFontMap *fontmap; - /* Written by pango_win32_get_hfont: */ + /* Written by _pango_win32_font_get_hfont: */ HFONT hfont; - gint tm_ascent; - gint tm_descent; - gint tm_overhang; PangoWin32Face *win32face; @@ -275,6 +272,8 @@ gboolean _pango_win32_get_name_record (HDC hdc, gint i, struct name_record *record); +HFONT _pango_win32_font_get_hfont (PangoFont *font); + extern HDC _pango_win32_hdc; extern OSVERSIONINFO _pango_win32_os_version_info; extern gboolean _pango_win32_debug; diff --git a/pango/pangowin32.c b/pango/pangowin32.c index 1f8c1d25..30ec8b6f 100644 --- a/pango/pangowin32.c +++ b/pango/pangowin32.c @@ -74,7 +74,6 @@ static gboolean pango_win32_font_real_select_font (PangoFont *font, static void pango_win32_font_real_done_font (PangoFont *font); static double pango_win32_font_real_get_metrics_factor (PangoFont *font); -static HFONT pango_win32_get_hfont (PangoFont *font); static void pango_win32_get_item_properties (PangoItem *item, PangoUnderline *uline, PangoAttrColor *fg_color, @@ -82,12 +81,11 @@ static void pango_win32_get_item_properties (PangoItem PangoAttrColor *bg_color, gboolean *bg_set); -static HFONT -pango_win32_get_hfont (PangoFont *font) +HFONT +_pango_win32_font_get_hfont (PangoFont *font) { PangoWin32Font *win32font = (PangoWin32Font *)font; PangoWin32FontCache *cache; - TEXTMETRIC tm; if (!win32font) return NULL; @@ -105,13 +103,6 @@ pango_win32_get_hfont (PangoFont *font) g_free (face_utf8); return NULL; } - - SelectObject (_pango_win32_hdc, win32font->hfont); - GetTextMetrics (_pango_win32_hdc, &tm); - - win32font->tm_overhang = tm.tmOverhang; - win32font->tm_descent = tm.tmDescent; - win32font->tm_ascent = tm.tmAscent; } return win32font->hfont; @@ -261,7 +252,7 @@ pango_win32_render (HDC hdc, if (glyphs->num_glyphs == 0) return; - hfont = pango_win32_get_hfont (font); + hfont = _pango_win32_font_get_hfont (font); if (!hfont) return; @@ -440,6 +431,7 @@ pango_win32_font_get_glyph_extents (PangoFont *font, PangoWin32Font *win32font = (PangoWin32Font *)font; guint16 glyph_index = glyph; GLYPHMETRICS gm; + TEXTMETRIC tm; guint32 res; HFONT hfont; MAT2 m = {{0,1}, {0,0}, {0,0}, {0,1}}; @@ -465,7 +457,7 @@ pango_win32_font_get_glyph_extents (PangoFont *font, memset (&gm, 0, sizeof (gm)); - hfont = pango_win32_get_hfont (font); + hfont = _pango_win32_font_get_hfont (font); SelectObject (_pango_win32_hdc, hfont); /* FIXME: (Alex) This constant reuse of _pango_win32_hdc is not thread-safe */ @@ -491,10 +483,11 @@ pango_win32_font_get_glyph_extents (PangoFont *font, info->ink_rect.y = - PANGO_SCALE * gm.gmptGlyphOrigin.y; info->ink_rect.height = PANGO_SCALE * gm.gmBlackBoxY; + GetTextMetrics (_pango_win32_hdc, &tm); info->logical_rect.x = 0; info->logical_rect.width = PANGO_SCALE * gm.gmCellIncX; - info->logical_rect.y = - PANGO_SCALE * win32font->tm_ascent; - info->logical_rect.height = PANGO_SCALE * (win32font->tm_ascent + win32font->tm_descent); + info->logical_rect.y = - PANGO_SCALE * tm.tmAscent; + info->logical_rect.height = PANGO_SCALE * (tm.tmAscent + tm.tmDescent); g_hash_table_insert (win32font->glyph_info, GUINT_TO_POINTER(glyph), info); } @@ -562,7 +555,7 @@ pango_win32_font_get_metrics (PangoFont *font, info->sample_str = sample_str; info->metrics = metrics = pango_font_metrics_new (); - hfont = pango_win32_get_hfont (font); + hfont = _pango_win32_font_get_hfont (font); if (hfont != NULL) { PangoCoverage *coverage; @@ -626,7 +619,7 @@ static gboolean pango_win32_font_real_select_font (PangoFont *font, HDC hdc) { - HFONT hfont = pango_win32_get_hfont (font); + HFONT hfont = _pango_win32_font_get_hfont (font); if (!hfont) return FALSE; @@ -1611,7 +1604,7 @@ font_has_name_in (PangoFont *font, if (cjkv == PANGO_WIN32_COVERAGE_UNSPEC) return TRUE; - hfont = pango_win32_get_hfont (font); + hfont = _pango_win32_font_get_hfont (font); oldhfont = SelectObject (_pango_win32_hdc, hfont); if (!_pango_win32_get_name_header (_pango_win32_hdc, &header)) diff --git a/pango/pangowin32.def b/pango/pangowin32.def index 13b6e8b1..ec8e8b2d 100644 --- a/pango/pangowin32.def +++ b/pango/pangowin32.def @@ -3,6 +3,7 @@ EXPORTS _pango_win32_make_matching_logfontw _pango_win32_font_get_type _pango_win32_font_map_get_type + _pango_win32_font_get_hfont pango_win32_font_cache_free pango_win32_font_cache_load pango_win32_font_cache_loadw -- cgit v1.2.1 From 3743d1c82066ecd4f8d6d6fba993b15fcc8d9773 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 27 Jun 2010 23:40:18 +0300 Subject: Typo fix As such libpangowin32 is deprecated, I guess... --- pango/pangowin32.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pangowin32.def b/pango/pangowin32.def index ec8e8b2d..6d9a2785 100644 --- a/pango/pangowin32.def +++ b/pango/pangowin32.def @@ -13,7 +13,7 @@ EXPORTS pango_win32_font_description_from_logfontw pango_win32_font_get_glyph_index pango_win32_font_logfont - pango_win32_font_logfont + pango_win32_font_logfontw pango_win32_font_map_for_display pango_win32_font_map_get_font_cache pango_win32_get_context -- cgit v1.2.1 From e94a21a9b52a5b9f9e4a5f1e19f9c84a16bf2838 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 8 Jul 2010 15:51:33 -0400 Subject: Add PANGO_LIBDIR and PANGO_SYSCONFDIR enviroment variables Add environment variables to override the compile time values for the libdir and sysconfdir. This provides additional flexibility and enables using a static pango.modules file for libraries packaged with an application on OS X by setting environment variables at application startup and using paths of the form: @executable_path/../lib/pango/modules/.. in the modules file. https://bugzilla.gnome.org/show_bug.cgi?id=554524 --- pango/pango-utils.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pango/pango-utils.c b/pango/pango-utils.c index 100dbc7a..1e10448c 100644 --- a/pango/pango-utils.c +++ b/pango/pango-utils.c @@ -692,19 +692,23 @@ DllMain (HINSTANCE hinstDLL, G_CONST_RETURN char * pango_get_sysconf_subdirectory (void) { -#ifdef G_OS_WIN32 - static gchar *result = NULL; + static const gchar *result = NULL; if (result == NULL) { +#ifdef G_OS_WIN32 gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll); result = g_build_filename (root, "etc\\pango", NULL); g_free (root); - } - return result; #else - return SYSCONFDIR "/pango"; + const char *sysconfdir = g_getenv ("PANGO_SYSCONFDIR"); + if (sysconfdir != NULL) + result = g_build_filename (sysconfdir, "pango", NULL); + else + result = SYSCONFDIR "/pango"; #endif + } + return result; } /** @@ -721,11 +725,11 @@ pango_get_sysconf_subdirectory (void) G_CONST_RETURN char * pango_get_lib_subdirectory (void) { -#ifdef G_OS_WIN32 static gchar *result = NULL; if (result == NULL) { +#ifdef G_OS_WIN32 gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll); /* If we are running against an uninstalled copy of the Pango DLL, * use the compile-time installation prefix. @@ -735,11 +739,15 @@ pango_get_lib_subdirectory (void) else result = g_build_filename (root, "lib\\pango", NULL); g_free (root); - } - return result; #else - return LIBDIR "/pango"; + const char *libdir = g_getenv ("PANGO_LIBDIR"); + if (libdir != NULL) + result = g_build_filename (libdir, "pango", NULL); + else + result = LIBDIR "/pango"; #endif + } + return result; } -- cgit v1.2.1 From 9b43da625483b68aa8702d217523bf9d8a8100d6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 22 Jul 2010 23:15:33 -0400 Subject: Bug 617772 - pango fails to build from git outside source tree Depends on gobject-introspection >= 0.6.14, where introspection sources are referenced via VPATH. Remove $(srcdir) prefix in sources. Signed-off-by: Theppitak Karoonboonyanan --- configure.in | 2 +- pango/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 86eb4df9..0fd3f609 100644 --- a/configure.in +++ b/configure.in @@ -481,7 +481,7 @@ PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=tr # Checks for GObject Introspection # -GOBJECT_INTROSPECTION_CHECK([0.6.7]) +GOBJECT_INTROSPECTION_CHECK([0.6.14]) # # Modules to build diff --git a/pango/Makefile.am b/pango/Makefile.am index 37510fa0..69b08005 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -171,7 +171,7 @@ Pango_1_0_gir_PACKAGES = gobject-2.0 cairo freetype2 Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango_1_0_gir_LIBS = libpango-1.0.la Pango_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) -Pango_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pango_introspection_files)) +Pango_1_0_gir_FILES = $(pango_introspection_files) # ------------------- libpangox ------------------- -- cgit v1.2.1 From 955b51cc5221a2624ea6c49c3f42e6f32f127419 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 6 Aug 2010 12:48:10 -0400 Subject: Bug 625807 - approximate character width is 0 on pangoft2 Fix regression. --- pango/pangofc-font.c | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c index 7c38ab76..d9b6fa8a 100644 --- a/pango/pangofc-font.c +++ b/pango/pangofc-font.c @@ -491,9 +491,30 @@ pango_fc_font_create_base_metrics_for_context (PangoFcFont *fcfont, return metrics; } -/* This function is cut-and-pasted into pangocairo-fcfont.c - it might be - * better to add a virtual fcfont->create_context (font). - */ +static int +max_glyph_width (PangoLayout *layout) +{ + int max_width = 0; + GSList *l, *r; + + for (l = pango_layout_get_lines_readonly (layout); l; l = l->next) + { + PangoLayoutLine *line = l->data; + + for (r = line->runs; r; r = r->next) + { + PangoGlyphString *glyphs = ((PangoGlyphItem *)r->data)->glyphs; + int i; + + for (i = 0; i < glyphs->num_glyphs; i++) + if (glyphs->glyphs[i].geometry.width > max_width) + max_width = glyphs->glyphs[i].geometry.width; + } + } + + return max_width; +} + static PangoFontMetrics * pango_fc_font_get_metrics (PangoFont *font, PangoLanguage *language) @@ -538,6 +559,27 @@ pango_fc_font_get_metrics (PangoFont *font, info->metrics = pango_fc_font_create_base_metrics_for_context (fcfont, context); + { /* Compute derived metrics */ + PangoLayout *layout; + PangoRectangle extents; + const char *sample_str = pango_language_get_sample_string (language); + PangoFontDescription *desc = pango_font_describe_with_absolute_size (font); + + layout = pango_layout_new (context); + pango_layout_set_font_description (layout, desc); + pango_font_description_free (desc); + + pango_layout_set_text (layout, sample_str, -1); + pango_layout_get_extents (layout, NULL, &extents); + + info->metrics->approximate_char_width = extents.width / pango_utf8_strwidth (sample_str); + + pango_layout_set_text (layout, "0123456789", -1); + info->metrics->approximate_digit_width = max_glyph_width (layout); + + g_object_unref (layout); + } + g_object_unref (context); g_object_unref (fontmap); } -- cgit v1.2.1 From d3f2af76130687f72653c1866fb8af91b6500250 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Tue, 10 Aug 2010 16:31:44 +1000 Subject: Bug 626500 - Fails to compile with gobject-introspection 0.9 --- pango/Makefile.am | 2 +- pango/pango-engine-private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pango/Makefile.am b/pango/Makefile.am index 69b08005..5747400b 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -527,7 +527,7 @@ pangocairo-$(PANGO_API_VERSION).lib: libpangocairo-$(PANGO_API_VERSION).la $(src if HAVE_INTROSPECTION girdir = $(datadir)/gir-1.0 -dist_gir_DATA = $(INTROSPECTION_GIRS) +gir_DATA = $(INTROSPECTION_GIRS) typelibsdir = $(libdir)/girepository-1.0 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) diff --git a/pango/pango-engine-private.h b/pango/pango-engine-private.h index 5c88a4b1..c57c74dc 100644 --- a/pango/pango-engine-private.h +++ b/pango/pango-engine-private.h @@ -23,7 +23,7 @@ #ifndef __PANGO_ENGINE_PRIVATE_H__ #define __PANGO_ENGINE_PRIVATE_H__ -#include +#include "pango-engine.h" G_BEGIN_DECLS -- cgit v1.2.1 From 2baffa4c47b64c4b6a0603eaeb951a6be6ba5b5e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 24 Aug 2010 19:47:49 -0400 Subject: Fix include --- pango/pango-engine-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango/pango-engine-private.h b/pango/pango-engine-private.h index c57c74dc..7d743027 100644 --- a/pango/pango-engine-private.h +++ b/pango/pango-engine-private.h @@ -23,7 +23,7 @@ #ifndef __PANGO_ENGINE_PRIVATE_H__ #define __PANGO_ENGINE_PRIVATE_H__ -#include "pango-engine.h" +#include G_BEGIN_DECLS -- cgit v1.2.1 From b13aea4f55a6db5518866af72cd079a5c002a8f1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 25 Aug 2010 12:00:34 -0400 Subject: Bug 627902 - explicitely link dump-boundaries to GLib --- tests/Makefile.am | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 75248a5d..fa3ed125 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -52,15 +52,18 @@ if HAVE_FREETYPE check_PROGRAMS += test-ot-tags endif +TEST_PANGO_LIBS = $(GLIB_LIBS) ../pango/libpango-$(PANGO_API_VERSION).la +TEST_PANGOFT2_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangoft2-$(PANGO_API_VERSION).la +TEST_PANGOCAIRO_LIBS = $(TEST_PANGO_LIBS) ../pango/libpangocairo-$(PANGO_API_VERSION).la + gen_all_unicode_LDADD = $(GLIB_LIBS) -testboundaries_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la -testboundaries_ucd_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la -testcolor_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la -testiter_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la ../pango/libpangocairo-$(PANGO_API_VERSION).la -testscript_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la -test_ot_tags_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la ../pango/libpangoft2-$(PANGO_API_VERSION).la - -dump_boundaries_LDADD = ../pango/libpango-$(PANGO_API_VERSION).la +testboundaries_LDADD = $(TEST_PANGO_LIBS) +testboundaries_ucd_LDADD = $(TEST_PANGO_LIBS) +testcolor_LDADD = $(TEST_PANGO_LIBS) +testiter_LDADD = $(TEST_PANGOCAIRO_LIBS) +testscript_LDADD = $(TEST_PANGO_LIBS) +test_ot_tags_LDADD = $(TEST_PANGOFT2_LIBS) +dump_boundaries_LDADD = $(TEST_PANGO_LIBS) if HAVE_CXX check_PROGRAMS += cxx-test -- cgit v1.2.1 From 7030230ac42811e44fb47d9af0149e425abacc79 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 25 Aug 2010 15:48:41 -0400 Subject: Bug 627978 - explicitly link with the math lib (-lm) for use of 'cos' --- examples/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/Makefile.am b/examples/Makefile.am index a2c5a2b8..4cb54baf 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -18,6 +18,7 @@ if HAVE_CAIRO_PNG noinst_PROGRAMS += cairosimple cairotwisted cairoshape cairosimple_LDADD = \ + -lm \ ../pango/libpango-$(PANGO_API_VERSION).la \ ../pango/libpangocairo-$(PANGO_API_VERSION).la \ $(GLIB_LIBS) \ -- cgit v1.2.1 From 0aa7efebfbbe72336f5db23279ef1c93ab839b17 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 31 Aug 2010 18:12:40 -0400 Subject: introspection: Filter out private headers We shouldn't scan private headers. Also add --warn-all. https://bugzilla.gnome.org/show_bug.cgi?id=627973 --- pango/Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pango/Makefile.am b/pango/Makefile.am index 5747400b..07f36753 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -7,7 +7,7 @@ GPATH = $(srcdir) include $(INTROSPECTION_MAKEFILE) INTROSPECTION_GIRS = -INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --add-include-path=. +INTROSPECTION_SCANNER_ARGS = --warn-all --add-include-path=$(srcdir) --add-include-path=. INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=. if HAVE_FREETYPE @@ -171,7 +171,7 @@ Pango_1_0_gir_PACKAGES = gobject-2.0 cairo freetype2 Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango_1_0_gir_LIBS = libpango-1.0.la Pango_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) -Pango_1_0_gir_FILES = $(pango_introspection_files) +Pango_1_0_gir_FILES = $(filter-out %-private.h, $(pango_introspection_files)) # ------------------- libpangox ------------------- @@ -279,7 +279,7 @@ PangoFT2_1_0_gir_PACKAGES = gobject-2.0 freetype2 pangoft2 PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 freetype2-2.0 fontconfig-2.0 PangoFT2_1_0_gir_LIBS = libpangoft2-1.0.la PangoFT2_1_0_gir_CFLAGS = -I$(top_srcdir) -PangoFT2_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pangoft2_introspection_files)) +PangoFT2_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoft2_introspection_files))) # ------------------- libpangoxft ------------------- @@ -328,7 +328,7 @@ PangoXft_1_0_gir_PACKAGES = gobject-2.0 freetype2 PangoXft_1_0_gir_INCLUDES = GObject-2.0 PangoFT2-1.0 xft-2.0 xlib-2.0 PangoXft_1_0_gir_LIBS = libpangoxft-1.0.la PangoXft_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) -PangoXft_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pangoxft_introspection_files)) +PangoXft_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoxft_introspection_files))) # ------------------- libpangocairo ------------------- @@ -415,7 +415,7 @@ PangoCairo_1_0_gir_PACKAGES = gobject-2.0 cairo PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 $(PANGOCAIRO_FONT_BACKEND_GI_MODULE) PangoCairo_1_0_gir_LIBS = libpangocairo-1.0.la PangoCairo_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) -PangoCairo_1_0_gir_FILES = $(addprefix $(srcdir)/,$(pangocairo_introspection_files)) +PangoCairo_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangocairo_introspection_files))) # ------------------- libpangowin32 ------------------- -- cgit v1.2.1 From 4f5c9708455308eb2fb692817db6ef103505da72 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 11 Sep 2010 14:52:28 +0300 Subject: Reduce DLL hijack risk and simplify code in basic-win32 module Dont load usp10.dll dynamically with LoadLibrary(). Just link to the Uniscribe API directly. MinGW comes with an import library so no problem with that either. The Uniscribe DLL is present on all versions of Windows we care for. --- modules/basic/Makefile.am | 3 +- modules/basic/basic-win32.c | 136 ++++++++++---------------------------------- 2 files changed, 33 insertions(+), 106 deletions(-) diff --git a/modules/basic/Makefile.am b/modules/basic/Makefile.am index acd0c4d4..93604c9e 100644 --- a/modules/basic/Makefile.am +++ b/modules/basic/Makefile.am @@ -47,7 +47,8 @@ endif endif pango_basic_win32_la_LDFLAGS = -module $(MODULE_LIBTOOL_OPTIONS) -pango_basic_win32_la_LIBADD = $(pangowin32libs) -lgdi32 +pango_basic_win32_la_LIBADD = $(pangowin32libs) -lgdi32 -lusp10 +libpango_basic_win32_la_LIBADD = -lgdi32 -lusp10 pango_basic_win32_la_SOURCES = basic-win32.c libpango_basic_win32_la_SOURCES = basic-win32.c libpango_basic_win32_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_basic_win32 diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c index 22aafdb5..7a27d501 100644 --- a/modules/basic/basic-win32.c +++ b/modules/basic/basic-win32.c @@ -50,55 +50,8 @@ static gboolean pango_win32_debug = FALSE; #include -static gboolean have_uniscribe = FALSE; - static HDC hdc; -typedef HRESULT (WINAPI *pScriptGetProperties) (const SCRIPT_PROPERTIES ***, - int *); - -typedef HRESULT (WINAPI *pScriptItemize) (const WCHAR *, - int, - int, - const SCRIPT_CONTROL *, - const SCRIPT_STATE *, - SCRIPT_ITEM *, - int *); - -typedef HRESULT (WINAPI *pScriptShape) (HDC, - SCRIPT_CACHE *, - const WCHAR *, - int, - int, - SCRIPT_ANALYSIS *, - WORD *, - WORD *, - SCRIPT_VISATTR *, - int *); - -typedef HRESULT (WINAPI *pScriptPlace) (HDC, - SCRIPT_CACHE *, - const WORD *, - int, - const SCRIPT_VISATTR *, - SCRIPT_ANALYSIS *, - int *, - GOFFSET *, - ABC *); - -typedef HRESULT (WINAPI *pScriptFreeCache) (SCRIPT_CACHE *); - -typedef HRESULT (WINAPI *pScriptIsComplex) (WCHAR *, - int, - DWORD); - -static pScriptGetProperties script_get_properties; -static pScriptItemize script_itemize; -static pScriptShape script_shape; -static pScriptPlace script_place; -static pScriptFreeCache script_free_cache; -static pScriptIsComplex script_is_complex; - #ifdef BASIC_WIN32_DEBUGGING static const SCRIPT_PROPERTIES **scripts; static int nscripts; @@ -528,8 +481,8 @@ itemize_shape_and_place (PangoFont *font, g_print (G_STRLOC ": ScriptItemize: uDefaultLanguage:%04x uBidiLevel:%d\n", control.uDefaultLanguage, state.uBidiLevel); #endif - if ((*script_itemize) (wtext, wlen, G_N_ELEMENTS (items), &control, NULL, - items, &nitems)) + if (ScriptItemize (wtext, wlen, G_N_ELEMENTS (items), &control, NULL, + items, &nitems)) { #ifdef BASIC_WIN32_DEBUGGING if (pango_win32_debug) @@ -618,14 +571,14 @@ itemize_shape_and_place (PangoFont *font, } items[item].a.fRTL = analysis->level % 2; - if ((*script_shape) (hdc, script_cache, - wtext + items[item].iCharPos, itemlen, - G_N_ELEMENTS (iglyphs), - &items[item].a, - iglyphs, - log_clusters, - visattrs, - &nglyphs)) + if (ScriptShape (hdc, script_cache, + wtext + items[item].iCharPos, itemlen, + G_N_ELEMENTS (iglyphs), + &items[item].a, + iglyphs, + log_clusters, + visattrs, + &nglyphs)) { #ifdef BASIC_WIN32_DEBUGGING if (pango_win32_debug) @@ -648,9 +601,9 @@ itemize_shape_and_place (PangoFont *font, nglyphs, glyphs->log_clusters + ng, char_offset); - if ((*script_place) (hdc, script_cache, iglyphs, nglyphs, - visattrs, &items[item].a, - advances, offsets, &abc)) + if (ScriptPlace (hdc, script_cache, iglyphs, nglyphs, + visattrs, &items[item].a, + advances, offsets, &abc)) { #ifdef BASIC_WIN32_DEBUGGING if (pango_win32_debug) @@ -757,7 +710,7 @@ text_is_simple (const char *text, if (wtext == NULL) return TRUE; - retval = ((*script_is_complex) (wtext, wlen, SIC_COMPLEX) == S_FALSE); + retval = (ScriptIsComplex (wtext, wlen, SIC_COMPLEX) == S_FALSE); g_free (wtext); @@ -787,8 +740,7 @@ basic_engine_shape (PangoEngineShape *engine, g_return_if_fail (length >= 0); g_return_if_fail (analysis != NULL); - if (have_uniscribe && - !text_is_simple (text, length) && + if (!text_is_simple (text, length) && uniscribe_shape (font, text, length, analysis, glyphs)) return; @@ -877,33 +829,10 @@ basic_engine_shape (PangoEngineShape *engine, static void init_uniscribe (void) { - HMODULE usp10_dll; - - have_uniscribe = FALSE; - - if ((usp10_dll = LoadLibrary ("usp10.dll")) != NULL) - { - (script_get_properties = (pScriptGetProperties) - GetProcAddress (usp10_dll, "ScriptGetProperties")) && - (script_itemize = (pScriptItemize) - GetProcAddress (usp10_dll, "ScriptItemize")) && - (script_shape = (pScriptShape) - GetProcAddress (usp10_dll, "ScriptShape")) && - (script_place = (pScriptPlace) - GetProcAddress (usp10_dll, "ScriptPlace")) && - (script_free_cache = (pScriptFreeCache) - GetProcAddress (usp10_dll, "ScriptFreeCache")) && - (script_is_complex = (pScriptIsComplex) - GetProcAddress (usp10_dll, "ScriptIsComplex")) && - (have_uniscribe = TRUE); - } - if (have_uniscribe) - { #ifdef BASIC_WIN32_DEBUGGING - (*script_get_properties) (&scripts, &nscripts); + ScriptGetProperties (&scripts, &nscripts); #endif - hdc = pango_win32_get_dc (); - } + hdc = pango_win32_get_dc (); } static void @@ -940,28 +869,25 @@ PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, script_engines[0].scripts = basic_scripts; script_engines[0].n_scripts = G_N_ELEMENTS (basic_scripts); - if (have_uniscribe) - { #if 0 - int i; - GArray *ranges = g_array_new (FALSE, FALSE, sizeof (PangoEngineRange)); + int i; + GArray *ranges = g_array_new (FALSE, FALSE, sizeof (PangoEngineRange)); - /* Walk through scripts supported by the Uniscribe implementation on this - * machine, and mark corresponding Unicode ranges. - */ - for (i = 0; i < nscripts; i++) - { - } + /* Walk through scripts supported by the Uniscribe implementation on this + * machine, and mark corresponding Unicode ranges. + */ + for (i = 0; i < nscripts; i++) + { + } - /* Sort range array */ - g_array_sort (ranges, compare_range); - script_engines[0].ranges = ranges; - script_engines[0].n_ranges = ranges->len; + /* Sort range array */ + g_array_sort (ranges, compare_range); + script_engines[0].ranges = ranges; + script_engines[0].n_ranges = ranges->len; #else - script_engines[0].scripts = uniscribe_scripts; - script_engines[0].n_scripts = G_N_ELEMENTS (uniscribe_scripts); + script_engines[0].scripts = uniscribe_scripts; + script_engines[0].n_scripts = G_N_ELEMENTS (uniscribe_scripts); #endif - } *engines = script_engines; *n_engines = G_N_ELEMENTS (script_engines); -- cgit v1.2.1 From 254f42980e272f0560b28d466c2b65a1748b1132 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 14 Sep 2010 14:50:01 -0400 Subject: Bug 629632 - configure bug --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0fd3f609..d5c531c6 100644 --- a/configure.in +++ b/configure.in @@ -565,7 +565,7 @@ for module in $included_modules; do *-win32) INCLUDED_WIN32_MODULES="$INCLUDED_WIN32_MODULES $included_path" ;; *-atsui) INCLUDED_ATSUI_MODULES="$INCLUDED_ATSUI_MODULES $included_path" ;; *-lang) INCLUDED_LANG_MODULES="$INCLUDED_LANG_MODULES $included_path" ;; - *) AC_MSG_ERROR([specified module $module not recognized]) ;; + *) IFS="$pango_save_ifs" AC_MSG_ERROR([specified module $module not recognized]) ;; esac done IFS="$pango_save_ifs" -- cgit v1.2.1