Imported Upstream version 2.14.2
[platform/upstream/fontconfig.git] / doc / fcweight.fncs
1 /*
2  * fontconfig/doc/fcweight.fncs
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the author(s) not be used in
9  * advertising or publicity pertaining to distribution of the software without
10  * specific, written prior permission.  The authors make no
11  * representations about the suitability of this software for any purpose.  It
12  * is provided "as is" without express or implied warranty.
13  *
14  * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20  * PERFORMANCE OF THIS SOFTWARE.
21  */
22 @RET@           double
23 @FUNC@          FcWeightFromOpenTypeDouble
24 @TYPE1@         double                          @ARG1@          ot_weight
25 @PURPOSE@       Convert from OpenType weight values to fontconfig ones
26 @DESC@
27 <function>FcWeightFromOpenTypeDouble</function> returns an double value
28 to use with FC_WEIGHT, from an double in the 1..1000 range, resembling
29 the numbers from OpenType specification's OS/2 usWeight numbers, which
30 are also similar to CSS font-weight numbers.  If input is negative,
31 zero, or greater than 1000, returns -1.  This function linearly interpolates
32 between various FC_WEIGHT_* constants.  As such, the returned value does not
33 necessarily match any of the predefined constants.
34 @SINCE@         2.12.92
35 @@
36
37 @RET@           double
38 @FUNC@          FcWeightToOpenTypeDouble
39 @TYPE1@         double                          @ARG1@          ot_weight
40 @PURPOSE@       Convert from fontconfig weight values to OpenType ones
41 @DESC@
42 <function>FcWeightToOpenTypeDouble</function> is the inverse of
43 <function>FcWeightFromOpenType</function>.  If the input is less than
44 FC_WEIGHT_THIN or greater than FC_WEIGHT_EXTRABLACK, returns -1.  Otherwise
45 returns a number in the range 1 to 1000.
46 @SINCE@         2.12.92
47 @@
48
49 @RET@           int
50 @FUNC@          FcWeightFromOpenType
51 @TYPE1@         int                             @ARG1@          ot_weight
52 @PURPOSE@       Convert from OpenType weight values to fontconfig ones
53 @DESC@
54 <function>FcWeightFromOpenType</function> is like
55 <function>FcWeightFromOpenTypeDouble</function> but with integer arguments.
56 Use the other function instead.
57 @SINCE@         2.11.91
58 @@
59
60 @RET@           int
61 @FUNC@          FcWeightToOpenType
62 @TYPE1@         int                             @ARG1@          ot_weight
63 @PURPOSE@       Convert from fontconfig weight values to OpenType ones
64 @DESC@
65 <function>FcWeightToOpenType</function> is like
66 <function>FcWeightToOpenTypeDouble</function> but with integer arguments.
67 Use the other function instead.
68 @SINCE@         2.11.91
69 @@