summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-05-06 02:28:37 +0000
committerKeith Packard <keithp@keithp.com>2004-05-06 02:28:37 +0000
commit55a69bd0aeb4cde4e87c1c7cd04a9f10a1f4cb1a (patch)
treee39bcf6f9f8ef5a3a04a615ce77ce07f7e69b97a
parentbd0ddac8f34dd6ef0a9385aacf3edc4c81023452 (diff)
Replace MIN/MAX/ABS macros which happen to have come from FreeType with
fontconfig-specific ones (FC_*)
-rw-r--r--ChangeLog6
-rw-r--r--src/fcfreetype.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 00b12e4..1b4ebcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-05 Keith Packard <keithp@keithp.com>
+
+ * src/fcfreetype.c: (FcFreeTypeCharSetAndSpacing):
+ Replace MIN/MAX/ABS macros which happen to have come
+ from FreeType with fontconfig-specific ones (FC_*)
+
2004-04-23 Keith Packard <keithp@keithp.com>
* INSTALL:
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 816f08a..6e4709f 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1829,7 +1829,10 @@ FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4,
return FcFalse;
}
-#define APPROXIMATELY_EQUAL(x,y) (ABS ((x) - (y)) <= MAX (ABS (x), ABS (y)) / 33)
+#define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
+#define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
+#define FC_ABS(a) ((a) < 0 ? -(a) : (a))
+#define APPROXIMATELY_EQUAL(x,y) (FC_ABS ((x) - (y)) <= FC_MAX (FC_ABS (x), FC_ABS (y)) / 33)
FcCharSet *
FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
@@ -2046,7 +2049,7 @@ FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
#endif
if (fixed_advance)
*spacing = FC_MONO;
- else if (dual_advance && APPROXIMATELY_EQUAL (2 * MIN (advance_one, advance_two), MAX (advance_one, advance_two)))
+ else if (dual_advance && APPROXIMATELY_EQUAL (2 * FC_MIN (advance_one, advance_two), FC_MAX (advance_one, advance_two)))
*spacing = FC_DUAL;
else
*spacing = FC_PROPORTIONAL;