diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-09-12 19:18:59 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-09-20 13:13:35 -0700 |
commit | b6440cbd7fbf965c8f70783bbdc93d592ac12b4e (patch) | |
tree | 1bf5dbd7cfd93ce68b7a75c27a366750cb93827d /src/fcdefault.c | |
parent | b4813436a3bea1945f44f3bf75a4eb02de8d0303 (diff) | |
download | fontconfig-b6440cbd7fbf965c8f70783bbdc93d592ac12b4e.tar.gz |
In FcSubstituteDefault(), handle size range
Takes the midpoint...
Diffstat (limited to 'src/fcdefault.c')
-rw-r--r-- | src/fcdefault.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fcdefault.c b/src/fcdefault.c index 5afd7ec..10c183a 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -255,7 +255,14 @@ FcDefaultSubstitute (FcPattern *pattern) FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value); if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch) - size = 12.0L; + { + FcRange *r; + double b, e; + if (FcPatternObjectGetRange (pattern, FC_SIZE_OBJECT, 0, &r) == FcResultMatch && FcRangeGetDouble (r, &b, &e)) + size = (b + e) * .5; + else + size = 12.0L; + } if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch) scale = 1.0; if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch) |