summaryrefslogtreecommitdiff
path: root/pango/glyphstring.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't compute log attrs on demandMatthias Clasen2021-08-291-15/+3
| | | | If we don't have them, just do the fallback.
* Add pango_glyph_string_index_to_x_fullMatthias Clasen2021-08-291-24/+61
| | | | | | This variant of pango_glyph_string_index_to_x takes log attrs so it does not have to compute them when it needs them to determine grapheme boundaries.
* Try harder to disect clustersMatthias Clasen2021-08-291-15/+34
| | | | | | | | | | We need to take into account whether the characters we are counting are actually cursor positions, else we are bound to look for more carets than the font has available, sometimes. This change would benefit from passing log attrs into pango_glyph_string_index_to_x.
* Try harder to find positions in clustersMatthias Clasen2021-08-271-3/+32
| | | | | | | Try to find a single non-mark glyph in a multi-glyph cluster to use its ligature caret information. This fixes situations in Arabic where you can have marks on top of ligatures, e.g. ﻉﻭ.
* Take kerning into account for ligature caretsMatthias Clasen2021-08-271-0/+3
| | | | | | | The ligature caret positions returned by hb_ot_layout_get_ligature_carets are 'unshaped' metrics. We need to take the kerning into account that is applied during shaping, and shows up in the glyphstring as x_offset.
* Fixes for rtl cursor positionsMatthias Clasen2021-08-271-1/+4
| | | | Still not working quite right, but getting closer.
* doc: Update pango_glyph_string_index_to_xMatthias Clasen2021-08-261-2/+9
| | | | | | What the docs were saying is no longer strictly true, now that we are using font metrics. Update them, and add an illustration.
* Use ligature caret listsligature-caretsMatthias Clasen2021-08-251-36/+89
| | | | | | | | Some fonts provide information about where to place carets inside ligatures. Use it, when it is available. Fixes: #39
* glyphstring: Silence compiler warningsMatthias Clasen2021-08-221-4/+4
|
* Add a few missing constglyph-string-const-charMatthias Clasen2021-08-171-12/+12
| | | | | We should only pass char * when we actually modify the string. Everything else is const char *.
* 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)