summaryrefslogtreecommitdiff
path: root/pango/pango-renderer.c
Commit message (Collapse)AuthorAgeFilesLines
* renderer: Use ink rects for line lengthsunderline-kerningMatthias Clasen2021-08-271-6/+6
| | | | | | | | | When rendering underlines and the like, we should use ink extents, since the logical extents will get shortened by kerning, which can be pretty noticable when underlining individual glyphs, such as the T in To. Fixes: #139
* renderer: Silence compiler warningsMatthias Clasen2021-08-221-0/+8
|
* renderer: Don't divide by zerorenderer-crashMatthias Clasen2021-08-211-1/+1
| | | | | | | | Before dividing by num_glyphs in draw_strikethrough, make sure it isn't 0. This should fix reported crashes in this function. Fixes: #599
* renderer: Fix averaging of strikethroughsfix-strikethrough-averagingMatthias Clasen2021-07-051-7/+8
| | | | | | | | | | | | | | In 85bdfead1b36945db251 I made consecutive runs average their strikeout positions, but I did handle the accounting properly, causing previous runs to influence the strikeout of later runs, if we have to draw them separately (due to color change). It would be nicer to average even across color changes and draw the line continuously in that case as well, but that would require two passes over the runs. Fixes: #574
* docs: Reduce redundancydocs-cleanupsMatthias Clasen2021-05-201-3/+3
| | | | | | 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-12/+13
| | | | | Remove leftovers like #Type, reduce indentations to avoid markdown block quotes, etc.
* introspection: Stop using allow-noneMatthias Clasen2021-05-191-3/+3
| | | | | The allow-none annotation has been deprecated for a long time already. Instead use optional and nullable everywhere.
* docs: Add some detailsMatthias Clasen2021-04-031-0/+12
| | | | Mainly for my own education.
* Revert "Merge branch 'fix-deadlocks' into 'master'"revert-1fedc11aMatthias Clasen2021-03-311-128/+0
| | | This reverts merge request !309
* Add dashed and dotted lineslinesMatthias Clasen2021-03-301-0/+128
| | | | | | | Extend the PangoUnderline and PangoOverline enumerations to cover dashed and dotted variants of the various lines, add api to PangoRenderer to render such lines, and implement it in the cairo renderer.
* docs: Tweak renderer docsMatthias Clasen2021-03-111-19/+19
| | | | Add summaries, convert markup, etc.
* docs: Port PangoRenderer to the new doc formatMatthias Clasen2021-03-111-381/+384
| | | | Replace gtk-doc'isms and use gi-docgen links instead.
* docs: Move PangoRenderer docs to the right fileMatthias Clasen2021-03-111-0/+12
|
* docs: Replace lots of vestigial xml markupMatthias Clasen2021-03-111-3/+3
| | | | | We want to use pure markdown, since docbook is going away as the intermediate format.
* renderer: Move overline to priv data structureSimon McVittie2020-08-161-11/+12
| | | | | | | | | | This reverts the ABI break caused by adding the overline to the public data structure, and is binary- and source-compatible with Pango 1.45.0 and older, but not compatible with versions 1.45.1 to 1.46.0 inclusive. Resolves: https://gitlab.gnome.org/GNOME/pango/-/issues/497 Bug-Debian: https://bugs.debian.org/968337 Signed-off-by: Simon McVittie <smcv@debian.org>
* renderer: Fix a division-by-zeroMatthias Clasen2020-06-081-3/+10
| | | | | | | | We need to check if height is zero before dividing by it. For completeness, check width at the same time. This was pointed out in https://gitlab.gnome.org/GNOME/pango/-/merge_requests/167
* Replace fallthrough comments with G_GNUC_FALLTHROUGHTimm Bäder2020-04-141-1/+1
|
* Don’t use underline position in overlinesKhaled Hosny2019-11-021-2/+1
| | | | | | This matches what web browsers do. Fixes https://gitlab.gnome.org/GNOME/pango/issues/432
* renderer: Implement overlinesMatthias Clasen2019-10-311-1/+120
| | | | | | | Implement overlines in PangoRenderer. This adds a new render part, and mirrors the machinery we have for underlines and strikethrough.
* Draw strikethrough continuouslyMatthias Clasen2019-10-311-13/+17
| | | | | | Average strikethrough position and thickness across consecutive struckthrough runs. This gives an OK result in common cases.
* renderer: Handle new underline valuesMatthias Clasen2019-10-311-0/+15
| | | | | | | Handle these by using the lowest position across a sequence of runs with the same underline. Closes: https://gitlab.gnome.org/GNOME/pango/issues/62
* doc cleanupsMatthias Clasen2019-07-231-2/+2
| | | | Clean up some headers, and shovel docs around.
* Drop deprecated instance private data APIEmmanuele Bassi2018-08-301-6/+3
| | | | | | | GLib 2.58 deprecated g_type_class_add_private(), at long last. Use the G_ADD_PRIVATE macro, and the generated instance private data getter function.
* layout/renderer: Don't heap-allocate short lived layout iteratorsTimm Bäder2017-10-271-7/+8
| | | | | | | Use the new _pango_layout_get_iter and _pango_layout_iter_destroy instead. https://bugzilla.gnome.org/show_bug.cgi?id=788643
* Drop an questionable G_UNLIKELYMatthias Clasen2017-06-301-1/+1
| | | | Owen and I agreed that this doesn't look right.
* Don't throw away text prematurelyMatthias Clasen2017-06-301-1/+1
| | | | | | | | | | | When calling into cairo to render glyphs, we want to use show_text_glyphs and pass the text along, if the surface supports that operation. But here, we throw the text away prematurely and end up always end passing no text or clusters down to cairo. https://bugzilla.gnome.org/show_bug.cgi?id=784394
* pango/pango-renderer.c: Fix BuildChun-wei Fan2015-09-041-2/+2
| | | | | Some compilers insist on using a number for a guint16 return type, and does not like using NULL in place of 0, so fix this.
* Add alpha support to PangoRendererMatthias Clasen2015-08-111-0/+70
| | | | | | Add pango_renderer_get/set_alpha to allow associating alpha values with the various colors. The alpha is stored as a value between 0 and 65536, with 0 meaning 'unset'.
* Add many missing nullability annotations.Evan Nemerson2014-10-161-11/+10
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731022
* Revert "Fix leftover markup in docs"Matthias Clasen2014-08-301-1/+1
| | | | This reverts commit 19a252d9a3d63e7816f9a77bab65bd161675440a.
* Fix leftover markup in docsMatthias Clasen2014-08-301-1/+1
|
* TypoBehdad Esfahbod2014-05-081-1/+1
| | | | Oops
* Bug 729840 - Missing annotation for get_colorBehdad Esfahbod2014-05-081-2/+2
|
* More churnBehdad Esfahbod2012-08-281-1/+1
|
* introspection: assorted fixes to avoid regressions in Vala bindingsEvan Nemerson2012-08-121-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=681423
* Bug 652841 - Various pieces of dead code found by gcc/clang static analyzerBehdad Esfahbod2011-06-171-1/+0
|
* Stop using G_CONST_RETURN in PangoRyan Lortie2011-06-091-1/+1
| | | | | | | G_CONST_RETURN is headed for deprecation (as per bug #644611). Stop using it in Pango. https://bugzilla.gnome.org/show_bug.cgi?id=652202
* pango/pango-renderer.c: parent_class is already defined in ↵Javier Jardón2011-04-301-5/+1
| | | | G_DEFINE_ABSTRACT_TYPE
* Fixing (transfer none) introspection annotation for the return value in ↵Alberto Ruiz2011-04-251-1/+1
| | | | pango_renderer_get_layout
* adding allow-none introspection metadata to pango_renderer_set_matrixAlberto Ruiz2011-04-251-1/+1
|
* adding allow-none introspection metadata to pango_renderer_set_colorAlberto Ruiz2011-04-251-1/+1
|
* adding allow-none introspection metadata to pango_renderer_draw_glyph_itemAlberto Ruiz2011-04-251-1/+1
|
* Bug 560792 – Make PangoLayoutLine with line->layout==NULL renderableBehdad Esfahbod2009-01-281-15/+21
| | | | | | | | | | | | 2009-01-28 Behdad Esfahbod <behdad@gnome.org> Bug 560792 – Make PangoLayoutLine with line->layout==NULL renderable * pango/pango-renderer.c (pango_renderer_draw_layout_line), (pango_renderer_draw_glyph_item), (pango_renderer_set_matrix): Handle line->layout == NULL. svn path=/trunk/; revision=2814
* Bug 469049 – Fix all compiler warningsBehdad Esfahbod2008-12-261-13/+12
| | | | | | | | | | | | | | | | | | | | | 2008-12-25 Behdad Esfahbod <behdad@gnome.org> Bug 469049 – Fix all compiler warnings * pango-view/viewer-pangocairo.c (render_callback): * pango/fonts.c (append_field), (pango_font_description_to_string): * pango/opentype/harfbuzz-dump.c: * pango/pango-bidi-type.c (pango_log2vis_get_embedding_levels): * pango/pango-coverage.c (pango_coverage_set): * pango/pango-markup.c (span_parse_func): * pango/pango-renderer.c (pango_renderer_default_draw_error_underline): * pango/pango-utils.c (pango_scan_string): * pango/pangocairo-render.c (pango_cairo_renderer_draw_trapezoid), (draw_error_underline), (pango_cairo_renderer_class_init): Fix all the remaining warnings. svn path=/trunk/; revision=2767
* Fix warnings.Behdad Esfahbod2008-12-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-12-25 Behdad Esfahbod <behdad@gnome.org> * pango/break.c (pango_default_break): * pango/fonts.c (find_field_any), (pango_font_class_init), (pango_font_init), (pango_font_metrics_ref), (pango_font_metrics_unref), (pango_font_family_class_init), (pango_font_family_init), (pango_font_face_class_init), (pango_font_face_init): * pango/pango-attributes.c (pango_attr_list_ref), (pango_attr_list_unref), (pango_attr_iterator_get_font): * pango/pango-layout.c (pango_layout_set_height), (extents_free), (no_shape_filter_func), (pango_layout_line_ref), (pango_layout_line_unref), (pango_layout_get_item_properties): * pango/pango-markup.c (end_element_handler), (text_handler), (b_parse_func), (big_parse_func), (span_parse_func), (i_parse_func), (markup_parse_func), (s_parse_func), (sub_parse_func), (sup_parse_func), (small_parse_func), (tt_parse_func), (u_parse_func): * pango/pango-ot-info.c (get_glyph_class): * pango/pango-renderer.c (get_item_properties), (pango_renderer_default_prepare_run): * pango/pango-utils.c (_pango_shape_shape): * pango/pangocairo-fcfontmap.c (pango_cairo_fc_font_map_get_font_type), (pango_cairo_fc_font_map_context_substitute), (pango_cairo_fc_font_map_context_key_get), (pango_cairo_fc_font_map_context_key_copy), (pango_cairo_fc_font_map_context_key_free), (pango_cairo_fc_font_map_context_key_hash), (pango_cairo_fc_font_map_context_key_equal): * pango/pangocairo-fontmap.c (pango_cairo_font_map_new_for_font_type), (pango_cairo_font_map_set_default): * pango/pangocairo-render.c (pango_cairo_renderer_init): * pango/pangox-fontcache.c (free_cache_entry): * pango/pangox-fontmap.c (close_display_cb), (list_families_foreach), (pango_x_font_map_load_font), (ignore_error): * pango/pangox.c (average_width_foreach), (subfonts_foreach), (pango_x_font_find_shaper), (pango_x_get_unknown_glyph), (pango_x_get_item_properties), (pango_x_apply_ligatures), (pango_x_font_get_unknown_glyph): * pango/pangoxft-fontmap.c (pango_xft_font_map_init), (close_display_cb): * pango/querymodules.c (show_version): Fix warnings. svn path=/trunk/; revision=2765
* Bug 563803 – pango_renderer_finalize fails to call parent finalizeBehdad Esfahbod2008-12-091-12/+24
| | | | | | | | | | | | | | | | 2008-12-09 Behdad Esfahbod <behdad@gnome.org> Bug 563803 – pango_renderer_finalize fails to call parent finalize * pango/pango-renderer.c (pango_renderer_class_init), (pango_renderer_finalize): Call parent finalize. * pango/pango-renderer.c (add_strikethrough), (pango_renderer_default_draw_glyph_item), (pango_renderer_default_draw_error_underline): Clean up a bit. svn path=/trunk/; revision=2755
* Improve docs.Behdad Esfahbod2008-08-061-1/+1
| | | | svn path=/trunk/; revision=2677
* New public API:Behdad Esfahbod2008-08-061-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-07-30 Behdad Esfahbod <behdad@gnome.org> * docs/pango-sections.txt: * docs/tmpl/pango-renderer.sgml: * pango/pango-renderer.c: * pango/pango-renderer.h: New public API: PangoRenderer::draw_glyph_item() pango_renderer_draw_glyph_item() Make layout and layout-line default renderers go through draw_glyph_item(), which then by default falls back to draw_glyphs(). The advantage in draw_glyph_item() is that it has access to the text and cluster information. * pango/pangocairo.h: * pango/pangocairo-render.c: New public API: pango_cairo_show_glyph_item() svn path=/trunk/; revision=2674
* 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 472629 – Add pango_renderer_get_layout(_line)Behdad Esfahbod2007-10-241-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | 2007-10-24 Behdad Esfahbod <behdad@gnome.org> Bug 472629 – Add pango_renderer_get_layout(_line) * pango/pango-renderer.h: * pango/pango-renderer.c: New public API: pango_renderer_get_layout() pango_renderer_get_layout_line() * pango/pangocairo-render.c (pango_cairo_renderer_draw_shape), (release_renderer), (_pango_cairo_do_layout_line), (_pango_cairo_do_layout): Use above API to simplify shape_renderer implementation. * pango/pango.def: * docs/pango-sections.txt: * docs/tmpl/pango-renderer.sgml: Update. svn path=/trunk/; revision=2460