summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
Commit message (Collapse)AuthorAgeFilesLines
* docs: Cosmeticsmisc-doc-fixupsMatthias Clasen2021-12-101-8/+8
| | | | | Add more links to GLib apis and to various Unicode specs.
* markup: Change <sup> and <sub>Matthias Clasen2021-08-311-18/+4
| | | | | | | | Use the new baseline-shift and font-scale attributes to reimplement <sup> and <sub>. Now they take font metrics into account and nest properly.
* Implement font-dependent scalingMatthias Clasen2021-08-311-0/+12
| | | | | | | Add a new font-scale attribute to indicate font size changes due to super- and subscript shifts, and handle it during item post-processing to find the right font sizes.
* Implement baseline shiftsMatthias Clasen2021-08-311-0/+24
| | | | | | | | | | | Add a new baseline-shift attribute, which is similar to rise, but accumulates. In addition, it supports font- relative values such as superscript and subscript. We implement support for this by computing baseline shifts for run during line post-processing, and storing them in the runs. The renderer now takes these shifts into account when rendering layout lines.
* Add segmentation attributesbreak-tailoringMatthias Clasen2021-08-251-1/+22
| | | | | | | Add attributes that let us override word and sentence boundaries (and, indirectly, line breaks). Tests included.
* markup: Silence compiler warningsMatthias Clasen2021-08-221-0/+3
|
* markup: Add a text transform attributeMatthias Clasen2021-08-201-0/+14
| | | | | | Add a PangoTextTransform enum, a PangoAttribute to set it on runs of text, and support for parsing it out of markup.
* Cosmetics: Split off pango-markup.hMatthias Clasen2021-08-201-0/+2
|
* Correct an error messagefix-gravity-errorMatthias Clasen2021-08-171-1/+1
| | | | | | Update affected tests Fixes: #598
* pango-markup.c: Fix buildChun-wei Fan2021-08-091-1/+1
| | | | The strchr() call's second parameter is a char, not a string.
* Add line-height attributesMatthias Clasen2021-08-081-0/+38
| | | | | | | | | | | | Add attributes for line-height, in a relative and absolute variant. This will be used to grow the logical extents of runs in a way that is compatible with CSS semantics. In markup, we support a new line_height attribute that will be interpreted as absolute if it is an integer > 1024, and as a relative factor otherwise.
* markup: Allow specifying size as percentagemarkup-sizesMatthias Clasen2021-08-081-1/+26
| | | | | | | Accept values like 200%, in addition to other ways of specifying sizes in markup. Fixes: #23
* markup: Allow pt for rise tooMatthias Clasen2021-08-081-2/+11
|
* markup: Allow specifying size in ptMatthias Clasen2021-08-081-20/+36
| | | | | | | | Accept values like 12.5pt, in addition to the other ways of specifying font size in markup. Fixes: #67
* font-desc: Use local volatile double values to store sizesMarco Trevisan (Treviño)2021-07-211-6/+10
| | | | | | | | | | | | | | | | | | | | Under i386 multiplying double and integer values and cast it to integer may end up to compute the wrong value when only 387 FPU is used, because the temporary value will be stored in a register whose precision isn't good enough. And so, some multiplications which are expected to produce an integer, will actually return a truncated value, that will be eventually floored. An example is 1.2 * 12800 that is clearly 15360.0, but will produce 15359 when casted to int in the said i386 environment. So use a temporary double variable to ensure that we do this computation in the double scope, before casting to int. And this will avoid using the said register, even when using more aggressive optimizations (as per marking the local variable volatile). Fixes: https://gitlab.gnome.org/GNOME/pango/-/issues/580
* markup: Don't accept attributes on <markup>Matthias Clasen2021-06-281-0/+1
| | | | Better to enforce this.
* markup: Separate out all casesMatthias Clasen2021-06-281-1/+6
| | | | | | No point in having a few attributes handled in the default case. Just split them all by the first char.
* markup: Save a few linesMatthias Clasen2021-06-281-20/+4
| | | | pango_markup_parser_new_internal can't really fail.
* docs: Reduce redundancydocs-cleanupsMatthias Clasen2021-05-201-8/+8
| | | | | | 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.
* introspection: Stop using allow-noneMatthias Clasen2021-05-191-6/+6
| | | | | The allow-none annotation has been deprecated for a long time already. Instead use optional and nullable everywhere.
* docs: Tweak markup docsMatthias Clasen2021-03-111-18/+25
| | | | Add summaries, convert markup, etc.
* docs: Convert markup and attributes docs to pango_markup.mdMatthias Clasen2021-03-111-191/+0
|
* docs: Replace lots of vestigial xml markupMatthias Clasen2021-03-111-7/+5
| | | | | We want to use pure markdown, since docbook is going away as the intermediate format.
* markup: Fix two bugsMatthias Clasen2021-03-021-30/+20
| | | | | | | | | | The docs state that all chars marked with the accel marker get an underline. But we were only underlining the first in each text chunk. Second, if an underline appears at the end of a text chunk, or at the end of the text, we would just eat it, which is unexpected.
* Export pango_parse_color_with_alphaMatthias Clasen2020-07-311-1/+1
| | | | | This will be useful to make GdkRGBA support hex formats with alpha.
* pango-color: Tweak semantics of _pango_parse_color_with_alphaMatthias Clasen2020-07-311-2/+2
| | | | | | | Make it return 0xffff if alpha is not present (this will be more convenient when we use this function in GdkRGBA). Update all users.
* Docs: improve formatting of markup descriptionJohn Beard2020-05-111-99/+103
| | | | | | | | | * Place <span> attributes and convenience tags into lists to avoid a text wall. * Add headings for each list * Fix broken colour specifications (e.g. #FF0000 had lost the '#') * Fix broken |piped| monospace sections * `backticks` rather than 'quotes'
* Document new underline valuesMatthias Clasen2019-10-311-1/+2
|
* Add an overline attributeMatthias Clasen2019-10-311-0/+33
| | | | | | | | | | Add a new PangoOverline enum, and overline and overline_color attributes, which parallel the attributes we have for underlines and strikethrough. For now, the enum just has 'none' and 'single' values.
* Add an insert-hyphens attributeMatthias Clasen2019-08-041-0/+18
| | | | | | | | | Add a text attribute that allows to suppress insertion of hyphens at intra-word line breaks. This is useful for non-paragraph-like contexts, where line breaks are needed, but hyphens are not expected.
* markup: Support the new attributeMatthias Clasen2019-07-251-0/+43
| | | | Add markup support for show="space|ignorables".
* Add an allow-breaks attributeMatthias Clasen2019-07-201-0/+17
| | | | | Add a new attribute type, and parse allow_breaks="false" in markup. This is useful to prevent hyphenation of words.
* Documentation tweaksMatthias Clasen2019-07-131-0/+165
|
* Avoid a critical from markup parsingMatthias Clasen2019-07-051-0/+13
| | | | | | gravity='auto' is not a valid value here. Closes: https://gitlab.gnome.org/GNOME/pango/issues/203
* Add prototype for _pango_color_parse_with_alpha()Emmanuele Bassi2017-05-191-5/+0
| | | | | | | | It's used in pango-markup.c and pango-color.c, so it should have an internally-available prototype, instead of an `extern` declaration at the point of use. This also avoids a compiler warning for a missing prototype.
* Avoid deprecation warningsMatthias Clasen2016-08-291-4/+5
| | | | | Now that we're using new-style deprecations, we have to fight a little harder to get rid of them inside pango.
* Allow rgba colors in markupMatthias Clasen2015-08-141-5/+17
| | | | | | | For foreground and background colors, allow #rrggbbaa to specify a color with alpha. This will be returned as two attributes, for color and alpha. underline_color and strikethrough_color are still limited to #rrggbb, with no alpha component.
* Support alpha in markupwip/matthiasc/alphaMatthias Clasen2015-08-111-3/+85
| | | | | | Support alpha and background_alpha attributes on span elements. The value can either be a plain integer between 1 and 65536 or a percentage like 50%.
* Bug 738505 - Add fontfeatures support in PangoAttributes and markupBehdad Esfahbod2015-06-181-2/+10
| | | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=738505 Patch from Matthias Clasen, based on early patch from Akira TAGOH. There's room for improvement in how this is done, but it works now for simple cases, which is what most people will be using it for. Finally!
* Bug 707131 - removing useless test.Jehan2013-09-041-1/+1
| | | | | | | | | Since pango_scan_int() would return FALSE if the scanned value was over INT_MAX; and the reference out value's type is an int, (n > INT_MAX) test is unecessary. If pango_scan_int() behavior was to be changed to accept long int, an explicit test should be added (or the PangoAttrSize type updated to handle long int too).
* Bug 707131 - getting rid of the arbitrary MAX_SIZE for font.Jehan2013-08-311-7/+4
| | | | | Since the value is stored as an int, no reason to use any other value than INT_MAX.
* markup: Remove error from markup parser constructorJasper St. Pierre2012-12-141-7/+9
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=679299
* markup: Allow incrementally parsing pango markupJasper St. Pierre2012-12-141-64/+166
| | | | | | | This is intended for applications that need to parse pango markup from some sort of GIO stream. https://bugzilla.gnome.org/show_bug.cgi?id=679299
* markup: Always start with a <markup> tagJasper St. Pierre2012-12-141-16/+10
| | | | | | | It doesn't do anything bad, and will help us when we move to a stream-based approach. https://bugzilla.gnome.org/show_bug.cgi?id=679299
* [GI] Add (allow-none) annotations to pango_parse_markup().Laszlo Pandy2011-02-091-3/+3
|
* [GI] Annotate out arguments of pango_parse_markup().Laszlo Pandy2011-02-041-3/+3
|
* Bug 469049 – Fix all compiler warningsBehdad Esfahbod2008-12-261-3/+3
| | | | | | | | | | | | | | | | | | | | | 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-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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 490669 – add some <span> attribute aliasesBehdad Esfahbod2008-04-211-1/+11
| | | | | | | | | | | | | 2008-04-21 Behdad Esfahbod <behdad@gnome.org> Bug 490669 – add some <span> attribute aliases * docs/pango_markup.sgml: * pango/pango-markup.c (span_parse_func): Add fgcolor, bgcolor, font, font_size, font_weight, font_variant, ... svn path=/trunk/; revision=2603