summaryrefslogtreecommitdiff
path: root/pango/pango-renderer.c
Commit message (Collapse)AuthorAgeFilesLines
* Spell-check the docs.Behdad Esfahbod2007-01-071-2/+2
| | | | svn path=/trunk/; revision=2130
* Add new functions: pango_layout_iter_get_line_readonly()Behdad Esfahbod2006-12-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 2006-12-05 Behdad Esfahbod <behdad@gnome.org> * docs/pango-sections.txt: * docs/tmpl/layout.sgml: * pango/pango-layout.c (pango_layout_get_lines_readonly), (pango_layout_get_line_readonly), (pango_layout_iter_get_run_readonly), (_pango_layout_iter_get_line), (pango_layout_iter_get_line), (pango_layout_iter_get_line_readonly): * pango/pango-layout.h: * pango/pango-renderer.c (pango_renderer_draw_layout): * pango/pango.def: Add new functions: pango_layout_iter_get_line_readonly() pango_layout_get_lines_readonly() pango_layout_iter_get_line_readonly() pango_layout_iter_get_run_readonly() These should be used when you do not intend to modify the run/line, which is more than most of the time. So, update your app, benefit from more optimizations (in this case, line extents caching)!
* Bug 135683 – Cache glyphstring extentsBehdad Esfahbod2006-12-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 2006-12-04 Behdad Esfahbod <behdad@gnome.org> Bug 135683 – Cache glyphstring extents * pango/pango-layout.c (pango_layout_get_lines), (pango_layout_get_line), (pango_layout_line_leaked), (pango_layout_line_get_extents), (pango_layout_line_new), (pango_layout_iter_get_run), (pango_layout_iter_get_line): Cache line extents. Line extents are cached only if the user doesn't have a pointer to the line or any of its runs. Functions that give away such pointers mark the line as "leak"ed. * pango/pango-layout.c (pango_layout_index_to_line_and_extents), (pango_layout_xy_to_index), (pango_layout_index_to_pos): Use _pango_layout_iter_get_line() which is like pango_layout_iter_get_line() but doesn't leak the line. * pango/pango-layout-private.h: Add pango_layout_iter_get_line() duplicate _pango_layout_iter_get_line_readonly() that doesn't leak the line. * pango/pango-renderer.c (pango_renderer_draw_layout): Use _pango_layout_iter_get_line_readonly().
* Replace PANGO_IS_RENDERER with PANGO_IS_RENDERER_FAST that is just aBehdad Esfahbod2006-12-041-13/+14
| | | | | | | | | | | | | | 2006-12-04 Behdad Esfahbod <behdad@gnome.org> * pango/pango-renderer.c (pango_renderer_draw_layout_line), (pango_renderer_draw_glyphs), (pango_renderer_draw_rectangle), (pango_renderer_draw_error_underline), (pango_renderer_draw_trapezoid), (pango_renderer_draw_glyph), (pango_renderer_activate), (pango_renderer_deactivate), (pango_renderer_set_color), (pango_renderer_get_color), (pango_renderer_part_changed), (pango_renderer_prepare_run), (pango_renderer_set_matrix): Replace PANGO_IS_RENDERER with PANGO_IS_RENDERER_FAST that is just a NULL-check.
* Don't call into pango_glyph_string_extents() if we don't need anything outBehdad Esfahbod2006-11-301-2/+3
| | | | | | | | | 2006-11-30 Behdad Esfahbod <behdad@gnome.org> * pango/pango-renderer.c (pango_renderer_draw_layout_line): Don't call into pango_glyph_string_extents() if we don't need anything out of it! (Ok, that function returns immediately in that case, but still, avoiding the call overhead.)
* Bug 355435 – Invalid calls to pango_map_get_engine() Patch fromBehdad Esfahbod2006-09-111-1/+0
| | | | | | | | | | | | | | 2006-09-11 Behdad Esfahbod <behdad@gnome.org> Bug 355435 – Invalid calls to pango_map_get_engine() Patch from Theppitak Karoonboonyanan * pango/break.c (pango_get_log_attrs): * pango/pango-renderer.c (add_underline): * pango/pangofc-font.c (pango_fc_font_find_shaper): * pango/pangowin32.c (pango_win32_font_find_shaper): * pango/pangox.c (pango_x_font_find_shaper): Pass a PangoScript to pango_map_get_engine, not a gunichar!
* Bug 347146 – underline/overstrike spacesBehdad Esfahbod2006-09-111-13/+17
| | | | | | | | | | | | | | | | | 2006-09-11 Behdad Esfahbod <behdad@gnome.org> Bug 347146 – underline/overstrike spaces * pango/pango-renderer.c (add_underline), (add_strikethrough), (pango_renderer_draw_layout_line): Use logical extents for x and width of underline/strikethrough, such that trailing spaces are correctly handled. * pango/pango-layout.c (pango_layout_run_get_extents): Use logical rect for underline/strikethrough, and reflect that in run ink extents. * pango/pango-layout.c (pango_layout_line_get_extents): Don't let runs with empty ink extents affect total ink extents.
* Return if none of logical_rect or ink_rect is non-NULL.Behdad Esfahbod2006-08-161-4/+17
| | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | 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-17/+13
| | | | | | | | | | | | | | | | | | 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.
* Followup on previous change.Behdad Esfahbod2006-06-061-0/+6
| | | | | | | | | | | | | | | | | 2006-06-06 Behdad Esfahbod <behdad@gnome.org> Followup on previous change. * pango/pango-renderer.c: Note that pango_renderer_draw_rectangle and pango_renderer_draw_error_underline should be called with active renderer. * pango/pangocairo-render.c (pango_cairo_renderer_draw_glyphs), (_pango_cairo_do_glyph_string), (_pango_cairo_do_layout_line), (_pango_cairo_do_layout): Remove excess cairo_save/restore() calls. * pango/pangocairo-render.c (_pango_cairo_do_error_underline): Don't go through renderer.
* Minor.Behdad Esfahbod2006-05-301-3/+2
|
* Bug 330795 – pango_renderer_draw_glyph segfaults when trying to call theBehdad Esfahbod2006-02-111-4/+6
| | | | | | | | | | | 2006-02-11 Behdad Esfahbod <behdad@gnome.org> Bug 330795 – pango_renderer_draw_glyph segfaults when trying to call the class vfunc Opened by Torsten Schoenfeld * pango/pango-renderer.c (pango_renderer_draw_trapezoid, pango_renderer_draw_glyph): Bail if method is not implemented.
* Finish the 'glyph 0' work of this morning: PANGO_GLYPH_NULL that IBehdad Esfahbod2006-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2006-02-02 Behdad Esfahbod <behdad@gnome.org> Finish the 'glyph 0' work of this morning: PANGO_GLYPH_NULL that I introduced is renamed to PANGO_GLYPH_EMPTY. It means, no rendering should be performed. The backends however, still return 0 if a glyph is not found. The modules then are free to replace this 0 glyph with an unknown character. * modules/arabic/arabic-fc.c, modules/basic/basic-atsui.c, modules/basic/basic-fc.c, modules/basic/basic-win32.c, modules/basic/basic-x.c, modules/hangul/hangul-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-fc.c, modules/tibetan/tibetan-fc.c, pango/pangox.c, pango/pangowin32.c: Adapt to above change. Backends return 0 if glyph not found. * pango/fonts.c (pango_font_get_glyph_extents): If font is not usable (!PANGO_IS_FONT (font)), return the generic UNKNOWN_GLYPH metrics. This is used when your backends are misconfigured and you don't find *any* font at all. * pango/pango-engince.c: Add unknown glyphs in fallback shaper, instead of empty glyphs. * pango/shape.c: Call the fall-back shaper if shaper fails, instead of generating a dummy glyph string ourselves. * pango/pango-layout.c (imposed_shape, shape_tab): Use PANGO_GLYPH_EMPTY instead of glyph 0. * pango/pango-renderer.c (pango_renderer_draw_glyph): No-op on PANGO_GLYPH_EMPTY instead of glyph 0. * pango/pangocairo-atsuifont.c, pango/pangocairo-win32font.c, pango/pangocairo-fcfont.c, pango/pangocairo-font.c, pango/pangocairo-private.h: install_font returns a boolean now. * pango/pangocairo-render.c, pango/pangoxft-render.c: Handle font and hex-box failures more gracefully by drawing a generic unknown-box glyph. * pango/pangoft2.c, pango/pangoft2-render.c: Draw the generic unknown-box glyph here too. For unknown glyphs though, if the font is TTF (FT_IS_SFNT), use the zero-indexed glyph, otherwise, draw a box of proper size.
* Make matrix parameter const.Behdad Esfahbod2006-01-211-1/+1
| | | | | | | | | | | | | | | 2006-01-21 Behdad Esfahbod <behdad@gnome.org> * pango/pango-types.h, pango/pango-utils.h (pango_matrix_get_font_scale_factor): Make matrix parameter const. * pango/fonts.c, pango/pango-context.c, pango/pango-coverage.c, pango/pango-fontset.c, pango/pango-layout.c, pango/pango-renderer.c, pango/pango-types.h, pango/pango-utils.c, pango/pangocairo-atsuifont.c, pango/pangofc-font.c, pango/pangoft2-fontmap.c, pango/pangowin32-fontmap.c, pango/pangowin32.c, pango/pangox-fontmap.c, pango/pangoxft-font.c: Replace "Returns:" with "Return value:" in docs.
* 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)
* Documentation improvements. (#321731)Behdad Esfahbod2005-11-181-13/+13
| | | | | | 2005-11-17 Behdad Esfahbod <behdad@gnome.org> * pango/pango-renderer.c: Documentation improvements. (#321731)
* Turn various gcc warnings off. Adding const, adding static, fullyBehdad Esfahbod2005-11-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-11-04 Behdad Esfahbod <behdad@gnome.org> * configure.in, examples/argcontext.c examples/cairoview.c, examples/renderdemo.c, examples/renderdemo.h examples/xftview.c, modules/basic/basic-x.c, modules/hangul/hangul-fc.c, modules/hebrew/hebrew-shaper.c, modules/hebrew/hebrew-shaper.h, modules/indic/indic-fc.c, modules/indic/mprefixups.c, modules/syriac/syriac-fc.c, pango/break.c pango/fonts.c, pango/modules.c, pango/pango-coverage.c pango/pango-engine.c, pango/pango-engine.h, pango/pango-fontmap.c, pango/pango-fontset.c, pango/pango-impl-utils.h, pango/pango-layout.c, pango/pango-layout.h, pango/pango-renderer.c, pango/pango-script.c, pango/pango-utils.c, pango/pangocairo-fc.h, pango/pangocairo-font.c, pango/pangocairo-fontmap.c, pango/pangocairo-private.h, pango/pangofc-decoder.c, pango/pangofc-font.c, pango/pangofc-fontmap.c pango/pangoft2.c, pango/pangox-fontcache.c, pango/pangox-fontmap.c pango/pangox.c, pango/pangoxft-font.c, pango/querymodules.c, pango/opentype/ftglue.c, pango/opentype/ftxgpos.c, pango/opentype/ftxopen.c, pango/opentype/pango-ot-buffer.c, pango/opentype/pango-ot-info.c, pango/opentype/pango-ot-ruleset.c, tests/dump-boundaries.c, tests/testboundaries.c, tests/testcolor.c tests/testiter.c, tests/testscript.c: Turn various gcc warnings off. Adding const, adding static, fully initializing structs, match signedness in comparisons. (#317804) * tests/testscript.c, tools/gen-script-for-lang.c: (scripts_for_file): Pass error->message instead of error to fail(), which was wrong. (compare_lang): Fix typo comparing a and a instead of a and b.
* unset all part colors, since when drawing just a glyph string,Owen Taylor2005-10-031-1/+2
| | | | | | | | | | | 2005-09-09 Owen Taylor <otaylor@redhat.com> * pango/pangocairo-render.c (pango_cairo_show_glyph_string): unset all part colors, since when drawing just a glyph string, prepare_run() isn't called. (#315599, Choe Hwanjin) * pango/pango-renderer.c (pango_renderer_draw_layout_line): NULL out renderer->priv->line_state.
* Rename y1 parameters to y1_ to avoid conflicts with the math.h BesselOwen Taylor2005-01-041-3/+3
| | | | | | | | Tue Jan 4 14:05:13 2005 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.c (pango_renderer_draw_trapezoid): Rename y1 parameters to y1_ to avoid conflicts with the math.h Bessel function. (#161969)
* Set the background color instead of setting underline twice.Matthias Clasen2004-11-301-1/+1
| | | | | | | 2004-11-30 Matthias Clasen <mclasen@redhat.com> * pango/pango-renderer.c (pango_renderer_default_prepare_run): Set the background color instead of setting underline twice.
* Add underline_color and strikethrough_color attribute types. (#147616,Owen Taylor2004-11-231-80/+89
| | | | | | | | | | | | | | | | | | | | | | | Tue Nov 23 10:23:43 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-attributes.[ch]: Add underline_color and strikethrough_color attribute types. (#147616, Morten Welinder) * pango/pango-markup.c docs/pango_markup.sgml: Add corresponding 'underline_color' and 'strikethrough_color' attributes for <span>. * pango/pango-renderer.c (pango_renderer_default_prepare_run): Implement underline and strikethrough colors. * pango/pango-renderer.c: Fix some bigs with updating underlines/strikethrough state. * pango/pango-renderer.c (get_total_matrix): Fix a const warning. * docs/pango-sections.txt: Update
* Fix crash when renderer->matrix is NULL.Owen Taylor2004-11-201-1/+1
| | | | | | | Fri Nov 19 18:45:24 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.c (pango_renderer_default_draw_error_underline): Fix crash when renderer->matrix is NULL.
* Remove color_set() virtual function ... it's not absolutely necessary forOwen Taylor2004-11-191-40/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fri Nov 19 17:44:33 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.[ch]: Remove color_set() virtual function ... it's not absolutely necessary for chaining renderers, and it's not clear that chaining renderers is actually useful, anyways. * pango/pango-renderer.[ch] (pango_renderer_set_color): Constify color argument. * pango/pango-render.c: Fix various bugs. * pango/pango-attributes.[ch] (pango_attr_shape_new_with_data): Add the ability to create a shape attribute with user data. * pango/pango-renderer.[ch] (PangoRendererClass): Add a draw_shape virtual function, to draw content for PangoAttrShape. * pango/pangoxft-fontmap.c (pango_xft_shutdown_display): Add note to docs that XCloseDisplay() will automatically take care of releasing Pango's allocated resources for the display. * docs/Makefile.am (SCAN_OPTIONS): Add the appropriate --deprecated-guards option. * docs/tmpl/xft-fonts.sgml: Add long description. * docs/tmpl/x-fonts.sgml: Document as dead.
* Activate the renderer.Owen Taylor2004-09-241-3/+12
| | | | | | | | | | | | Fri Sep 24 15:05:02 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.c (pango_renderer_draw_glyphs): Activate the renderer. * pango/pango-renderer.c (pango_renderer_get_color, pango_renderer_draw_rectangle, pango_renderer_draw_trapezoid, pango_renderer_draw_error_underline, pango_renderer_draw_glyph): Require the renderer to be active.
* Up version to 1.7.0.Owen Taylor2004-09-241-0/+1207
Fri Sep 24 12:59:22 2004 Owen Taylor <otaylor@redhat.com> * configure.in: Up version to 1.7.0. * pango/pango-renderer.[ch] pango/pango.h pango/Makefile.am: Add PangoRenderer, a base class that is subclassed to produce rendering drivers for different backends and purposes. * pango/pangoft2-private.h pango/pangoft2-render.c pango/pangoft2.c: Move rendering into pangoft2-render.c, use PangoRenderer. * pango/pangoft2-fontmap.c pango/pangoft2-private.h: Add _pango_ft2_font_map_get_renderer() to retrieve a singleton fontmap for the fontmap. * pango/pangoxft-render.[ch] pango/pangoxft.c pango/Makefile.am: Make Xft rendering use PangoRenderer, add publically visible, subclassable PangoXftRenderer. * pango/pangoxft-fontmap.c pango/pangoxft-private.h: Add _pango_xft_font_map_get_renderer() to retrieve a singleton fontmap for the fontmap. * examples/xftview.c examples/Makefile.am: Add a test program using the Xft backend. * docs/*: Update minimally for PangoRenderer.