From: Behdad Esfahbod Date: Tue, 21 Sep 2010 19:47:17 +0000 (-0400) Subject: Merge branch 'master' into harfbuzz-ng-external X-Git-Tag: 1.31.0~19^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64ada662476f5b5506a9a455f4c39242ab51ff38;p=platform%2Fupstream%2Fpango.git Merge branch 'master' into harfbuzz-ng-external Conflicts: pango/Makefile.am pango/pango-ot-buffer.c pango/pango-ot-info.c Removed: pango/opentype/Makefile.am pango/opentype/hb-blob.c pango/opentype/hb-open-file-private.hh pango/opentype/hb-open-type-private.hh pango/opentype/hb-ot-layout-common-private.hh pango/opentype/hb-ot-layout-gdef-private.hh pango/opentype/hb-ot-layout-gpos-private.hh pango/opentype/hb-ot-layout-gsub-private.hh pango/opentype/hb-ot-layout-gsubgpos-private.hh pango/opentype/hb-ot-layout.cc pango/opentype/hb-ot-layout.h pango/opentype/hb-private.h --- 64ada662476f5b5506a9a455f4c39242ab51ff38 diff --cc modules/basic/basic-fc.c index b3619c3,e3852c3..cd5cebe --- a/modules/basic/basic-fc.c +++ b/modules/basic/basic-fc.c @@@ -25,8 -25,8 +25,9 @@@ #include "config.h" #include +#define PANGO_ENABLE_BACKEND 1 /* XXX */ #include + #include "pango-engine.h" #include "pango-utils.h" #include "pangofc-font.h" diff --cc pango/Makefile.am index e1285b5,07f3675..7e033b4 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@@ -4,10 -4,21 +4,13 @@@ # which are more like other make's VPATH. GPATH = $(srcdir) - EXTRA_DIST = - BUILT_GIRSOURCES = + include $(INTROSPECTION_MAKEFILE) + + INTROSPECTION_GIRS = + INTROSPECTION_SCANNER_ARGS = --warn-all --add-include-path=$(srcdir) --add-include-path=. + INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=. -if HAVE_FREETYPE -OPENTYPE_SUBDIR=opentype -endif - -FRIBIDI_SUBDIR=mini-fribidi - -SUBDIRS = $(OPENTYPE_SUBDIR) $(FRIBIDI_SUBDIR) - -DIST_SUBDIRS = mini-fribidi opentype +SUBDIRS = mini-fribidi INCLUDES = \ -DG_LOG_DOMAIN=\"Pango\" \ diff --cc pango/pango-ot-buffer.c index e818d61,f5a6851..e4b6436 --- a/pango/pango-ot-buffer.c +++ b/pango/pango-ot-buffer.c @@@ -211,29 -201,123 +212,9 @@@ pango_ot_buffer_get_glyphs (const Pango *glyphs = (PangoOTGlyph *) hb_buffer_get_glyph_infos (buffer->buffer); if (n_glyphs) - *n_glyphs = hb_buffer_get_len (buffer->buffer); -} - -static void -apply_gpos_ltr (PangoGlyphString *glyphs, - hb_glyph_position_t *positions, - gboolean scale, - double xscale, - double yscale, - gboolean is_hinted) -{ - int i; - - for (i = 0; i < glyphs->num_glyphs; i++) - { - FT_Pos x_pos = positions[i].x_pos; - FT_Pos y_pos = positions[i].y_pos; - int back = i; - int j; - int adjustment; - - - adjustment = PANGO_UNITS_26_6(positions[i].x_advance); - - 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; - else - glyphs->glyphs[i].geometry.width += adjustment; - - - while (positions[back].back != 0) - { - back -= positions[back].back; - x_pos += positions[back].x_pos; - y_pos += positions[back].y_pos; - } - - for (j = back; j < i; j++) - glyphs->glyphs[i].geometry.x_offset -= glyphs->glyphs[j].geometry.width; - - 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; - - for (i = 0; i < glyphs->num_glyphs; i++) - { - int i_rev = glyphs->num_glyphs - i - 1; - int back_rev = i_rev; - int back; - FT_Pos x_pos = positions[i_rev].x_pos; - FT_Pos y_pos = positions[i_rev].y_pos; - int j; - int adjustment; - - - adjustment = PANGO_UNITS_26_6(positions[i_rev].x_advance); - - 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; - else - glyphs->glyphs[i].geometry.width += adjustment; - - - while (positions[back_rev].back != 0) - { - back_rev -= positions[back_rev].back; - x_pos += positions[back_rev].x_pos; - y_pos += positions[back_rev].y_pos; - } - - back = glyphs->num_glyphs - back_rev - 1; - - for (j = i; j < back; j++) - glyphs->glyphs[i].geometry.x_offset += glyphs->glyphs[j].geometry.width; - - 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); - } - } + *n_glyphs = hb_buffer_get_length (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; - } - } - /** * pango_ot_buffer_output * @buffer: a #PangoOTBuffer @@@ -285,7 -394,42 +266,7 @@@ pango_ot_buffer_output (const PangoOTBu } if (buffer->rtl) - swap_range (glyphs, 0, glyphs->num_glyphs); - { - /* Swap all glyphs */ - pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); - } - - 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, scale, xscale, yscale, buffer->font->is_hinted); - else - apply_gpos_ltr (glyphs, positions, scale, xscale, yscale, buffer->font->is_hinted); - } - else - { - /* FIXME we should only do this if the 'kern' feature was requested */ - pango_fc_font_kern_glyphs (buffer->font, glyphs); - } - - pango_fc_font_unlock_face (buffer->font); ++ pango_glyph_string_reverse_range (glyphs, 0, glyphs->num_glyphs); + if (!buffer->applied_gpos) + pango_fc_font_kern_glyphs (buffer->font, glyphs); }