summaryrefslogtreecommitdiff
path: root/pango/pango-impl-utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Never show variation selectorsMatthias Clasen2021-11-281-2/+40
| | | | | | | | Even when we show ignorables, we still want to ignore variation selectors and other ignorables that we don't have nicks for. Test included.
* Add a few more default-ignorablesmore-default-ignorablesMatthias Clasen2021-11-031-0/+5
| | | | | | Add some more directional formatting characters to the list of default-ignorables that we make visible when requested: ALM, LRI, RLI, FSI, PDI.
* Speed up ignorable checkMatthias Clasen2021-03-291-0/+3
| | | | No need to walk to the end if we are done.
* Add compatibility shim for g_memdup2()Matthias Clasen2021-03-181-0/+8
| | | | | We don't necessarily want to depend on a newer version of GLib, given that we're not really using g_memdup() in the wrong way.
* PangoWin32: Use hb_font_get_nominal_glyphKhaled Hosny2019-07-271-1/+3
| | | | | Use hb_font_get_nominal_glyph in pango_win32_font_get_glyph_index (deprecated), to better match what Pango is actually using internally.
* Add a utility function for ignorablesMatthias Clasen2019-07-251-0/+70
| | | | | | | This returns nicknames and formatting information for default ignorable characters. This will be used to render customized hex boxes for these characters.
* Add pango_shape_full()Behdad Esfahbod2012-09-261-1/+1
| | | | | | | | | | | | | | | | Variant of pango_shape() that takes the full paragraph text as input. This is then passed in entirety to HarfBuzz, which would allow certain cross-run interactions (in Arabic for example). When combined with upcoming HarfBuzz 0.9.5+, this fixes: Red Hat Bug 858736 - [Spanish] Stray dotted circle rendered https://bugzilla.redhat.com/show_bug.cgi?id=858736 and partially: Bug 313181 - color changes break arabic shaping https://bugzilla.gnome.org/show_bug.cgi?id=313181
* Remove unneeded custom macrosJavier Jardón2011-04-301-46/+0
|
* Bug 596614 - Pango application receives SIGSEGV on pasting text with U+202EBehdad Esfahbod2009-11-171-1/+25
| | | | | Fixed all modules to reverse glyphs if run is rtl. Except for Hangul module. Fixed pango_shape() to detect that, warn, and reverse.
* Handle NUL in text in places that g_utf8_strlen () was usedBehdad Esfahbod2009-07-151-0/+27
| | | | | | | | | | 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 563356 – The input area of firefox and the blank width after text inBehdad Esfahbod2008-12-061-0/+31
| | | | | | | | | | | | | | | | | | | | | | 2008-12-05 Behdad Esfahbod <behdad@gnome.org> Bug 563356 – The input area of firefox and the blank width after text in gnome-menu was stretched too wide, under pango-1.22.3 * docs/tmpl/fonts.sgml: * pango/pango-impl-utils.h: * pango/pangocairo-atsuifont.c (pango_cairo_atsui_font_create_metrics_for_context): * pango/pangocairo-win32font.c (pango_cairo_win32_font_create_metrics_for_context): * pango/pangofc-font.c (pango_fc_font_create_metrics_for_context): For approximate_char_width calculation take each char's width into account. That is, do a weighted average instead of uniform average. g_unichar_iszerowidth() chars count as 0, g_unichar_iswide() chars count 2, and the rest count as 1. Pretty much wcwidth() behavior. See bug report for rationale. svn path=/trunk/; revision=2747
* Bug 478914 – Use something invalid instead of '?' when validating inputBehdad Esfahbod2007-12-101-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2007-12-10 Behdad Esfahbod <behdad@gnome.org> Bug 478914 – Use something invalid instead of '?' when validating input text * pango/pango-layout.c (pango_layout_set_text): Set invalid input bytes to -1, which gives a unichar value of -1, and eventually a glyph value of -1, aka PANGO_GLYPH_INVALID_INPUT. * pango/fonts.c (pango_font_get_glyph_extents), (pango_font_get_metrics), (pango_font_get_font_map): * pango/modules.c (build_map): * pango/pango-context.c (get_script), (get_shaper_and_font), (string_from_script), (itemize_state_process_run): * pango/pango-coverage.c (pango_coverage_get): * pango/pango-impl-utils.h: * pango/pango-utils.c: * pango/pangocairo-font.c (pango_cairo_font_get_scaled_font), (_pango_cairo_font_private_get_hex_box_info), (_pango_cairo_font_private_get_glyph_extents_missing): * pango/pangocairo-private.h: * pango/pangocairo-render.c (_pango_cairo_renderer_draw_frame), (_pango_cairo_renderer_draw_box_glyph), (_pango_cairo_renderer_draw_unknown_glyph): * pango/pangofc-fontmap.c (pango_fc_font_map_get_patterns): * pango/pangoft2-private.h: * pango/pangoft2-render.c (pango_ft2_font_render_box_glyph), (pango_ft2_font_render_glyph), (pango_ft2_renderer_draw_glyph): * pango/pangoft2.c (pango_ft2_font_get_face), (pango_ft2_font_get_glyph_extents): * pango/pangox.c (pango_x_find_subfont), (pango_x_render): * pango/pangoxft-font.c (_pango_xft_font_get_mini_font), (get_glyph_extents_missing), (pango_xft_font_get_font): * pango/pangoxft-private.h: * pango/pangoxft-render.c (get_total_matrix), (draw_box), (_pango_xft_renderer_draw_box_glyph), (_pango_xft_renderer_draw_unknown_glyph), (pango_xft_renderer_draw_glyphs): * pango/shape.c (pango_shape): Render PANGO_GLYPH_INVALID_INPUT to a single-width box with a cross inside. Also cleanup spewed warnings and warn at the source, where we fail to find a shaper, instead of at every location that we see a NULL font. * pango/pango-font.h: * docs/pango-sections.txt: * docs/tmpl/glyphs.sgml: New public macro: PANGO_GLYPH_INVALID_INPUT svn path=/trunk/; revision=2519
* Bug 467056 – Shape attribute handling is not consistentBehdad Esfahbod2007-08-151-1/+14
| | | | | | | | | | | | | | | | | | | 2007-08-15 Behdad Esfahbod <behdad@gnome.org> Bug 467056 – Shape attribute handling is not consistent * pango/pango-impl-utils.h: * pango/pango-layout.c (pango_layout_line_index_to_x), (shape_run), (pango_layout_line_x_to_index), (pango_layout_run_get_extents), (update_run): * pango/pango-renderer.c (pango_renderer_draw_layout_line): * pango/pango-utils.c (_pango_shape_shape), (_pango_shape_get_extents): Fix handling of extents for shaped runs. Previsouly a shaped run with more than one character was not correctly positioned. svn path=/trunk/; revision=2401
* *.c, *.h: Removed spaces followed b tabs.Behdad Esfahbod2007-01-161-5/+5
| | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Removed spaces followed b tabs. svn path=/trunk/; revision=2166
* *.c, *.h: Replace preceding sequences of 8 spaces with tabs.Behdad Esfahbod2007-01-161-2/+2
| | | | | | | | | 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-2/+2
| | | | | | | | | 2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Drop trailing whitespace. svn path=/trunk/; revision=2163
* Add more warning_history items and handle more font failures, to make sureBehdad Esfahbod2006-04-271-0/+2
| | | | | | | | | | | | | 2006-04-27 Behdad Esfahbod <behdad@gnome.org> * pango/pango-impl-utils.h: * pango/fonts.c (pango_font_get_glyph_extents), (pango_font_get_metrics), (pango_font_get_font_map): * pango/pangocairo-render.c (pango_cairo_show_glyph_string), (pango_cairo_glyph_string_path): Add more warning_history items and handle more font failures, to make sure that instead of crashing, gedit runs and draws empty boxes when pango.modules is not set properly.
* Hook up pango-utils.h into the documentation, as we are installing itBehdad Esfahbod2006-03-311-0/+8
| | | | | | | | 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 error handling in high-frequency functions: Only warn once.Behdad Esfahbod2006-01-311-0/+12
| | | | | | | | | | | | | | | 2006-01-30 Behdad Esfahbod <behdad@gnome.org> * pango/shape.c (pango_shape): * pango/fonts.c (pango_font_get_glyph_extents): * pango/pangocairo-font.c (_pango_cairo_font_install): Improve error handling in high-frequency functions: Only warn once. * pango-impl-utils.h, pangoutils.h: * pangocairo-private.h, pangocairo-font.c: Add machinery for above: _pango_warning_history and _pango_cairo_warning_history.
* pango/Makefile.am, pango/fonts.c, pango/glyphstring.c,Behdad Esfahbod2006-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* 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.
* Make PangoEngine{,Lang,Shape} GObjects, and use a GTypeModule-basedOwen Taylor2003-08-031-0/+77
Sat Aug 2 23:19:16 2003 Owen Taylor <otaylor@redhat.com> * pango/pango-engine.[ch] modules/*/*-{fc,win32,x}.c pango/modules.c pango/break.c pango/pango-context.c pango/pango-layout.c pango/pango-modules.h pango/querymodules.c pango/shape.c: Make PangoEngine{,Lang,Shape} GObjects, and use a GTypeModule-based module-loading system closely based on the one used for GtkIMContext and GtkThemeEngine. * pango/pango-impl-utils.h: OK, I'm tired of typing in get_type() functions. * pango/pango-script.[ch] pango/pango-script-table.h tests/testscript.c tools/gen-script-table.pl: Add port of script-range code from ICU in preparation for future use. (#91542) * tools/gen-script-for-lang.c: Utility program to determine the script for each fontconfig .orth file. * docs/tmpl/{scripts.sgml,pango-engine-lang.sgml, pango-engine-shape.sgml} docs/pango-sections.txt docs/pango-docs.sgml: Redo to go along with the above changes. * configure.in: chmod +x tests/runtests.sh