summaryrefslogtreecommitdiff
path: root/pango/pango-glyph-item.c
Commit message (Collapse)AuthorAgeFilesLines
* Improve letterspacing with marksfix-letterspacingMatthias Clasen2021-03-211-1/+10
| | | | | | | | harfbuzz puts marks into their own clusters, so we need to work a little harder to keep non-spacing marks placed over their base character. Fixes: #541
* docs: Tweak glyph item docsMatthias Clasen2021-03-111-41/+49
| | | | Add summaries, convert markup, etc.
* glyph-item: Allocate attr iterator on the stackTimm Bäder2020-06-081-9/+11
|
* glyph iter: Adjust assertionsMatthias Clasen2019-07-171-2/+2
| | | | | | With the inserted hyphens we end up in a situation where we have start_char == end_char at the end of an item. It seems to be otherwise harmless.
* Protect against bugs in HarfBuzz's (non-)monotone cluster valuesBehdad Esfahbod2015-09-011-4/+4
| | | | | | "Fixes" https://bugzilla.gnome.org/show_bug.cgi?id=541608 Real fix went to HarfBuzz.
* Add assertion to glyph-item-iterBehdad Esfahbod2015-09-011-0/+8
| | | | Part of https://bugzilla.gnome.org/show_bug.cgi?id=541608
* Fix pango_glyph_item_iter_prev() around last clusterBehdad Esfahbod2015-08-081-4/+4
| | | | | | It was combining the last two clusters. Ouch! Test added already. Passes now.
* Add many missing nullability annotations.Evan Nemerson2014-10-161-6/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731022
* PangoGlyphItem: Better treatment of ellipsized runsMatthias Clasen2014-09-031-2/+6
| | | | | | | | | When we reapply non-shape attributes, we must take care to not add any attributes that start in the middle of an ellipsized run, or we end up with a blue, underlined ellipsis if there is a link anywhere inside the ellipsized text. https://bugzilla.gnome.org/show_bug.cgi?id=735732
* introspection: assorted fixes to avoid regressions in Vala bindingsEvan Nemerson2012-08-121-5/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=681423
* Add missing (element-type) annotations for list argumentsPavel Holejsovsky2012-06-041-3/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=677407
* Fixed (transfer full) introspection annotation for the return value in ↵Alberto Ruiz2011-04-261-3/+3
| | | | pango_glyph_item_apply_attr
* Use G_DEFINE_BOXED_TYPE.Christian Persch2010-11-041-22/+6
| | | | Bug #539622.
* New public API: pango_glyph_item_get_logical_widths()Behdad Esfahbod2009-08-121-0/+60
|
* Handle NUL in text in places that g_utf8_strlen () was usedBehdad Esfahbod2009-07-151-4/+4
| | | | | | | | | | While pango-layout doesn't allow NUL in text, the lower level API should handle it correctly. We were using g_utf8_strlen() in a number of places. This is problematic since that function stops processing at NUL even if length>1. We now use an internal pango_utf8_strlen() instead. Inspired by: Bug 588678 – pango crash: install a new theme from gnome-appearance-properties
* Bug 377948 – Make pango_glyph_item_iter publicBehdad Esfahbod2008-08-061-29/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-06 Behdad Esfahbod <behdad@gnome.org> Bug 377948 – Make pango_glyph_item_iter public * pango/pango-glyph-item.c (pango_glyph_item_iter_copy), (pango_glyph_item_iter_free), (pango_glyph_item_iter_get_type), (pango_glyph_item_iter_next_cluster), (pango_glyph_item_iter_prev_cluster), (pango_glyph_item_iter_init_start), (pango_glyph_item_iter_init_end), (pango_glyph_item_apply_attrs), (pango_glyph_item_letter_space): * pango/pango-glyph-item.h: New public API, for iterating a PangoGlyphItem: PangoGlyphItemIter PANGO_TYPE_GLYPH_ITEM_ITER pango_glyph_item_iter_copy() pango_glyph_item_iter_free() pango_glyph_item_iter_init_start() pango_glyph_item_iter_init_end() pango_glyph_item_iter_next_cluster() pango_glyph_item_iter_prev_cluster() * pango/pango.def: * docs/tmpl/glyphs.sgml: * docs/pango-sections.txt: * pango/Makefile.am: * pango/ellipsize.c (line_iter_next_cluster), (line_iter_prev_cluster), (find_initial_span): * pango/pango-layout.c (justify_words): Update. * pango/pango-glyph-item-private.h: Remove. svn path=/trunk/; revision=2679
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Behdad svn path=/trunk/; revision=2657
* Bug 471577 – GBoxed GType for PangoGlyphItemBehdad Esfahbod2007-10-241-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-10-24 Behdad Esfahbod <behdad@gnome.org> Bug 471577 – GBoxed GType for PangoGlyphItem * pango/pango-glyph-item.h: * pango/pango-glyph-item.c: New public API: PANGO_TYPE_GLYPH_ITEM pango_glyph_item_copy() pango_glyph_item_get_type() * pango/pango-layout.c: New public API: pango_layout_iter_copy() * pango/fonts.c (pango_font_description_copy), (pango_font_description_copy_static), (pango_font_description_free), (pango_font_descriptions_free), (pango_font_metrics_ref), (pango_font_metrics_unref): * pango/glyphstring.c (pango_glyph_string_copy), (pango_glyph_string_free): * pango/pango-attributes.c (pango_attr_list_ref), (pango_attr_list_unref), (pango_attr_list_copy): * pango/pango-color.c (pango_color_copy), (pango_color_free): * pango/pango-item.c (pango_item_copy), (pango_item_free): * pango/pango-layout.c (pango_layout_line_ref), (pango_layout_line_unref), (pango_layout_iter_copy), (pango_layout_iter_free): * pango/pango-layout.h: * pango/pango-matrix.c (pango_matrix_copy), (pango_matrix_free): Update all copy/free functions to accept NULL as legitimate input. Previously all were g_return_[val_]if_fail()ing it. * pango/pango.def: * docs/pango-sections.txt: * docs/tmpl/glyphs.sgml: * docs/tmpl/layout.sgml: Update. svn path=/trunk/; revision=2457
* Bug 464270 – ellipsize doesn't work consistentBehdad Esfahbod2007-08-081-0/+2
| | | | | | | | | | | | | | 2007-08-07 Behdad Esfahbod <behdad@gnome.org> Bug 464270 – ellipsize doesn't work consistent * pango/pango-glyph-item.c (_pango_glyph_item_iter_prev_cluster): Fix. Was jumping two clusters at a time. Oops! * pango/ellipsize.c (init_state): Minor cleanup. svn path=/trunk/; revision=2392
* Fix letter-spacing with justification. We now distribute letter-spacingBehdad Esfahbod2007-05-021-6/+37
| | | | | | | | | | | | | | | | | 2007-05-02 Behdad Esfahbod <behdad@gnome.org> * pango/pango-glyph-item.c (pango_glyph_item_letter_space): * pango/pango-item.c (pango_item_split): * pango/pango-layout.c (distribute_letter_spacing), (shape_run), (debug), (process_item), (process_line), (pad_glyphstring_right), (pad_glyphstring_left), (zero_line_final_space), (adjust_line_letter_spacing), (pango_layout_line_postprocess): Fix letter-spacing with justification. We now distribute letter-spacing equally on both sides of clusters, instead of putting it all on one side. svn path=/trunk/; revision=2253
* Fix the "menu accels are two chars wide" bug that was introduced by theBehdad Esfahbod2007-01-231-2/+2
| | | | | | | | | | | | 2007-01-22 Behdad Esfahbod <behdad@gnome.org> * pango/pango-glyph-item.c (_pango_glyph_item_iter_next_cluster): Fix the "menu accels are two chars wide" bug that was introduced by the recent changes in this function, in 1.15.4. Apparently glyph_index means separate things in next_cluster and prev_cluster. svn path=/trunk/; revision=2179
* *.c, *.h: Drop trailing whitespace.Behdad Esfahbod2007-01-161-48/+48
| | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Drop trailing whitespace. svn path=/trunk/; revision=2163
* Fix width calculation. Was causing ellipsization to stop at a zero-widthBehdad Esfahbod2007-01-161-4/+10
| | | | | | | | | | | | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> * pango/ellipsize.c (get_cluster_width): Fix width calculation. Was causing ellipsization to stop at a zero-width glyph that was part of a bigger cluster. * pango/ellipsize.c (remove_one_span): Skip over zero-width clusters, otherwise ellipsization will stop at a zero-width cluster. * pango/pango-glyph-item.c (_pango_glyph_item_iter_next_cluster), (_pango_glyph_item_iter_prev_cluster): Fix yet another bug with in prev_cluster that was making it not work for any interesting cluster. svn path=/trunk/; revision=2158
* Bug 323173 – Add layout of mixed direction text for vertical layoutBehdad Esfahbod2007-01-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-01-15 Behdad Esfahbod <behdad@gnome.org> Bug 323173 – Add layout of mixed direction text for vertical layout * pango/pango-gravity.h: * pango/pango-gravity.c: Moved gravity stuff here. New public API: PangoGravityHint pango_gravity_get_for_matrix() pango_gravity_get_for_script() * pango/pango-context.h: * pango/pango-context.c (pango_context_init), (update_resolved_gravity), (itemize_state_update_for_new_run): Support gravity hint. New public API: pango_context_set_gravity_hint() pango_context_get_gravity_hint() * pango/pango-utils.c: * pango/pango-matrix.c: * pango/pango-matrix.h: * pango/pango-types.h: Moved gravity and matrix stuff into its own header. pango-types.h includes both pango-matrix.h and pango-gravity.h * pango/pango.h: Include new headers. * pango/pango.def: * pango/Makefile.am: Update. * docs/pango-docs.sgml: * docs/pango-sections.txt: * docs/tmpl/glyphs.sgml: * docs/tmpl/main.sgml: * docs/tmpl/vertical.sgml: Add a section for Vertical Text. * examples/renderdemo.c (do_output), (parse_gravity_hint), (parse_options): Support gravity hint. * examples/test-mixed.txt: New test, mixed Latin, Arabic, Chinese text. svn path=/trunk/; revision=2144
* Spell-check the docs.Behdad Esfahbod2007-01-071-7/+7
| | | | svn path=/trunk/; revision=2130
* Bug 377975 – bug in _pango_glyph_item_iter_next_clusterBehdad Esfahbod2006-11-221-4/+4
| | | | | | | | | | 2006-11-22 Behdad Esfahbod <behdad@gnome.org> Bug 377975 – bug in _pango_glyph_item_iter_next_cluster * pango/pango-glyph-item.c (_pango_glyph_item_iter_next_cluster), (_pango_glyph_item_iter_prev_cluster): Fix condition for ending a cluster.
* Fix typo in private docs.Behdad Esfahbod2006-11-211-1/+1
| | | | | | 2006-11-21 Behdad Esfahbod <behdad@gnome.org> * pango/pango-glyph-item.c: Fix typo in private docs.
* Improve documentation for functions allocating memory, on how the objectBehdad Esfahbod2006-01-311-3/+5
| | | | | | | | | | | | | | | | 2006-01-31 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c, pango/glyphstring.c pango/pango-attributes.c pango/pango-color.c, pango/pango-context.c pango/pango-coverage.c, pango/pango-fontset.c pango/pango-glyph-item.c, pango/pango-item.c pango/pango-layout.c, pango/pango-ot-buffer.c pango/pango-ot-info.c, pango/pango-ot-ruleset.c pango/pango-script.c, pango/pango-tabs.c pango/pango-utils.c pango/pangocairo-fcfontmap.c, pango/pangocairo-fontmap.c pango/pangox-fontcache.c, pango/pangoxft-render.c: Improve documentation for functions allocating memory, on how the object should be freed.
* If locking font face failed, do not assert, just return zero glyphs withBehdad Esfahbod2006-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-01-29 Behdad Esfahbod <behdad@gnome.org> * modules/arabic/arabic-fc.c, modules/basic/basic-fc.c modules/hebrew/hebrew-fc.c, modules/indic/indic-fc.c modules/khmer/khmer-fc.c, modules/syriac/syriac-fc.c modules/thai/thai-ot.c, modules/thai/thai-shaper.c modules/tibetan/tibetan-fc.c: If locking font face failed, do not assert, just return zero glyphs with an implicit warning. * pango/fonts.c, pango/glyphstring.c pango/modules.c pango/pango-color.c, pango/pango-context.c pango/pango-coverage.c, pango/pango-fontmap.c pango/pango-glyph-item.c, pango/pango-item.c pango/pango-layout.c, pango/pango-markup.c pango/pango-ot-buffer.c, pango/pango-script.c pango/pango-tabs.c, pango/pango-utils.c pango/pangoatsui-fontmap.c, pango/pangocairo-fcfont.c pango/pangocairo-fcfontmap.c, pango/pangocairo-fontmap.c pango/pangocairo-win32font.c, pango/pangofc-font.c pango/pangofc-fontmap.c, pango/pangoft2-fontmap.c pango/pangoft2-render.c, pango/pangoft2.c pango/pangowin32-fontcache.c, pango/pangoxft-font.c pango/pangoxft-render.c, pango/break.c pango/ellipsize.c: Use g_slice for allocating all types. Also, change some g_error's to g_critical's...
* Make sure #include <config.h> is the first include in the file. (bugBehdad Esfahbod2006-01-141-0/+1
| | | | | | | 2006-01-14 Behdad Esfahbod <behdad@gnome.org> * */*.c, */*/*.c: Make sure #include <config.h> is the first include in the file. (bug #158870, based on patch by Luis Menina)
* Added "Since:" tags to all interfaces added after Pango 1.0. (#319116,Behdad Esfahbod2005-11-231-0/+2
| | | | | | | | | | | 2005-11-23 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c pango/pango-attributes.c pango/pango-context.c pango/pango-glyph-item.c pango/pango-layout.c pango/pango-script.c pango/pango-utils.c pango/pangofc-font.c pango/pangoft2-fontmap.c pango/opentype/pango-ot-buffer.c pango/opentype/pango-ot-ruleset.c: Added "Since:" tags to all interfaces added after Pango 1.0. (#319116, Brian Cameron)
* Various documentation improvements.Behdad Esfahbod2005-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 2005-11-16 Behdad Esfahbod <behdad@gnome.org> * docs/pango_markup.sgml docs/tmpl/coverage-maps.sgml docs/tmpl/engines.sgml docs/tmpl/fonts.sgml docs/tmpl/freetype-fonts.sgml docs/tmpl/glyphs.sgml docs/tmpl/layout.sgml docs/tmpl/main.sgml docs/tmpl/modules.sgml docs/tmpl/opentype.sgml docs/tmpl/pango-engine-lang.sgml docs/tmpl/pango-engine-shape.sgml docs/tmpl/pango-renderer.sgml docs/tmpl/pangocairo.sgml docs/tmpl/pangofc-decoder.sgml docs/tmpl/pangofc-font.sgml docs/tmpl/pangofc-fontmap.sgml docs/tmpl/scripts.sgml docs/tmpl/tab-stops.sgml docs/tmpl/text-attributes.sgml docs/tmpl/win32-fonts.sgml docs/tmpl/x-fonts.sgml docs/tmpl/xft-fonts.sgml pango/break.c pango/ellipsize.c pango/fonts.c pango/pango-attributes.c pango/pango-color.c pango/pango-context.c pango/pango-coverage.c pango/pango-fontmap.c pango/pango-glyph-item.c pango/pango-layout.c pango/pango-markup.c pango/pango-tabs.c pango/pango-types.h pango/pango-utils.c pango/pangoft2-render.c pango/pangox.c pango/pangoxft-render.c: Various documentation improvements.
* Fixes for signed/unsigned in PangoAttrIterator ((#166700, Morten Welinder)Owen Taylor2005-07-261-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-07-26 Owen Taylor <otaylor@redhat.com> Fixes for signed/unsigned in PangoAttrIterator ((#166700, Morten Welinder) * pango/pango-attributes.c (pango_attr_iterator_range): Clamp results to G_MAXINT to avoid negative numbers from signed/unsigned conversions. * pango/pango-attributes.c: Make PangoAttrIterator start_index/end_index unsigned to match PangoAttribute. Change various local variables to match. * pango/ellipsize.c (advance_iterator_to) pango/pango-attributes.c (pango_attr_iterator_range) pango/pango-glyph-item.c (pango_glyph_item_apply_attrs) pango/pango-layout.c (pango_layout_line_get_empty_extents): Always check the return value from pango_attr_iterator() to deal with potential infinite loops when trying to advance to position G_MAXINT. * pango/pango-layout.c (pango_layout_set_text): Handle the case where the text passed in is longer than than G_MAXINT and length < 0. * pango/pango-attributes.c (pango_attr_list_splice): Be careful about integer overflow - clamp addition. (#163246, Morten Welinder)
* Add PangoEllipsizeMode, pango_layout_set_ellipsize(), implement. (#59071)Owen Taylor2004-07-141-41/+174
| | | | | | | | | | | | | | | | | | Wed Jul 14 17:47:38 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.[ch] pango/ellipsize.c pango/Makefile.am: Add PangoEllipsizeMode, pango_layout_set_ellipsize(), implement. (#59071) * pango/pango-layout-private.h pango/pango-layout.c: Move PangoLayout structure into a separate header file. * pango/pango-glyph-item.[ch]: Add pango_glyph_item_free(). * pango/pango-glyph-item-private.h pango/pango-glyph-item.c: Internally export the PangoGlyphItemIter functionality. * examples/renderdemo.[ch]: Add --ellipsize option.
* Fix double cluster increment.PANGO_1_5_0Owen Taylor2004-06-281-3/+0
| | | | | | | Thu Jun 24 13:35:03 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-glyph-item.c (pango_glyph_item_apply_attrs): Fix double cluster increment.
* Add new letter_spacing attribute.Owen Taylor2004-06-231-80/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Jun 23 11:17:51 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-attributes.[ch]: Add new letter_spacing attribute. * pango/pango-attributes.c (pango_attr_rise_new): Correct description; rise is in Pango units, not em-relative. * pango/pango-glyph-item.c: Break out iteration-over-clusters from ApplyAttrsState into a separate GlyphItemIter. * pango/pango-glyph-item.[ch]: New function pango_glyph_item_letter_space() to add add letter spacing to a single glyph item. * pango/pango-markup.c: Add a letter_spacing attribute. * pango/pango-layout.c: Use G_DEFINE_TYPE(). * pango/pango-layout.c (pango_layout_get_item_properties): Switch to use a structure rather than a pile of out parameters. * pango/pango-layout.c (pango_run_get_extents): Remove the unused shape_set out parameter. * pango/pangofc-decoder.[ch] pango/pangofc-fontmap.[ch]: Doc fixes. * pango/pango-types.h: Deprecate pango_get_mirror_char() * pango/pango-utils.c (pango_get_mirror_char): Add docs. * docs/pango-sections.txt docs/pango-docs.sgml: Add PangoFcDecoder and letter spacing.
* Don't put statements with side-effects inside g_assert()! (#114137, JeffOwen Taylor2003-06-021-3/+3
| | | | | | | | Mon Jun 2 12:10:11 2003 Owen Taylor <otaylor@redhat.com> * pango/pango-glyph-item.c (pango_glyph_item_apply_attrs): Don't put statements with side-effects inside g_assert()! (#114137, Jeff Waugh)
* Fix a stupid bug in the shortcircuit case.Owen Taylor2003-05-301-2/+2
| | | | | | | Thu May 29 20:05:45 2003 Owen Taylor <otaylor@redhat.com> * pango/pango-glyph-item.c: Fix a stupid bug in the shortcircuit case.
* When applying attribute to a glyph item, handle attributes that splitOwen Taylor2003-05-291-29/+226
| | | | | | | | | | Thu May 29 18:37:58 2003 Owen Taylor <otaylor@redhat.com> * pango/pango-glyph-item.c (pango_glyph_item_apply_attrs): When applying attribute to a glyph item, handle attributes that split clusters by giving the cluster all the attributes that apply to it. (Previously caused a crash, #104976 Taneem Ahmed, Sunil Mohan Adapa)
* Free the iter. (Fix from Kjartan Maraas, #100672)Owen Taylor2002-12-081-0/+2
| | | | | | | Sun Dec 8 15:22:10 2002 Owen Taylor <otaylor@redhat.com> * pango/pango-glyph-item.c (pango_glyph_item_apply_attrs): Free the iter. (Fix from Kjartan Maraas, #100672)
* Rename PangoLayoutRun to PangoGlyphItem (with a typedef for compat), addOwen Taylor2002-12-031-0/+208
Sun Nov 17 23:28:26 2002 Owen Taylor <otaylor@redhat.com> * pango/pango-glyph-item.[ch] pango/pango-layout.h: Rename PangoLayoutRun to PangoGlyphItem (with a typedef for compat), add pango_glyph_item_split(), pango_glyph_item_apply_attrs(). * pango/pango-attributes.[ch]: Add pango_attr_list_filter(), pango_attr_iterator_get_attrs(). * pango/pango-layout.c: Remove attributes that don't affect shaping before shaping, shape and then add them back. Fixes the infamous "underscores break arabic shaping" bug (#83058) * pango/pango-item.h: Remove an extraneous include. * pango/pango-layout.c (imposed_shape): Fix bytes/chars problem for glyph->log_clusters. * pango/pango-layout.c (cluster_end_index) * pango/pango-layout.c (pango_layout_iter_next_cluster): Fix confusion between global indices and run-relative indices. * docs/tmpl/glyphs.sgml: Improve docs for log_clusters. * docs/*: Document new API and PangoOTRuleset