a8a235f63a0378b7bae56a9cdfb15eed4b05ceaf
[platform/upstream/fontconfig.git] / doc / fcweight.sgml
1 <!--
2    fontconfig/doc/func.sgml
3   
4    Copyright © 2003 Keith Packard
5   
6    Permission to use, copy, modify, distribute, and sell this software and its
7    documentation for any purpose is hereby granted without fee, provided that
8    the above copyright notice appear in all copies and that both that
9    copyright notice and this permission notice appear in supporting
10    documentation, and that the name of the author(s) not be used in
11    advertising or publicity pertaining to distribution of the software without
12    specific, written prior permission.  The authors make no
13    representations about the suitability of this software for any purpose.  It
14    is provided "as is" without express or implied warranty.
15   
16    THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17    INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18    EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20    DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21    TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22    PERFORMANCE OF THIS SOFTWARE.
23  -->
24     <refentry id="FcWeightFromOpenType">
25         <refmeta>
26             <refentrytitle>FcWeightFromOpenType</refentrytitle>
27             <manvolnum>3</manvolnum>
28             <refmiscinfo class="software">Fontconfig &version;</refmiscinfo>
29         </refmeta>
30         <refnamediv>
31             <refname>FcWeightFromOpenType</refname>
32             <refpurpose>Convert from OpenType weight values to fontconfig ones</refpurpose>
33         </refnamediv>
34         <refsynopsisdiv>
35         <funcsynopsis>
36         <funcsynopsisinfo>
37 #include &lt;fontconfig/fontconfig.h&gt;
38         </funcsynopsisinfo>
39         <funcprototype>
40             <funcdef>int <function>FcWeightFromOpenType</function></funcdef>
41                 <paramdef>int<parameter>ot_weight</parameter></paramdef>
42         </funcprototype>
43         </funcsynopsis>
44         </refsynopsisdiv>
45         <refsect1><title>Description</title>
46             <para>
47 <function>FcWeightFromOpenType</function> returns an integer value
48 to use with FC_WEIGHT, from an integer in the 1..1000 range, resembling
49 the numbers from OpenType specification's OS/2 usWeight numbers, which
50 are also similar to CSS font-weight numbers.  If input is negative,
51 zero, or greater than 1000, returns -1.  This function linearly interpolates
52 between various FC_WEIGHT_* constants.  As such, the returned value does not
53 necessarily match any of the predefined constants.
54             </para>
55         </refsect1>
56         <refsect1><title>Since</title>
57             <para>version 2.11.91</para>
58         </refsect1>
59     </refentry>
60 <!--
61    fontconfig/doc/func.sgml
62   
63    Copyright © 2003 Keith Packard
64   
65    Permission to use, copy, modify, distribute, and sell this software and its
66    documentation for any purpose is hereby granted without fee, provided that
67    the above copyright notice appear in all copies and that both that
68    copyright notice and this permission notice appear in supporting
69    documentation, and that the name of the author(s) not be used in
70    advertising or publicity pertaining to distribution of the software without
71    specific, written prior permission.  The authors make no
72    representations about the suitability of this software for any purpose.  It
73    is provided "as is" without express or implied warranty.
74   
75    THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
76    INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
77    EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
78    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
79    DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
80    TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
81    PERFORMANCE OF THIS SOFTWARE.
82  -->
83     <refentry id="FcWeightToOpenType">
84         <refmeta>
85             <refentrytitle>FcWeightToOpenType</refentrytitle>
86             <manvolnum>3</manvolnum>
87             <refmiscinfo class="software">Fontconfig &version;</refmiscinfo>
88         </refmeta>
89         <refnamediv>
90             <refname>FcWeightToOpenType</refname>
91             <refpurpose>Convert from fontconfig weight values to OpenType ones</refpurpose>
92         </refnamediv>
93         <refsynopsisdiv>
94         <funcsynopsis>
95         <funcsynopsisinfo>
96 #include &lt;fontconfig/fontconfig.h&gt;
97         </funcsynopsisinfo>
98         <funcprototype>
99             <funcdef>int <function>FcWeightToOpenType</function></funcdef>
100                 <paramdef>int<parameter>ot_weight</parameter></paramdef>
101         </funcprototype>
102         </funcsynopsis>
103         </refsynopsisdiv>
104         <refsect1><title>Description</title>
105             <para>
106 <function>FcWeightToOpenType</function> is the inverse of
107 <function>FcWeightFromOpenType</function>.  If the input is less than
108 FC_WEIGHT_THIN or greater than FC_WEIGHT_EXTRABLACK, returns -1.  Otherwise
109 returns a number in the range 1 to 1000.
110             </para>
111         </refsect1>
112         <refsect1><title>Since</title>
113             <para>version 2.11.91</para>
114         </refsect1>
115     </refentry>