summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-11-09 11:47:03 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-11-09 11:47:03 +0000
commita62921070e37d6352ea9606e2db69247a3a1e695 (patch)
tree5a0bc8baf9e642f2cbfcdf6d0e19e6e69cc1f7a3
parentae90aa07e311d3a77936e2fdbf49111b92e8a69b (diff)
parentd94f5a10a2f19fed4a3a5ae823d7e07d9d05e76d (diff)
downloadpango-a62921070e37d6352ea9606e2db69247a3a1e695.tar.gz
Merge branch 'newer-fontconfig' into 'main'
Bump fontconfig dep to 2.13.0 See merge request GNOME/pango!499
-rw-r--r--meson.build2
-rw-r--r--pango/pangofc-font.c4
-rw-r--r--pango/pangofc-fontmap.c38
-rw-r--r--pango/pangofc-fontmap.h3
4 files changed, 17 insertions, 30 deletions
diff --git a/meson.build b/meson.build
index f23dd6fc..3caec030 100644
--- a/meson.build
+++ b/meson.build
@@ -229,7 +229,7 @@ glib_req_version = '>= 2.62'
fribidi_req_version = '>= 1.0.6'
libthai_req_version = '>= 0.1.9'
harfbuzz_req_version = '>= 2.2.0'
-fontconfig_req_version = '>= 2.11.91'
+fontconfig_req_version = '>= 2.13.0'
xft_req_version = '>= 2.0.0'
cairo_req_version = '>= 1.12.10'
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 824f5ab0..bcb14d7d 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -849,7 +849,7 @@ pango_fc_font_get_features (PangoFont *font,
char *s;
while (*num_features < len &&
FcResultMatch == FcPatternGetString (fc_font->font_pattern,
- PANGO_FC_FONT_FEATURES,
+ FC_FONT_FEATURES,
*num_features,
(FcChar8 **) &s))
{
@@ -1024,7 +1024,7 @@ pango_fc_font_create_hb_font (PangoFont *font)
hb_ot_var_named_instance_get_design_coords (hb_face, instance, &n_axes, coords);
}
- if (FcPatternGetString (pattern, PANGO_FC_FONT_VARIATIONS, 0, (FcChar8 **)&variations) == FcResultMatch)
+ if (FcPatternGetString (pattern, FC_FONT_VARIATIONS, 0, (FcChar8 **)&variations) == FcResultMatch)
parse_variations (variations, axes, n_axes, coords);
variations = pango_fc_font_key_get_variations (key);
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 076ca291..0cfe5de8 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1669,9 +1669,7 @@ ensure_families (PangoFcFontMap *fcfontmap)
if (priv->n_families < 0)
{
FcObjectSet *os = FcObjectSetBuild (FC_FAMILY, FC_SPACING, FC_STYLE, FC_WEIGHT, FC_WIDTH, FC_SLANT,
-#ifdef FC_VARIABLE
FC_VARIABLE,
-#endif
FC_FONTFORMAT,
NULL);
FcPattern *pat = FcPatternCreate ();
@@ -1715,9 +1713,7 @@ ensure_families (PangoFcFontMap *fcfontmap)
if (temp_family)
{
variable = FALSE;
-#ifdef FC_VARIABLE
variable = FcPatternGetBool (fontset->fonts[i], FC_VARIABLE, 0, &variable);
-#endif
if (variable)
temp_family->variable = TRUE;
@@ -1791,11 +1787,7 @@ pango_fc_font_map_get_family (PangoFontMap *fontmap,
static double
pango_fc_convert_weight_to_fc (PangoWeight pango_weight)
{
-#ifdef HAVE_FCWEIGHTFROMOPENTYPEDOUBLE
return FcWeightFromOpenTypeDouble (pango_weight);
-#else
- return FcWeightFromOpenType (pango_weight);
-#endif
}
static int
@@ -1882,16 +1874,14 @@ pango_fc_make_pattern (const PangoFontDescription *description,
FC_WEIGHT, FcTypeDouble, weight,
FC_SLANT, FcTypeInteger, slant,
FC_WIDTH, FcTypeInteger, width,
-#ifdef FC_VARIABLE
FC_VARIABLE, FcTypeBool, FcDontCare,
-#endif
FC_DPI, FcTypeDouble, dpi,
FC_SIZE, FcTypeDouble, pixel_size * (72. / 1024. / dpi),
FC_PIXEL_SIZE, FcTypeDouble, pixel_size / 1024.,
NULL);
if (variations)
- FcPatternAddString (pattern, PANGO_FC_FONT_VARIATIONS, (FcChar8*) variations);
+ FcPatternAddString (pattern, FC_FONT_VARIATIONS, (FcChar8*) variations);
if (pango_font_description_get_family (description))
{
@@ -1918,24 +1908,24 @@ pango_fc_make_pattern (const PangoFontDescription *description,
switch (variant)
{
case PANGO_VARIANT_SMALL_CAPS:
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "smcp=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "smcp=1");
break;
case PANGO_VARIANT_ALL_SMALL_CAPS:
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "smcp=1");
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "c2sc=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "smcp=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "c2sc=1");
break;
case PANGO_VARIANT_PETITE_CAPS:
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "pcap=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "pcap=1");
break;
case PANGO_VARIANT_ALL_PETITE_CAPS:
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "pcap=1");
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "c2pc=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "pcap=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "c2pc=1");
break;
case PANGO_VARIANT_UNICASE:
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "unic=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "unic=1");
break;
case PANGO_VARIANT_TITLE_CAPS:
- FcPatternAddString (pattern, PANGO_FC_FONT_FEATURES, (FcChar8*) "titl=1");
+ FcPatternAddString (pattern, FC_FONT_FEATURES, (FcChar8*) "titl=1");
break;
case PANGO_VARIANT_NORMAL:
break;
@@ -2702,11 +2692,7 @@ pango_fc_font_map_shutdown (PangoFcFontMap *fcfontmap)
static PangoWeight
pango_fc_convert_weight_to_pango (double fc_weight)
{
-#ifdef HAVE_FCWEIGHTFROMOPENTYPEDOUBLE
return FcWeightToOpenTypeDouble (fc_weight);
-#else
- return FcWeightToOpenType (fc_weight);
-#endif
}
static PangoStyle
@@ -2824,7 +2810,7 @@ pango_fc_font_description_from_pattern (FcPattern *pattern, gboolean include_siz
{
const char *s;
- if (FcPatternGetString (pattern, PANGO_FC_FONT_FEATURES, i, (FcChar8 **)&s) == FcResultMatch)
+ if (FcPatternGetString (pattern, FC_FONT_FEATURES, i, (FcChar8 **)&s) == FcResultMatch)
{
if (strcmp (s, "smcp=1") == 0)
{
@@ -2905,7 +2891,7 @@ pango_fc_font_description_from_pattern (FcPattern *pattern, gboolean include_siz
pango_font_description_set_gravity (desc, gravity);
}
- if (include_size && FcPatternGetString (pattern, PANGO_FC_FONT_VARIATIONS, 0, (FcChar8 **)&s) == FcResultMatch)
+ if (include_size && FcPatternGetString (pattern, FC_FONT_VARIATIONS, 0, (FcChar8 **)&s) == FcResultMatch)
{
if (s && *s)
pango_font_description_set_variations (desc, (char *)s);
@@ -3266,7 +3252,6 @@ ensure_faces (PangoFcFamily *fcfamily)
if (FcPatternGetInteger(fontset->fonts[i], FC_SLANT, 0, &slant) != FcResultMatch)
slant = FC_SLANT_ROMAN;
-#ifdef FC_VARIABLE
{
gboolean variable;
if (FcPatternGetBool(fontset->fonts[i], FC_VARIABLE, 0, &variable) != FcResultMatch)
@@ -3274,7 +3259,6 @@ ensure_faces (PangoFcFamily *fcfamily)
if (variable) /* skip the variable face */
continue;
}
-#endif
if (FcPatternGetString (fontset->fonts[i], FC_STYLE, 0, (FcChar8 **)(void*)&font_style) != FcResultMatch)
font_style = NULL;
diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h
index 074bca20..e1e56c94 100644
--- a/pango/pangofc-fontmap.h
+++ b/pango/pangofc-fontmap.h
@@ -233,6 +233,9 @@ void pango_fc_font_map_substitute_changed (PangoFcFontMap *fontmap);
* The property will have a string elements, each of which
* a comma-separated list of OpenType axis setting of the
* form AXIS=VALUE.
+ *
+ * This is equivalent to FC_FONT_VARIATIONS in versions of
+ * fontconfig that have that.
*/
#define PANGO_FC_FONT_VARIATIONS "fontvariations"