[Fontconfig] fontconfig: Branch 'master'

Akira TAGOH tagoh at kemper.freedesktop.org
Thu Sep 25 01:03:34 PDT 2014


 doc/fcrange.fncs        |   10 ++++++++++
 fontconfig/fontconfig.h |    3 +++
 src/fcrange.c           |   23 +++++++++++++++++++++++
 3 files changed, 36 insertions(+)

New commits:
commit 1082161ea303cf2bbc13b62a191662984131e820
Author: Akira TAGOH <akira at tagoh.org>
Date:   Thu Sep 25 17:03:27 2014 +0900

    Add FcRangeGetDouble()
    
    https://bugs.freedesktop.org/show_bug.cgi?id=82876

diff --git a/doc/fcrange.fncs b/doc/fcrange.fncs
index 6054595..4181b80 100644
--- a/doc/fcrange.fncs
+++ b/doc/fcrange.fncs
@@ -62,3 +62,13 @@ integer sized value.
 all memory associated with it.
 @SINCE@		2.11.91
 @@
+
+ at RET@		FcBool
+ at FUNC@		FcRangeGetDouble
+ at TYPE1@		const FcRange *			@ARG1@		range
+ at TYPE2@		double *      			@ARG2@		begin
+ at TYPE3@		double *			@ARG3@		end
+ at PURPOSE@	Get the range in double
+ at DESC@
+Returns in <parameter>begin</parameter> and <parameter>end</parameter> as the range.
+ at SINCE@		2.11.91
diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h
index e5b0959..afc917c 100644
--- a/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig.h
@@ -908,6 +908,9 @@ FcRangeDestroy (FcRange *range);
 FcPublic FcRange *
 FcRangeCopy (const FcRange *r);
 
+FcPublic FcBool
+FcRangeGetDouble(const FcRange *range, double *begin, double *end);
+
 /* fcweight.c */
 
 FcPublic int
diff --git a/src/fcrange.c b/src/fcrange.c
index 39eafd8..37cf067 100644
--- a/src/fcrange.c
+++ b/src/fcrange.c
@@ -76,6 +76,29 @@ FcRangeCopy (const FcRange *range)
     return ret;
 }
 
+FcBool
+FcRangeGetDouble(const FcRange *range, double *begin, double *end)
+{
+    if (!range)
+	return FcFalse;
+    if (range->is_double)
+    {
+	if (begin)
+	    *begin = range->u.d.begin;
+	if (end)
+	    *end = range->u.d.end;
+    }
+    else
+    {
+	if (begin)
+	    *begin = (double)range->u.i.begin;
+	if (end)
+	    *end = (double)range->u.i.end;
+    }
+
+    return FcTrue;
+}
+
 FcRange
 FcRangeCanonicalize (const FcRange *range)
 {


More information about the Fontconfig mailing list