summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
Commit message (Collapse)AuthorAgeFilesLines
* fc: Sort faces of a familysort-facesMatthias Clasen2020-09-211-0/+28
| | | | | | Make pango_font_family_list_faces() return faces sorted by slant and weight. This makes the font chooser look much less random.
* Merge branch 'ch/83' into 'master'Matthias Clasen2020-09-181-0/+25
|\ | | | | | | | | | | | | Add pango_fc_font_map_set_default_substitute Closes #83 See merge request GNOME/pango!191
| * add pango_fc_font_map_set_default_substituteCaleb Hearon2020-06-131-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added: pango_fc_font_map_set_default_substitute pango_fc_font_map_default_substitute_changed deprecated: pango_ft2_font_map_set_default_substitute pango_ft2_font_map_changed pango_xft_font_map_set_default_substitute pango_xft_font_map_changed Now PangoCairoFcFontMap will call what is passed to pango_fc_font_map_set_default_substitute when it is time. The deprecated functions make calls to the parent (FC) class now. The user-supplied callbacks are executed in the exact same places as before.
* | pangofc: Add pango_fc_font_get_languagespreferred-languagesMatthias Clasen2020-09-181-1/+55
| | | | | | | | | | | | | | This really belongs into PangoFont, but we're out of room in the PangoFontClass struct for vfuncs, so this will have to remain backend-specific functionality for now.
* | Remove leftover debug codeMatthias Clasen2020-08-231-2/+0
| | | | | | | | | | This #if snuck in as part of efa66e7b634050ef3. No need to keep it around.
* | Don't call FcFontSetSort twiceMatthias Clasen2020-08-151-7/+12
| | | | | | | | | | | | We can do the format filtering on the unsorted font lists. Sorting the same list twice may be fast, but there's still some setup overhead.
* | Speed up font format filteringMatthias Clasen2020-08-151-1/+4
| | | | | | | | | | We were needlessly duplicating patters when we could have just referenced them.
* | Initialise out argumentsEmmanuele Bassi2020-07-031-0/+6
| | | | | | | | | | | | | | If we bail out early, we end up with uninitialised data and no way for a caller to know that happened. Fixes: #489
* | fcfontmap: Always reject unsupported font formatsKhaled Hosny2020-06-251-26/+26
|/ | | | | Fixes https://gitlab.gnome.org/GNOME/pango/-/issues/484 and https://gitlab.gnome.org/GNOME/pango/-/issues/457
* pangofc-fontmap: Avoid a dead assignmentTimm Bäder2020-06-101-1/+1
| | | | I believe this was meant to assign to variable and not res.
* Skip introspection on low level APIEmmanuele Bassi2020-06-081-6/+19
| | | | | | We don't have introspection for fontconfig and freetype2 data types. While we do have introspection for Harfbuzz, it doesn't really work.
* family: Clarify and improve pango_font_family_get_face()Benjamin Otte2019-12-081-0/+3
| | | | | | | - Clarify that the function can return NULL - Fix annotations - Allow passing NULL as name to get a guaranteed default face. - Map the default name to "Regular" in the FC backend
* fcfontmap: Emit GListModel::changedMatthias Clasen2019-12-041-0/+19
| | | | We can implement this a bit better in the fontconfig backend.
* pangofc: Add list model implementationsMatthias Clasen2019-12-041-5/+86
| | | | | Reimplement GListModel in the fontconfig backend. This implementation avoids memory copies.
* Add pango_font_get_faceMatthias Clasen2019-10-311-0/+24
| | | | | Since we've run out of slots in PangoFontClass, this is implemented with a vfunc in PangoFontMapClass.
* Add pango_font_face_get_familyMatthias Clasen2019-10-311-0/+9
|
* Add pango_font_family_get_faceMatthias Clasen2019-10-311-12/+39
| | | | This lets us get a face by name.
* Add pango_font_map_get_familyMatthias Clasen2019-10-311-14/+48
| | | | This lets us get a PangoFontFamily by name.
* fc: remove another assertion that might triggerMatthias Clasen2019-10-251-2/+1
| | | | | Apparently, people have fonts without formats, so better don't assert, just silently skip those.
* fc: Be robust against missing format informationMatthias Clasen2019-10-241-2/+1
| | | | | | | | Some people have been seeing this assertion getting hit. So don't assert, simply skip fonts that don't have format information. Fixes: https://gitlab.gnome.org/GNOME/pango/issues/431
* Add a runtime version check for harfbuzzMatthias Clasen2019-08-191-1/+4
| | | | | | | Electron apps seem to include a static copy of a too old version of harfbuzz. Error out with a clear message in this broken situation, instead of segfaulting later.
* Revert no-longer-needed changesMatthias Clasen2019-08-061-46/+14
| | | | | | We are now producing an FcFontSet that has only font patterns with supported formats, so we no longer need to skip NULL fonts.
* Better filtering by font formatMatthias Clasen2019-08-061-15/+47
| | | | | As Behdad pointed out, we were mixing up font format filtering and coverage trimming.
* fc: Ignore more unsupported font formatsKhaled Hosny2019-08-041-4/+17
| | | | | | | | | | | | | FontConfig uses FreeType’s FT_Get_X11_Font_Format() to get the font format. From the list of font formats it supports, only “TrueType” and “CFF” are supported by HarfBuzz. We now check explicitly for supported formats and reject anything else: https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/include/freetype/internal/services/svfntfmt.h#n36 FreeType, however, seems to use “CFF” for both OpenType fonts with CFF table (.otf) and bare CFF fonts (.cff), but the later are not supported by HarfBuzz although they rather rare (outside of PDF files, which shouldn’t be rendered with Pango), so it should be OK.
* fc: Don't return fonts with unsupported formatsMatthias Clasen2019-08-031-15/+49
| | | | | | | | Make pango_fontset_foreach skip fonts that in formats that harfbuzz doesn't support. Some reshuffling was necessary since previously the code was assuming that the first NULL indicates the end of available fonts.
* fc: Don't list fonts with unsupported formatsMatthias Clasen2019-08-031-0/+5
| | | | We don't want to list fonts if we can't handle them.
* Add missing transfer annotationsEmmanuele Bassi2019-08-021-2/+2
|
* Add system-ui generic family supportAkira TAGOH2019-07-241-2/+10
|
* fc: Drop the cmap cacheMatthias Clasen2019-07-181-51/+0
| | | | This is now unused.
* fc: Move font setup code from the shaperMatthias Clasen2019-07-181-1/+3
| | | | | | | | | | | | Move all the code that sets up the hb_font_t to pango_fc_font_create_hb_font, and use it from the shaper. This is the second step towards taking over font management. Even better, harfbuzz has a ready-made function for this. We can drop a lot of FT_Face-using code this way. We assume unhinted rendering for now, so we can set ppem to 0.
* fc: Implement create_hb_fontMatthias Clasen2019-07-181-0/+25
|
* fc: Return a coverage levelMatthias Clasen2019-07-171-1/+3
| | | | | We were just returning a boolean, leaving it up to luck to match coverage level enum values.
* Turn PangoCoverage into an objectMatthias Clasen2019-07-111-42/+81
| | | | | | Make PangoCoverage a GObject, and subclass it in pangofcfontmap.c. This lets us use the FcCharSet without copying the data.
* Reimplement PangoCoverage on top of hb_set_tMatthias Clasen2019-07-111-4/+1
| | | | | | This drops the language dependency and coverage levels, both of which are not used in pango.
* Header cleanupMatthias Clasen2019-07-041-1/+2
| | | | | | | Abolish the PANGO_ENABLE_BACKEND and PANGO_ENABLE_ENGINE defines. All backend-only apis are moved into private headers, all apis that were engine-only are marked as deprecated, since engines are.
* Skip variable when enumerating facesMatthias Clasen2018-11-191-0/+10
| | | | | | The variable face is somewhat special, and we don't want to confuse things by calling it 'Regular' (since it doesn't have a style).
* Implement variable family api for fontconfigMatthias Clasen2018-11-191-1/+24
| | | | | This is very straightforward, since fontconfig has a field for this.
* Drop deprecated instance private data APIEmmanuele Bassi2018-08-301-9/+9
| | | | | | | 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.
* [fc] Speed-up font face enumerationBehdad Esfahbod2018-07-161-56/+38
| | | | | | | | Instead of a O(n^2.log(n)), we now do O(n) by avoiding calling FcFontList for each PangoFontFace, and FcFontMatch in pango_fc_face_describe(). Makes pango-list over 100 times faster for me.
* [fc] Remove ancient #ifdef FC_* conditionalsBehdad Esfahbod2018-07-161-32/+1
|
* [fc] List all bitmap sizes of FcPatternBehdad Esfahbod2018-07-081-2/+4
| | | | | Apple Color Emoji for example has multiple strikes... We were only listing first.
* fontmap: fix warnings from recent g_object_ref() changesChristian Hergert2018-01-051-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=792231
* Avoid a memory leakMatthias Clasen2018-01-051-1/+1
| | | | | | | | We call pango_fc_font_key_init on a stack-allocated temporary lookup key, with the expectation that it does not have to be freed. In the case where we want to use it as key in the font_hash, we call copy() on it. So, don't duplicate the variations string in init() - it will get duplicated in copy() later.
* [fc] Use FcWeightFrom/ToOpenTypeDouble() if availableBehdad Esfahbod2018-01-031-58/+13
|
* [fc] Only set variations if non-emptyBehdad Esfahbod2018-01-031-1/+3
|
* [fc] Request variable fonts from fontconfigBehdad Esfahbod2018-01-031-0/+3
|
* Add initial support for OpenType font variationsMatthias Clasen2018-01-031-3/+40
| | | | | | | | 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.
* docs: Fix some introspection annotation syntaxPhilip Withnall2017-04-081-1/+1
| | | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778663
* pango: Remove some unnecessary NULL checksPhilip Withnall2017-02-161-1/+1
| | | | | | | | | | | | | | | | These checks are preceded by other checks or code which demonstrates that the values are definitely always non-NULL. In the case of pango_attr_list_insert_internal(), the final branch of the function never needs to update list->attributes_tail, as the middle branch handles the case of appending to the list. The final case is just for insertions in the middle of the list. Coverity IDs: 1391710, 1391711 Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=778654
* Fix an error in font weight conversionMatthias Clasen2015-05-241-2/+2
| | | | | | | | The fallback code for conversion from fontconfig font weights to PangoWeight was mixing up PANGO_WEIGHT_SEMILIGHT and PANGO_WEIGHT_LIGHT. https://bugzilla.gnome.org/show_bug.cgi?id=749635