aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcdefault.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-28 17:35:36 +0100
committermarha <marha@users.sourceforge.net>2014-03-28 17:35:36 +0100
commitcbfb19790917d271b8ca6156554b16acc802719f (patch)
tree830af0dc6e08b5d0c7124fec143e90255f3feee3 /fontconfig/src/fcdefault.c
parentd02e6760412c7a96abbc4d0add5dd8d5e83bbe27 (diff)
downloadvcxsrv-cbfb19790917d271b8ca6156554b16acc802719f.tar.gz
vcxsrv-cbfb19790917d271b8ca6156554b16acc802719f.tar.bz2
vcxsrv-cbfb19790917d271b8ca6156554b16acc802719f.zip
libxtrans fontconfig mesa xserver git update 28 Mar 2014
xserver commit a2880699e8f1f576e1a48ebf25e8982463323f84 libxtrans commit 68f60238c4224f954ff6556ae778c72e420175f0 fontconfig commit fcba9ef01c978323fc71c17e455d3cd6ae35edcc mesa commit 029ccd773d01a5f801c809c499516d7b0c4cc3f8
Diffstat (limited to 'fontconfig/src/fcdefault.c')
-rw-r--r--fontconfig/src/fcdefault.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/fontconfig/src/fcdefault.c b/fontconfig/src/fcdefault.c
index 4beda7c00..7c16f4841 100644
--- a/fontconfig/src/fcdefault.c
+++ b/fontconfig/src/fcdefault.c
@@ -219,6 +219,7 @@ FcDefaultSubstitute (FcPattern *pattern)
{
FcValue v, namelang, v2;
int i;
+ double dpi, size, scale, pixelsize;
if (FcPatternObjectGet (pattern, FC_WEIGHT_OBJECT, 0, &v) == FcResultNoMatch )
FcPatternObjectAddInteger (pattern, FC_WEIGHT_OBJECT, FC_WEIGHT_NORMAL);
@@ -233,32 +234,30 @@ FcDefaultSubstitute (FcPattern *pattern)
if (FcPatternObjectGet (pattern, FcBoolDefaults[i].field, 0, &v) == FcResultNoMatch)
FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value);
- if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) == FcResultNoMatch)
- {
- double dpi, size, scale;
+ if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch)
+ size = 12.0L;
+ if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
+ scale = 1.0;
+ if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch)
+ dpi = 75.0;
- if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch)
- {
- size = 12.0;
- (void) FcPatternObjectDel (pattern, FC_SIZE_OBJECT);
- FcPatternObjectAddDouble (pattern, FC_SIZE_OBJECT, size);
- }
- if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
- {
- scale = 1.0;
- (void) FcPatternObjectDel (pattern, FC_SCALE_OBJECT);
- FcPatternObjectAddDouble (pattern, FC_SCALE_OBJECT, scale);
- }
- size *= scale;
- if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch)
- {
- dpi = 75.0;
- (void) FcPatternObjectDel (pattern, FC_DPI_OBJECT);
- FcPatternObjectAddDouble (pattern, FC_DPI_OBJECT, dpi);
- }
- size *= dpi / 72.0;
- FcPatternObjectAddDouble (pattern, FC_PIXEL_SIZE_OBJECT, size);
+ if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) != FcResultMatch)
+ {
+ (void) FcPatternObjectDel (pattern, FC_SCALE_OBJECT);
+ FcPatternObjectAddDouble (pattern, FC_SCALE_OBJECT, scale);
+ pixelsize = size * scale;
+ (void) FcPatternObjectDel (pattern, FC_DPI_OBJECT);
+ FcPatternObjectAddDouble (pattern, FC_DPI_OBJECT, dpi);
+ pixelsize *= dpi / 72.0;
+ FcPatternObjectAddDouble (pattern, FC_PIXEL_SIZE_OBJECT, pixelsize);
+ }
+ else
+ {
+ size = v.u.d;
+ size = size / dpi * 72.0 / scale;
}
+ (void) FcPatternObjectDel (pattern, FC_SIZE_OBJECT);
+ FcPatternObjectAddDouble (pattern, FC_SIZE_OBJECT, size);
if (FcPatternObjectGet (pattern, FC_FONTVERSION_OBJECT, 0, &v) == FcResultNoMatch)
{