summaryrefslogtreecommitdiff
path: root/pango/fonts.c
Commit message (Collapse)AuthorAgeFilesLines
* Add api to get language coverage for faceswip/matthiasc/face-langMatthias Clasen2017-12-231-0/+16
| | | | | This is needed to make filtering in the font chooser performant.
* Add initial support for OpenType font variationsMatthias Clasen2017-12-231-10/+162
| | | | | | | | This commit lets PangoFontDescription carry font variation information as a string. Only pangocairo has been updated to make use of this information. We pass it to harfbuzz for shaping, and we pass it to cairo when creating scaled fonts.
* Don't check array for NULLTing-Wei Lan2017-07-181-1/+1
| | | | | | | Arrays can never be NULL, and doing unnecessary checking causes compilers to show warnings. https://bugzilla.gnome.org/show_bug.cgi?id=783428
* Cast enum to int before doing calculationTing-Wei Lan2017-07-181-2/+2
| | | | | | | | It seems that it is possible for compilers to use unsigned interger types to store enum values, so we should cast them to signed interger types before doing calculation to avoid getting unexpected results. https://bugzilla.gnome.org/show_bug.cgi?id=783428
* docs: Add a few missing (transfer) annotationsPhilip Withnall2017-04-081-1/+1
| | | | | | | | | This should fix a few scanner warnings, but this is not an attempt to fix them all. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778663
* Minor documentation updateMatthias Clasen2015-06-221-1/+1
|
* Fix warnings if font is not foundBehdad Esfahbod2015-04-101-1/+2
|
* Add many missing nullability annotations.Evan Nemerson2014-10-161-23/+26
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=731022
* Add PANGO_WEIGHT_SEMILIGHTBehdad Esfahbod2014-07-251-0/+2
| | | | Part of Bug 733764 - Support more / free font weights
* Bug 685167 - migrate docs to no-tmpl flavourBehdad Esfahbod2013-09-271-0/+13
| | | | Patch from Rafał Mużyło.
* Bug 708432 - gravity_map in fonts.c: "Upside-Down" should beBehdad Esfahbod2013-09-201-1/+1
| | | | PANGO_GRAVITY_NORTH instead of PANGO_GRAVITY_SOUTH?
* introspection: assorted fixes to avoid regressions in Vala bindingsEvan Nemerson2012-08-121-7/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=681423
* Fix transfer annotation for pango_font_family_list_facesPavel Holejsovsky2012-06-041-3/+4
| | | | | | | | The documentation says 'This array should be freed with g_free() when it is no longer needed', which really translates to (transfer container) in introspection annotation jargon. https://bugzilla.gnome.org/show_bug.cgi?id=677407
* Stop using G_CONST_RETURN in PangoRyan Lortie2011-06-091-3/+3
| | | | | | | 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
* Fixed (transfer none) introspection annotation for the return value in ↵Alberto Ruiz2011-04-251-1/+2
| | | | pango_font_get_font_map
* adding allow-none introspection metadata to pango_font_description_merge ↵Alberto Ruiz2011-04-251-1/+1
| | | | parameters
* adding allow-none introspection metadata to ↵Alberto Ruiz2011-04-251-1/+1
| | | | pango_font_description_better_match parameters
* adding allow-none introspection metadata to pango_font_get_metrics parametersAlberto Ruiz2011-04-251-3/+2
|
* fixing metadata typo in pango_font_get_glypth_extentsAlberto Ruiz2011-04-251-1/+1
|
* adding output parameters introspection metadata to pango_font_get_glypth_extentsAlberto Ruiz2011-04-251-2/+2
|
* adding allow-none introspection metadata to pango_font_get_glypth_extents ↵Alberto Ruiz2011-04-251-4/+4
| | | | parameters
* adding transfer ownership introspection metadata to pango_font_descriptions_freeAlberto Ruiz2011-04-251-1/+2
|
* adding array length introspection metadata to pango_font_descriptions_freeAlberto Ruiz2011-04-251-1/+1
|
* adding allow-none to pango_font_descriptions_free parametersAlberto Ruiz2011-04-251-1/+1
|
* Adding allow-none and moving (out) to the beginning of the annotation as ↵Alberto Ruiz2011-04-151-1/+1
| | | | requested by walters in #647827
* Fix introspection for pango_font_map_list_families and ↵Alberto Ruiz2011-04-151-2/+2
| | | | pango_font_family_list_faces
* Use G_DEFINE_BOXED_TYPE.Christian Persch2010-11-041-26/+6
| | | | Bug #539622.
* Bug 580273 – Font metrics functions incorrectly listed as reporting point ↵Behdad Esfahbod2009-04-261-4/+4
| | | | | | sizes [doc] Remove misleading sentence about points and Pango units
* Allow desc_to_merge=NULL in pango_font_description_merge()Behdad Esfahbod2009-04-061-2/+6
|
* Bug 166709 – Handle font variants more consistentlyBehdad Esfahbod2009-01-061-1/+1
| | | | | | | | | | | | | | | | | 2009-01-06 Behdad Esfahbod <behdad@gnome.org> Bug 166709 – Handle font variants more consistently * configure.in: Require fontconfig >= 2.5.0 * pango/fonts.c: Parse "Roman" as style=normal instead of weight=normal. Doesn't make much difference in reality. * pango/pangofc-fontmap.c (pango_fc_convert_weight_to_fc), (pango_fc_convert_weight_to_pango): Update to reflect newly added weights. svn path=/trunk/; revision=2788
* Bug 166709 – Handle font variants more consistentlyBehdad Esfahbod2009-01-061-1/+7
| | | | | | | | | | | | | | | | 2009-01-06 Behdad Esfahbod <behdad@gnome.org> Bug 166709 – Handle font variants more consistently * pango/pango-font.h: Add enum values PANGO_WEIGHT_BOOK and PANGO_WEIGHT_ULTRAHEAVY. * pango/fonts.c: * docs/tmpl/fonts.sgml: Add new weights with their aliases, as well as aliasing "Roman" to the normal weight. svn path=/trunk/; revision=2787
* Make it Unicode safe.Behdad Esfahbod2009-01-061-4/+3
| | | | | | | | | 2009-01-06 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c (pango_font_description_to_filename): Make it Unicode safe. svn path=/trunk/; revision=2786
* Move the parse_*() functions in fonts.c and have them share tables withBehdad Esfahbod2009-01-061-7/+162
| | | | | | | | | | | | | | 2009-01-06 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c (find_field), (parse_field), (pango_parse_style), (pango_parse_variant), (pango_parse_weight), (pango_parse_stretch): Move the parse_*() functions in fonts.c and have them share tables with pango_font_description_to/from_string(). * pango/pango-utils.c (parse_int), (pango_parse_enum): Accept integers in pango_parse_enum(). svn path=/trunk/; revision=2785
* Bug 384362 – pango can't select some font stylesBehdad Esfahbod2009-01-041-2/+8
| | | | | | | | | | | | | | | | 2009-01-03 Behdad Esfahbod <behdad@gnome.org> Bug 384362 – pango can't select some font styles * pango/pango-font.h: Add enum values PANGO_WEIGHT_THIN and PANGO_WEIGHT_MEDIUM to PangoWeight. * pango/fonts.c: Parse "Thin", "Extra-Light", "Regular", "Demi-Bold", "Extra-Bold", and "Black" as weight descriptors (from the OpenType spec). svn path=/trunk/; revision=2782
* Bug 168085 – numeric styles in pango_font_description_to_string()Behdad Esfahbod2009-01-041-11/+48
| | | | | | | | | | | | | 2009-01-03 Behdad Esfahbod <behdad@gnome.org> Bug 168085 – numeric styles in pango_font_description_to_string() * pango/fonts.c (parse_int), (find_field), (find_field_any), (append_field), (pango_font_description_to_string): Print-out, and parse, numeric styles correctly. Things like "DejaVu Sans weight=100" parse correctly now. svn path=/trunk/; revision=2781
* Bug 565644 – Maybe pango_font_descriptions_free is deprecatedBehdad Esfahbod2008-12-261-1/+1
| | | | | | | | | | 2008-12-26 Behdad Esfahbod <behdad@gnome.org> Bug 565644 – Maybe pango_font_descriptions_free is deprecated * pango/fonts.c: Adjust docs. svn path=/trunk/; revision=2773
* Bug 469049 – Fix all compiler warningsBehdad Esfahbod2008-12-261-10/+10
| | | | | | | | | | | | | | | | | | | | | 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-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reword.Behdad Esfahbod2008-12-221-1/+1
| | | | svn path=/trunk/; revision=2764
* Bug 565379 – pango_font_description_better_match some style attributesBehdad Esfahbod2008-12-221-0/+2
| | | | | | | | | | | 2008-12-22 Behdad Esfahbod <behdad@gnome.org> Bug 565379 – pango_font_description_better_match some style attributes of old_match are not checked * pango/fonts.c: Improve docs. svn path=/trunk/; revision=2763
* Bug 564644 – Not complete description of theBehdad Esfahbod2008-12-151-3/+6
| | | | | | | | | | | 2008-12-15 Behdad Esfahbod <behdad@gnome.org> Bug 564644 – Not complete description of the pango_font_description_better_match function * pango/fonts.c: Improve docs even more. svn path=/trunk/; revision=2759
* Bug 564644 – Not complete description of theBehdad Esfahbod2008-12-151-1/+3
| | | | | | | | | | | 2008-12-15 Behdad Esfahbod <behdad@gnome.org> Bug 564644 – Not complete description of the pango_font_description_better_match function * pango/fonts.c: Improve docs. svn path=/trunk/; revision=2758
* Bug 499626 – Space should be optional after comma inBehdad Esfahbod2008-12-081-1/+1
| | | | | | | | | | | 2008-12-07 Behdad Esfahbod <behdad@gnome.org> Bug 499626 – Space should be optional after comma in PangoFontDescription input string * pango/fonts.c (getword): Don't require space after comma. svn path=/trunk/; revision=2754
* Bug 499624 – Spaces around commas in PangoFontDescription family nameBehdad Esfahbod2008-12-081-0/+16
| | | | | | | | | | | | | | 2008-12-07 Behdad Esfahbod <behdad@gnome.org> Bug 499624 – Spaces around commas in PangoFontDescription family name should be trimmed * pango/fonts.c (pango_font_description_from_string): * pango/pangofc-fontmap.c (pango_fc_make_pattern): Do it in pango_font_description_from_string() instead of pangofc backend. svn path=/trunk/; revision=2753
* Bug 557620 – pango_font_description_from_string not correctBehdad Esfahbod2008-10-231-5/+3
| | | | | | | | | | | 2008-10-23 Behdad Esfahbod <behdad@gnome.org> Bug 557620 – pango_font_description_from_string not correct * pango/fonts.c (find_field_any): Fix parsing of "normal" when not at the end of string. svn path=/trunk/; revision=2732
* Use atomic reference counting.Behdad Esfahbod2008-08-221-4/+2
| | | | | | | | | | | | | | | | | | | | | | | 2008-08-22 Behdad Esfahbod <behdad@gnome.org> * pango/fonts.c (pango_font_metrics_ref), (pango_font_metrics_unref): * pango/pango-attributes.c (pango_attr_list_ref), (pango_attr_list_unref): * pango/pango-coverage.c (pango_coverage_ref), (pango_coverage_unref): * pango/pango-layout.c (pango_layout_line_ref), (pango_layout_line_unref): * pango/pangowin32-fontcache.c (cache_entry_unref), (pango_win32_font_cache_loadw): * pango/pangox-fontcache.c (cache_entry_unref), (pango_x_font_cache_load): Use atomic reference counting. Pango may not be thread safe yet, but fixing it little by little is easier than doing all in one round. svn path=/trunk/; revision=2705
* Bug 143542 – PangoFT2Fontmap leakBehdad Esfahbod2008-08-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-22 Behdad Esfahbod <behdad@gnome.org> Bug 143542 – PangoFT2Fontmap leak * pango/fonts.c: * pango/pangoatsui.c (pango_atsui_font_finalize), (_pango_atsui_font_set_font_map): * pango/pangocairo-font.c (_pango_cairo_font_get_metrics), (_pango_cairo_font_private_get_hex_box_info): * pango/pangocairo-win32font.c (_pango_cairo_win32_font_new): * pango/pangofc-font.c (pango_fc_font_get_metrics): * pango/pangofc-fontmap.c (pango_fc_font_map_add), (_pango_fc_font_map_remove), (cleanup_font): * pango/pangowin32-fontmap.c (pango_win32_font_neww), (pango_win32_font_map_real_find_font): * pango/pangowin32.c (pango_win32_font_finalize): * pango/pangox-fontmap.c (pango_x_font_map_load_font): * pango/pangox.c (pango_x_font_new), (pango_x_font_finalize): Make the reference the font->fontmap reference weak. The code for setting the reference must look like this: g_assert (font->fontmap == NULL); font->fontmap = (PangoFontMap *) fontmap; g_object_add_weak_pointer (G_OBJECT (font->fontmap), (gpointer *) (gpointer) &font->fontmap); And releasing it like: g_assert (font->fontmap != NULL); g_object_remove_weak_pointer (G_OBJECT (font->fontmap), (gpointer *) (gpointer) &font->fontmap); font->fontmap = NULL; I have converted all fontmaps. The win32 and atsui ones can use some simple testing. The PangoFc fonts actually don't need the weakref as the fontmap already provides a similar link by itself. svn path=/trunk/; revision=2704
* 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 510299 – OpenType font variants are broken with ATSUI/CairoBehdad Esfahbod2008-05-281-2/+29
| | | | | | | | | | | | 2008-05-28 Behdad Esfahbod <behdad@gnome.org> Bug 510299 – OpenType font variants are broken with ATSUI/Cairo * pango/fonts.c (field_matches), (find_field): Ignore dashes when matching fong description fields. svn path=/trunk/; revision=2646
* Bug 478914 – Use something invalid instead of '?' when validating inputBehdad Esfahbod2007-12-101-26/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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