summaryrefslogtreecommitdiff
path: root/pango/glyphstring.c
Commit message (Collapse)AuthorAgeFilesLines
* docs: Reduce redundancydocs-cleanupsMatthias Clasen2021-05-201-2/+0
| | | | | | 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: Convert gtk-doc syntax leftoversdocs-cleanupMatthias Clasen2021-05-191-43/+36
| | | | | Remove leftovers like #Type, reduce indentations to avoid markdown block quotes, etc.
* introspection: Stop using allow-noneMatthias Clasen2021-05-191-2/+2
| | | | | The allow-none annotation has been deprecated for a long time already. Instead use optional and nullable everywhere.
* Use g_memdup2()memdup2Matthias Clasen2021-03-181-5/+5
| | | | | The g_memdup() function is replaced by a safer version in newer versions of GLib.
* docs: Tweak glyphstring docsMatthias Clasen2021-03-111-44/+52
| | | | Give doc comments summaries, etc.
* docs: Add extent imagesMatthias Clasen2019-08-041-0/+4
| | | | Add an illustration of logical and ink rects.
* Add many missing nullability annotations.Evan Nemerson2014-10-161-10/+10
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731022
* introspection: assorted fixes to avoid regressions in Vala bindingsEvan Nemerson2012-08-121-11/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=681423
* adding output parameters introspection metadata to pango_glypth_string_extentsAlberto Ruiz2011-04-251-2/+2
|
* adding allow-none introspection metadata to pango_glyph_string_extents ↵Alberto Ruiz2011-04-251-4/+4
| | | | parameters
* Use G_DEFINE_BOXED_TYPE.Christian Persch2010-11-041-12/+3
| | | | Bug #539622.
* Bug 602823 - void function cannot return valueBehdad Esfahbod2009-11-251-1/+1
|
* Bug 596614 - Pango application receives SIGSEGV on pasting text with U+202EBehdad Esfahbod2009-11-171-2/+0
| | | | | Fixed all modules to reverse glyphs if run is rtl. Except for Hangul module. Fixed pango_shape() to detect that, warn, and reverse.
* New public API: pango_glyph_item_get_logical_widths()Behdad Esfahbod2009-08-121-35/+4
|
* Handle NUL in text in places that g_utf8_strlen () was usedBehdad Esfahbod2009-07-151-2/+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 580987 – SIGFPE in pango_glyph_string_index_to_xBehdad Esfahbod2009-05-011-0/+6
| | | | Be pedantic about broken cluster setup, avoid div-by-zero.
* [glyphstring] Handle overflow with very long glyphstringsBehdad Esfahbod2009-03-021-6/+20
|
* Bug 431394 – Use pango_glyph_item_iter in more placesBehdad Esfahbod2008-08-061-36/+34
| | | | | | | | | | | 2008-08-06 Behdad Esfahbod <behdad@gnome.org> Bug 431394 – Use pango_glyph_item_iter in more places * pango/glyphstring.c (pango_glyph_string_get_logical_widths): Use pango_glyph_item_iter for cluster iteration. svn path=/trunk/; revision=2680
* 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 469313 – Add pango_layout_set_height() Bug 508179 – PangoGlyphUnitBehdad Esfahbod2008-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-01-14 Behdad Esfahbod <behdad@gnome.org> Bug 469313 – Add pango_layout_set_height() Bug 508179 – PangoGlyphUnit confusion * pango/pango-layout.h: * pango/pango-layout-private.h: * pango/pango-layout.c: * pango/ellipsize.c (_pango_layout_line_ellipsize): New public API: pango_layout_set_height() See docs for semantics. Currently only negative height values (number of lines) is implemented. * pango-view/viewer-render.c (make_layout), (output_body), (parse_options): Implement --height. * pango/pango.def: * docs/pango-sections.txt: * docs/tmpl/layout.sgml: Update. 2008-01-14 Behdad Esfahbod <behdad@gnome.org> Bug 508179 – PangoGlyphUnit confusion * pango/pangowin32.c: * pango/glyphstring.c: * pango/pango-layout.c (process_item): Remove all traces of #PangoGlyphUnit svn path=/trunk/; revision=2542
* Fix another Oops of mine from recent commits.Behdad Esfahbod2007-10-241-1/+2
| | | | | | | | | | | 2007-10-24 Behdad Esfahbod <behdad@gnome.org> * pango/glyphstring.c (pango_glyph_string_copy), (pango_glyph_string_free): Fix another Oops of mine from recent commits. svn path=/trunk/; revision=2466
* Bug 471577 – GBoxed GType for PangoGlyphItemBehdad Esfahbod2007-10-241-5/+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
* Fix more typosBehdad Esfahbod2007-08-151-2/+2
| | | | svn path=/trunk/; revision=2399
* Fix more typos, and use TRUE/FALSE instead of 1/0Behdad Esfahbod2007-08-151-4/+4
| | | | svn path=/trunk/; revision=2398
* Fix typoBehdad Esfahbod2007-08-141-1/+1
| | | | svn path=/trunk/; revision=2397
* Move contents of mapping.c to glyphstring.c where they belong.Behdad Esfahbod2007-08-011-0/+305
| | | | | | | | | | | | | | | | 2007-08-01 Behdad Esfahbod <behdad@gnome.org> * pango/Makefile.am: * pango/glyphstring.c (pango_glyph_string_index_to_x), (pango_glyph_string_x_to_index): * pango/mapping.c: Move contents of mapping.c to glyphstring.c where they belong. * pango/pango-layout.c (pango_layout_line_x_to_index): Fix typo. svn path=/trunk/; revision=2389
* 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
* *.c, *.h: Replace preceding sequences of 8 spaces with tabs.Behdad Esfahbod2007-01-161-10/+10
| | | | | | | | | 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-17/+17
| | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Drop trailing whitespace. svn path=/trunk/; revision=2163
* Spell-check the docs.Behdad Esfahbod2007-01-071-4/+4
| | | | svn path=/trunk/; revision=2130
* Return if none of logical_rect or ink_rect is non-NULL.Behdad Esfahbod2006-08-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | 2006-08-15 Behdad Esfahbod <behdad@gnome.org> * pango/pango-layout.c (pango_layout_run_get_extents): * pango/glyphstring.c (pango_glyph_string_extents_range): Return if none of logical_rect or ink_rect is non-NULL. * pango/pango-item.h (PangoAnalysis): Add new member centered_baseline which if set, makes item rendered such that ascent == descent. * pango/pango-context.c (itemize_state_init), (itemize_state_add_character): * pango/pango-renderer.c (pango_renderer_draw_layout_line): Implement centered_baseline. * pango/pangocairo-fcfont.c (pango_cairo_fc_font_get_metrics): When adjusting ascent/descent for vertical fonts, adjust strikethrough and underline position too. * docs/tmpl/main.sgml: Document new struct member.
* Fix silly error in implementation of pango_glyph_string_get_width(), andBehdad Esfahbod2006-07-081-4/+2
| | | | | | | | | | | | 2006-07-08 Behdad Esfahbod <behdad@gnome.org> * pango/glyphstring.c (pango_glyph_string_get_width): * pango/pango-glyph.h: * pango/pango-layout.c (pango_layout_line_index_to_x), (pango_layout_line_x_to_index), (pango_layout_line_get_x_ranges): * pango/pango-renderer.c (pango_renderer_draw_layout_line): Fix silly error in implementation of pango_glyph_string_get_width(), and also remove unused font parameter from its signature.
* Part of Bug 135683 – Cache glyphstring extentsBehdad Esfahbod2006-07-081-0/+27
| | | | | | | | | | | | | | | | | | 2006-07-08 Behdad Esfahbod <behdad@gnome.org> Part of Bug 135683 – Cache glyphstring extents * docs/pango-sections.txt: * docs/tmpl/glyphs.sgml: * pango/pango.def: * pango/pango-glyph.h: * pango/glyphstring.c (pango_glyph_string_get_width): New function. Much faster than calling pango_glyph_string_extents and using logical_rect.width. * pango/pango-renderer.c (add_underline), (add_strikethrough), (pango_renderer_draw_layout_line): Use the new function for optimization.
* Bug 337594 – pango_glyph_string_extents_range possible bugBehdad Esfahbod2006-04-291-2/+2
| | | | | | | | | 2006-04-29 Behdad Esfahbod <behdad@gnome.org> Bug 337594 – pango_glyph_string_extents_range possible bug * pango/glyphstring.c (pango_glyph_string_extents_range): Add offset for first glyph too.
* 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.
* Change g_critical to g_warning. We already handle them gracefully.Behdad Esfahbod2006-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 2006-02-21 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c, pango/glyphstring.c, pango/pango-fontmap.c, pango/pango-ot-buffer.c, pango/pangocairo-font.c, pango/pangoft2.c, pango/pangoxft-font.c, pango/shape.c: Change g_critical to g_warning. We already handle them gracefully. Bug 331994 – --disable-debug removes G_DISABLE_CAST_CHECKS Patch from charlet@act-europe.fr * configure.in: Do not lose PANGO_DEBUG_FLAGS when reassigning. Bug 331995 – pango_layout_set_text optimization Patch from charlet@act-europe.fr * pango/pango-layout.c: Do not validate input text if asserts are disabled. Moreover, do not truncate input text on invalid sequence. Bug 331996 – avoid crashes in win32 font handling Patch from charlet@act-europe.fr * pango/pangofc-fontmap.c, pango/pangowin32-fontmap.c, pango/pangowin32.c: if (!font) return NULL in a number of places.
* 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-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Fix up right-to-left case. (Based on patch from Damon Chaplin, #117325)Owen Taylor2003-07-241-4/+7
| | | | | | | | Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): Fix up right-to-left case. (Based on patch from Damon Chaplin, #117325)
* Improve handling of empty ink rectangles; rework for simplicity. (#103662)Owen Taylor2003-06-041-49/+55
| | | | | | | | Wed Jun 4 14:32:47 2003 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_extents_range): Improve handling of empty ink rectangles; rework for simplicity. (#103662)
* Clarify the meaning of the @end parameter. (#96843, Jungshik Shin)Owen Taylor2002-11-261-1/+2
| | | | | | | | Mon Nov 25 20:25:23 2002 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_extents_range): Clarify the meaning of the @end parameter. (#96843, Jungshik Shin)
* Don't offset the logical rect by y_offset - this generally is not desired,Owen Taylor2002-01-101-2/+2
| | | | | | | | | | Thu Jan 10 15:04:31 2002 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_extents_range): Don't offset the logical rect by y_offset - this generally is not desired, since it means that the logical height of a line could change if it included accented characters. (#67921, Dov Grobgeld)
* Update to the new g_boxed_type_register_static API.Alex Larsson2001-09-101-3/+1
| | | | | | | | | | | | 2001-09-10 Alex Larsson <alexl@redhat.com> * pango/fonts.c: * pango/glyphstring.c: * pango/pango-attributes.c: * pango/pango-color.c: * pango/pango-tabs.c: * pango/pango-utils.c: Update to the new g_boxed_type_register_static API.
* copy function. (pango_glyph_string_get_type): implement get_type function.James Henstridge2001-07-021-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | 2001-07-02 James Henstridge <james@daa.com.au> * pango/glyphstring.c (pango_glyph_string_copy): copy function. (pango_glyph_string_get_type): implement get_type function. * pango/pango-glyph.h (pango_glyph_string_get_type): get_type function prototype. (pango_glyph_string_copy): prototype for copy function. * pango/pango-utils.c (pango_language_get_type): implementation. * pango/pango-types.h (pango_language_get_type): get_type function. * pango/pango-tabs.c (pango_tab_array_get_type): implementation. * pango/pango-tabs.h (pango_tab_array_get_type): get_type function. * pango/fonts.c (pango_font_description_get_type): implementation. * pango/pango-font.h (pango_font_description_get_type): add get_type function for typecode.
* add assertion that shaper != NULL to catch engine problems fasterHavoc Pennington2000-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-12-14 Havoc Pennington <hp@redhat.com> * pango/fonts.c (pango_font_find_shaper): add assertion that shaper != NULL to catch engine problems faster * pango/Makefile.am (libpangox_la_SOURCES): modules.[hc] and module-defs.c have to go in libpangox for now since the modules use the X stuff, and static linkage won't let you play games here * examples/Makefile.am (pango_viewer_LDADD): fix order of link * modules/indic/pango-indic-script.h (pango_indic_get_char): make this a macro, so it doesn't collide between modules * modules/*/Makefile.am: Fix to work if the module isn't included * examples/Makefile.am: don't query modules if we didn't build any * modules/indic/gurmukhi.c (MODULE_ENTRY): fix prefix * modules/indic/bengali.c (MODULE_ENTRY): fix prefix * modules/indic/gujarati.c (MODULE_ENTRY): fix prefix * modules/indic/devanagari.c (MODULE_ENTRY): fix prefix * modules/indic/myanmar.c (MODULE_ENTRY): uniquely prefix the functions * modules/Makefile.am (MODULES): handle case where there are no modules to query * configure.in: Fix up include_modules stuff to work with Indic * pango/glyphstring.c (pango_glyph_string_set_size): Just g_error() if the glyph string exceeds maximum integer size, instead of mysteriously crashing later.
* Test against start not zero.Owen Taylor2000-11-171-1/+1
| | | | | | | Thu Nov 16 18:59:21 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_extents_range): Test against start not zero.
* Add new PangoLayoutIter entry pointsHavoc Pennington2000-11-131-16/+48
| | | | | | | | | | | | | | | | | | 2000-11-13 Havoc Pennington <hp@redhat.com> * docs/pango-sections.txt: Add new PangoLayoutIter entry points * pango/glyphstring.c (pango_glyph_string_extents_range): New function * pango/pango-layout.c: Create PangoLayoutIter for iterating over a layout's visual elements * pango/pango-layout.c (pango_layout_check_lines): plug a memleak (attr iterator not freed) * pango/pango-tabs.c (pango_tab_array_free): plug a memleak (array->tabs not freed)