summaryrefslogtreecommitdiff
path: root/pango/pango-item.c
Commit message (Collapse)AuthorAgeFilesLines
* docs: Reduce redundancydocs-cleanupsMatthias Clasen2021-05-201-4/+2
| | | | | | Remove a boatload of "or %NULL" from nullable parameters and return values. gi-docgen generates suitable text from the annotation that we don't need to duplicate.
* docs: Port PangoItem to the new doc formatMatthias Clasen2021-03-111-37/+41
| | | | Replace gtk-doc'isms and use gi-docgen links instead.
* Fix misleading indentationMatthias Clasen2019-07-241-1/+1
|
* Fix no-break attribute filteringMatthias Clasen2019-07-171-1/+5
| | | | pango_attribute_equal does not compare ranges. Oops.
* Document pango_item_apply_attrsMatthias Clasen2019-07-121-0/+18
|
* Add pango_item_apply_attrsMatthias Clasen2019-07-111-0/+45
| | | | | This adds attrs that are overlapping the range of the item to the extra_attrs in the analysis.
* Add many missing nullability annotations.Evan Nemerson2014-10-161-5/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731022
* Use G_DEFINE_BOXED_TYPE.Christian Persch2010-11-041-11/+3
| | | | Bug #539622.
* 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-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add G_UNLIKELY() to type registration block in _get_type() functions.Behdad Esfahbod2007-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-06-20 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c (pango_font_description_get_type), (pango_font_metrics_get_type): * pango/glyphstring.c (pango_glyph_string_get_type): * pango/pango-attributes.c (pango_attr_list_get_type): * pango/pango-color.c (pango_color_get_type): * pango/pango-item.c (pango_item_get_type): * pango/pango-language.c (pango_language_get_type): * pango/pango-layout.c (pango_layout_line_get_type), (pango_layout_iter_get_type): * pango/pango-matrix.c (pango_matrix_get_type): * pango/pango-ot-info.c (pango_ot_info_get_type): * pango/pango-ot-ruleset.c (pango_ot_ruleset_get_type): * pango/pango-tabs.c (pango_tab_array_get_type): * pango/pangoatsui-fontmap.c (pango_atsui_family_get_type), (pango_atsui_face_get_type): * pango/pangofc-fontmap.c (pango_fc_face_get_type), (pango_fc_family_get_type): * pango/pangowin32-fontmap.c (pango_win32_family_get_type), (pango_win32_face_get_type): * pango/pangox-fontmap.c (pango_x_font_map_get_type), (pango_x_face_get_type), (pango_x_family_get_type): * pango/pangox.c (pango_x_font_get_type): Add G_UNLIKELY() to type registration block in _get_type() functions. svn path=/trunk/; revision=2364
* Fix letter-spacing with justification. We now distribute letter-spacingBehdad Esfahbod2007-05-021-1/+0
| | | | | | | | | | | | | | | | | 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
* *.c, *.h: Replace preceding sequences of 8 spaces with tabs.Behdad Esfahbod2007-01-161-4/+4
| | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Replace preceding sequences of 8 spaces with tabs. svn path=/trunk/; revision=2165
* *.c, *.h: Drop trailing whitespace.Behdad Esfahbod2007-01-161-12/+12
| | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Drop trailing whitespace. svn path=/trunk/; revision=2163
* Don't copy item before g_return_if_fail'ing it for NULL. (Coverity issueBehdad Esfahbod2006-05-131-1/+2
| | | | | | | 2006-05-13 Behdad Esfahbod <behdad@gnome.org> * pango/pango-item.c (pango_item_split): Don't copy item before g_return_if_fail'ing it for NULL. (Coverity issue id=18509&runid=43)
* Make #include syntax in sources and headers more consistent. We are usingBehdad Esfahbod2006-03-311-3/+3
| | | | | | | | | 2006-03-30 Behdad Esfahbod <behdad@gnome.org> * pango/*.[ch]: Make #include syntax in sources and headers more consistent. We are using the "..." syntax for all Pango headers in source files, and <...> syntax in all header files, except for including private headers, that we use "...".
* Hook up pango-utils.h into the documentation, as we are installing itBehdad Esfahbod2006-03-311-1/+1
| | | | | | | | 2006-03-30 Behdad Esfahbod <behdad@gnome.org> Hook up pango-utils.h into the documentation, as we are installing it anyway. Move some internal stuff to pango-impl-utils.h and make source files include that instead.
* Improve documentation for functions allocating memory, on how the objectBehdad Esfahbod2006-01-311-3/+6
| | | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* pango/Makefile.am, pango/fonts.c, pango/glyphstring.c,Behdad Esfahbod2006-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 2006-01-05 Behdad Esfahbod <behdad@gnome.org> * pango/Makefile.am, * pango/fonts.c, * pango/glyphstring.c, * pango/pango-attributes.c, * pango/pango-color.c, * pango/pango-impl-utils.h, * pango/pango-item.c, * pango/pango-layout.c, * pango/pango-tabs.c, * pango/pango-utils.c, * pango/pango-utils.h, * pango/pangoatsui-fontmap.c, * pango/pangocairo-font.c, * pango/pangocairo-fontmap.c, * pango/pangofc-fontmap.c, * pango/pangowin32-fontmap.c, * pango/pangox-fontmap.c, * pango/pangox.c, * pango/opentype/pango-ot-info.c, * pango/opentype/pango-ot-ruleset.c: Intern strings to avoid unnecessary strdups in the type system. (bug #325832, Matthias Clasen)
* Based on patch from Gustavo J. A. M. Carneiro (#305975)Owen Taylor2005-07-221-0/+12
| | | | | | | | | | | | | | 2005-07-21 Owen Taylor <otaylor@redhat.com> Based on patch from Gustavo J. A. M. Carneiro (#305975) * pango/pango-layout.[ch] (pango_layout_line_ref) pango/pango-attributes.[ch] (pango_attr_list_ref): Return the argument to _ref() functions. * pango/pango-item.[ch]: Register PangoItem boxed type. * pango/pango-layout.[ch]: Register PangoLayoutLine boxed type.
* Fix trivial bug in last commitOwen Taylor2003-07-241-1/+1
|
* Handle NULL item->analysis.font. (#14576, Morten Welinder)Owen Taylor2003-07-241-2/+4
| | | | | | | Thu Jul 24 17:06:38 2003 Owen Taylor <otaylor@redhat.com> * pango/pango-item.c (pango_item_copy/free): Handle NULL item->analysis.font. (#14576, Morten Welinder)
* Add a new PangoLanguage type to represent language tags; these canOwen Taylor2001-06-141-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sat Jun 9 17:36:09 2001 Owen Taylor <otaylor@redhat.com> * pango/pango-types.h pango/pango-utils.c: Add a new PangoLanguage type to represent language tags; these can efficiently be compared and don't need to be copied. Also add pango_language_matches() to match a language tag against a pattern. * pango/pango-item.[ch] pango/pango-layout.c: Move extra_attrs from PangoItem to PangoAnalysis. Add a language tag field to PangoAnalysis. (#55894) * pango/pango-attributes.[ch] (pango_attr_iterator_get_font): Return the language tag as well. * pango/pango-attributes.[ch]: Rename PangoAttrLang to PangoAttrLanguage, and make it hold a PangoLanguage. * pango/pango-context.[ch]: Rename pango_context_{get,set}_lang() to pango_context_{get,set}_language(). * **.[ch]: Adapt to PangoLanguage and s/lang/language/ changes. * modules/basic/basic-x.c modules/basic/tables-big.i: Add support for ordering character sets differently for different language tags. * pango/itemize.c: Remove old, unused file. * pango/pango-context.c (pango_itemize): Reduce number of mallocs by allocating one array of PangoAnalysis instead of many arrays.
* Free item->extra_attrs list.32001-01-231-1/+4
| | | | | | | | | | | | | | 2001-01-23 <alla@lysator.liu.se> * pango/pango-item.c (pango_item_free): Free item->extra_attrs list. * pango/pango-layout.c (process_item): Don't leak copy of item. * pango/pango-utils.c (read_config_file): If the config file open fails, don't leak the temp buffers.
* delete lang engineHavoc Pennington2000-12-021-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-30 Havoc Pennington <hp@pobox.com> * modules/thai/thai.c: delete lang engine * modules/tamil/tamil.c: delete lang engine (tamil_engine_x_new): fix type tag for shape engine * modules/indic/myanmar.c: delete lang engine (pango_engine_x_new): fix type tag for shape engine * modules/indic/gurmukhi.c: delete lang engine (pango_indic_engine_x_new): fix type tag for shape engine * modules/indic/gujarati.c: delete lang engine (pango_indic_engine_x_new): fix type tag for shape engine * modules/indic/devanagari.c: delete lang engine (pango_indic_engine_x_new): fix type tag for shape engine * modules/indic/pango-indic-script.h (SCRIPT_ENGINE_DEFINITION): delete lang engine * modules/indic/bengali.c: delete the lang engine (pango_indic_engine_x_new): fix type tag for shape engine * modules/hangul/hangul.c: delete the lang engine (hangul_engine_x_new): fix type tag for shape engine * modules/basic/basic.c: delete the lang engine (basic_engine_x_new): fix type tag for shape engine * modules/basic/basic-win32.c: delete the lang engine (basic_engine_win32_new): this was a shape engine, use correct type tag * modules/basic/basic-ft2.c: delete the lang engine * modules/arabic/arabic.c: Delete the lang engine (arabic_engine_x_new): this is a shape engine, not a lang engine, fix type tag * pango/pango-layout.c (pango_layout_index_to_line_x): handle the fact that paragraph delimiters aren't in the layout lines (pango_layout_index_to_pos): update to handle paragraph delimiters * pango/break.c (pango_find_paragraph_boundary): New function to find paragraph boundaries * pango/pango-layout.c (get_items_log_attrs): don't separate calls to pango_break() when directional level changes * pango/pango-layout.h (struct _PangoLayoutLine): put start index of the line into the struct * pango/pango-layout.c (pango_layout_get_cursor_pos): Fixups to reflect the fact that paragraph separators are removed from the input text. * pango/pango-layout.c (can_break_at): don't special-case start of line and whitespace-following-alphabetic here, because pango_break() already handles that properly * tests/testboundaries.c, tests/Makefile.am, tests/runtests.sh: Add directory for test programs, and a script to run them all * configure.in: Create Makefile in tests * pango/break.c (pango_break): Try for a real implementation of the Unicode text boundary algorithms (pango_get_log_attrs): Allow length to be -1 * pango/pango-context.c (pango_itemize): use pango_item_new(), assert that items added to the list are sane. * pango/pango-layout.c (pango_layout_check_lines): Reimplement to honor the paragraph boundaries from pango_break() * pango/pango-layout.c (process_item): use pango_item_split() here * pango/pango-item.c (pango_item_split): New function to split an item into two items
* s/pango_font_set_data/g_object_set_qdata/Owen Taylor2000-05-281-2/+2
| | | | | | | | | | | Sat May 27 21:06:13 2000 Owen Taylor <otaylor@redhat.com> * modules/thai/thai.c modules/basic/basic: s/pango_font_set_data/g_object_set_qdata/ * pango/*.c: s/pango_font_[un]ref/g_object_un[ref] * pango/pango-font.h fonts.c: GObject'ify PangoFont.
* Memory management functions for PangoItem.Owen Taylor2000-03-131-0/+90
Mon Mar 13 10:54:48 2000 Owen Taylor <otaylor@redhat.com> * pango/pango-item.[ch]: Memory management functions for PangoItem. * pango/*.[ch]: Random constification. * pango/pangox.c pango/pango-layout.c pango/pango-context.c: Add an extra_attrs field to PangoItem. Use this to handle underlining for PangoLayout. * examples/viewer.c (reload_font): Make paragraphs global to save the complexity of passing it around all over the place. * pango/pango-layout.[ch] (pango_layout_context_changed): Add a function to reset the layout on changes to the layout's context. * pango/pangox.c (pango_x_make_matching_xlfd): Prefer bitmap to scaleable if the discrepancy is < 1 pixel. (Probably not the ideal criterion.) * pango/pangox.c (pango_x_font_map_for_display): Fix resolution computation error. * pango/pango-layout.c (pango_layout_check_lines): Handle text with embedded newlines. * pango/pangox.c (pango_x_render_layout): Fix y to refer to the top of the layout, not the baseline of the first line. * pango/pango-layout.c (process_item): Don't wrap if width is set to -1. * Makefile.am configure.in **/*.[ch]: move libpango/ directory and fix all headers to install under include/pango/