summaryrefslogtreecommitdiff
path: root/pango/pangocoretext-fontmap.c
Commit message (Collapse)AuthorAgeFilesLines
* coretext: correctly clamp the core text weights at min/max valuesJeremy Tan2021-11-121-4/+5
| | | | Addresses bug found in #624
* coretext: Set size on font descriptionsMatthias Clasen2021-08-311-0/+7
| | | | | | | | Set a size on the font description returned by pango_font_describe(). Otherwise, scaling it doesn't work. Fixes: #610
* -Wincompatible-pointer-typescoretext-warningsKhaled Hosny2021-08-281-1/+1
|
* -Wincompatible-pointer-types-discards-qualifiersKhaled Hosny2021-08-281-1/+1
|
* Add some NULL checksadd-null-checkdsMatthias Clasen2021-05-091-1/+2
| | | | | | | Originally suggested by Philipp Withnall in https://bugzilla.gnome.org/show_bug.cgi?id=778655 Fixes: #268
* Use g_memdup2()memdup2Matthias Clasen2021-03-181-1/+1
| | | | | The g_memdup() function is replaced by a safer version in newer versions of GLib.
* macos: Implement pango_font_get_faceMatthias Clasen2021-01-041-0/+51
| | | | | | | This was returning NULL for coretext fonts. Good that we have tests for this. Fixes: #524
* Add pango_font_get_faceMatthias Clasen2019-10-311-0/+10
| | | | | 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
|
* [coretext] make setting font gravity workKhaled Hosny2019-10-231-0/+1
| | | | | | | | | | | | | | | | | Setting font gravity to anything other than PANGO_GRAVITY_SOUTH causes no fonts to be matched on Core Text backend because the code for finding best match checks for equal gravity between the requested font and the fonts in the font set, and the later always have PANGO_GRAVITY_SOUTH. Hack around this by copying the gravity from the requested font. Can be tested with: $ pango-view --gravity=east --rotate=-90 utils/test-chinese.txt Currently without this change it gives: (pango-view:2824): Pango-WARNING **: 10:59:18.683: couldn't load font "serif Rotated-Left 12", modified variant/weight/stretch as fallback, expect ugly output. (pango-view:2824): Pango-ERROR **: 10:59:18.683: Could not load fallback font, bailing out. Trace/BPT trap: 5
* coretext: Make “system-ui” alias workKhaled Hosny2019-08-011-16/+15
| | | | | | | | | Alias names need to be inserted into the font map or otherwise will be ignored and mapped to Sans (in pango_core_text_font_map_load_fontset()). Furthermore, there is no font named ”San Francisco” on macOS, the actual UI font is a hidden font called ”.SF NS Text” or something like that, and there an “.AppleSystemUIFont” alias that should be used instead.
* Add system-ui generic family supportAkira TAGOH2019-07-241-0/+12
|
* coretext: Plug a memory leakMatthias Clasen2019-07-051-0/+3
| | | | | | Patch by Alan Wang. Closes: https://gitlab.gnome.org/GNOME/pango/issues/281
* Core text: Fix indexing into cascade list when multiple fonts are selectedJeremy Tan2019-06-101-14/+14
| | | | | | | | | | | | | | | | | | | | | | | Bug introduced from 633fd80. With that changeset, if multiple fonts from the provided font family are found, they are added to the start of fontset->fonts. Space for the cascade list (based on the 'best'/first font) then follows. However, pango_core_text_fontset_get_font_at was not updated to match this change. So it still assumes that there is at most only one 'real' font in fonset->fonts. With this assumption, the indexing into fontset->cascade_list became incorrect, leading to an out-of-bounds access on that list, resulting in an exception being thrown. Track the number of fonts found in pango_core_text_fontset_new in real_fount_count, and use this as the offset into cascade_list. This also fixes a memory leak; when a PangoCoreTextFontSet is initialised, fonts and coverages are pre-initialised, but this was being discarded and re-set in pango_core_text_fontset_new without freeing the previous initialisation.
* macOS: Use system `Apple Color Emoji` font for emoji characters.Suyuan Chang2019-01-251-2/+6
|
* Fix build failure in C89 modeRyan Schmidt2018-08-041-1/+2
| | | | | | | Fixes build error with default compilers on Mac OS X 10.6 and earlier: pangocoretext-fontmap.c: In function ‘pango_core_text_fontset_new’: pangocoretext-fontmap.c:1563: error: ‘for’ loop initial declaration used outside C99 mode
* fix comma-separated font list on macOS fixes #252Pravdomil Toman2018-06-271-22/+36
|
* Restore scaling of CoreText fonts.John Ralls2018-05-081-3/+12
| | | | Fixes bug 787867.
* CoreText: Remove absolute size and scaling to screen resolution.John Ralls2017-08-151-43/+26
| | | | | | | | | | | | | Cairo's CGFont backend already handles scaling fonts to the display resolution, so scaling to the screen screen resolution in Pango's CoreText backend generates double-sized text on a Retina display. The layout test depended on providing a (bogus) resolution of 96DPI and scaling the font to it in order to obtain the "expected" layout results. This is replaced by adjusting the font size in test-layout.c if Pango is compiled for CoreText. https://bugzilla.gnome.org/show_bug.cgi?id=782393
* Fix build on OS XMatthias Clasen2016-09-121-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=770729
* Bug 766148 - CT font weights do not map correctly to PangoWeightBehdad Esfahbod2016-05-191-33/+43
|
* coretext: guard for unset languageKristian Rietveld2015-05-291-10/+18
| | | | Fixes bug #750017
* coretext: ensure weight is always initializedKristian Rietveld2015-05-061-1/+1
|
* coretext: use public function to obtain cascade list if availableKristian Rietveld2015-05-061-0/+23
| | | | | | | We use a compile-time check: if compiling for platforms 10.8 or higher, use the public function, otherwise use the undocumented function. Fixes bug 737813.
* Remove gmodule dependency and deprecate some more symbolsBehdad Esfahbod2015-04-051-1/+0
|
* Deprecate module system, skip it for shaper modulesBehdad Esfahbod2015-04-041-4/+0
| | | | | | | | | | | | | | Now shaper is discovered via (previously unused!) font->find_shaper(). I'm keeping that just to allow clients override shaping. Though, even that I'm not sure we want to keep. Wraps shaper in PangoEngineShape structs to keep PangoAnalysis API intact. Deprecated pango-modules.h and some pango-engine.h. Language modules are not moved yet. Wired up PangoFc, PangoWin32, and PangoCoretext shapers.
* Check kCTFontCondensedTrait when creating from CTFontDescriptionRef.Cody Russell2014-10-311-0/+3
| | | | Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734372
* [coretext] NULL check in ct_font_descriptor_get_weight()Cody Russell2014-09-281-1/+1
| | | | | | | Ensure that CFDictionaryGetValue() didn't return NULL before we call CFNumberGetValue(). https://bugzilla.gnome.org/show_bug.cgi?id=736697
* [coretext] Support PANGO_WEIGHT_SEMILIGHTBehdad Esfahbod2014-07-261-6/+8
| | | | | | | We should interpolate. Added TODO. Don't have a coretext build so don't want to break it. Bug 733764 - Support more / free font weights
* Add pango_font_map_changed()Alexander Larsson2013-02-261-0/+11
| | | | | | | This is needed as a base class sometimes needs to invalidate the fontmap. https://bugzilla.gnome.org/show_bug.cgi?id=694626
* Track changes in FontMaps using a serialAlexander Larsson2012-12-061-0/+10
| | | | | | | | This adds the pango_font_map_get_serial method that lets you see if a fontmap has changes since the last check. It adds implementations to all current fontmaps. https://bugzilla.gnome.org/show_bug.cgi?id=340066
* Fix PangoCoreTextFontsetClass definition so that it buildsJohn Ralls2012-08-301-4/+9
|
* More churnBehdad Esfahbod2012-08-281-9/+5
|
* coretext: don't insert item in the hash if it originated from the hashKristian Rietveld2012-06-051-11/+14
| | | | | Oversight in my fallback fix, this resulted in things being wrongly destroyed due to unrefs. Oops.
* coretext: implement detection of fonts supporting small capsKristian Rietveld2012-06-041-4/+46
|
* Bug 673497 - corefont fallback not always workingKristian Rietveld2012-06-041-6/+42
| | | | | | | | | | | The fallback failed when a "small caps" font was requested. This commit improves the fallback support. When the first fallback, trying Sans with the same style fails, we reset the variant, weight and stretch to default values and try again. With Sans we should always be able to adhere to the requested style. Last but not least, output a sensible error message if all fallbacks fail instead of simply crashing on a NULL pointer somewhere.
* Use same font family name fallback in pango_core_text_font_map_initKristian Rietveld2012-05-131-6/+9
| | | | | Same fallback as already used in CoreText font descriptor to Pango font descriptor conversion.
* Make CoreText backend more robust against broken fontsKristian Rietveld2012-01-281-11/+60
| | | | | | | | | | | | | | | Patch written in collaboration with Michael Natterer. Some CTFontDescriptors apparently do not have a style name or font family name set. This patch makes the code take such corner cases into account. The font family problem only appears to occur on Snow Leopard systems, we try to fall back on the font name (postscript name), if that fails, we fall back on a default fallback. In some cases a coverage is also not set. (This seems to happen when we cannot map a broken font back to a correct font descriptor). In such cases we simply return an empty PangoCoverage, which will likely cause the engine to fallback on a different font.
* CoreText backend: implement font fallbacksKristian Rietveld2012-01-281-347/+961
| | | | | | | | | | | | | | | We implement font fallbacks by making use of CTFontCopyDefaultCascadeList, a public, non-exposed, symbol in the CoreText library. We might want to handle this differently. The code now also uses a PangoCoreTextFontsetKey and PangoCoreTextFontKey, similar to the font config backend. This has also helped to clean up the code in general. This patch contains two fixes by Michael Natterer: 1. Fix a bug in pango_core_text_font_key_equal() where the return value of memcmp() was wrongly interpreted. 2. Cache PangoCoverage in PangoCoreTextFont.
* CoreText: stricter handling of FontSymbolic traitsKristian Rietveld2011-11-141-5/+11
| | | | | | | | | | It turns out that getting this value as "Int" is incorrect and resulted in font traits not being returned in some cases. Without traits, an italic trait is not set, which caused synthetic oblique fonts to be created when not necessary. Also use CTFontSymbolicTraits type in the PangoCoreTextFace structure and do a stricter bit mask check for certainty.
* Bug 650781 - Font Families are listed lowercaseMatej Knopp2011-05-311-7/+5
| | | | Fix CoreText backend to not use the casefold string as family name.
* Bug 648044; Change PangoCoreTextFace::weight to type PangoWeight and perform ↵John Ralls2011-05-011-52/+44
| | | | | the conversion from the CFNumber with a mapping table in pango_core_test_face_from_ct_font_descriptor() This assigns PangoWeights which better align with the CoreText weights and better ensures that unique values are used for hash keys used for determining which faces need synthetic italic faces created.
* Finish conversion to using G_DEFINE_TYPE: Provide PangoCoreTextFamilyClass ↵John Ralls2011-04-301-43/+50
| | | | and PangoCoreTextFaceClass so that it actually compiles.
* pango/pangocoretext-fontmap.c: Use G_DEFINE_TYPEJavier Jardón2011-04-301-35/+2
|
* Properly propagate font size in pango_core_text_font_map_load_fontKristian Rietveld2011-04-141-1/+7
|
* Handle oblique fonts; synthesize italic fonts when neededKristian Rietveld2011-04-141-1/+70
| | | | | | Deduce from the given style name whether a font is oblique. If a font family does not have an italic or oblique variant, then add synthetic italic variants that are handled by Pango.
* Factor out translation of CTFontDescriptor into seperate functionKristian Rietveld2011-04-141-52/+61
|
* Start implementation of CoreText backendKristian Rietveld2011-04-141-0/+952
On Mac OS X systems where CoreText is available (that is, 10.5 or higher), we will build the CoreText backend instead of the ATSUI backend. In this case, the ATSUI backend will not be built and installed. This change is necessary because since Mac OS 10.5 ATSUI has been marked as deprecated. For older systems, we will have to continue to use the ATSUI backend.