fcweight.fncs revision 953daeba
1953daebaSmrg/* 2953daebaSmrg * fontconfig/doc/fcweight.fncs 3953daebaSmrg * 4953daebaSmrg * Permission to use, copy, modify, distribute, and sell this software and its 5953daebaSmrg * documentation for any purpose is hereby granted without fee, provided that 6953daebaSmrg * the above copyright notice appear in all copies and that both that 7953daebaSmrg * copyright notice and this permission notice appear in supporting 8953daebaSmrg * documentation, and that the name of the author(s) not be used in 9953daebaSmrg * advertising or publicity pertaining to distribution of the software without 10953daebaSmrg * specific, written prior permission. The authors make no 11953daebaSmrg * representations about the suitability of this software for any purpose. It 12953daebaSmrg * is provided "as is" without express or implied warranty. 13953daebaSmrg * 14953daebaSmrg * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 15953daebaSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 16953daebaSmrg * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 17953daebaSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 18953daebaSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19953daebaSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20953daebaSmrg * PERFORMANCE OF THIS SOFTWARE. 21953daebaSmrg */ 22953daebaSmrg@RET@ int 23953daebaSmrg@FUNC@ FcWeightFromOpenType 24953daebaSmrg@TYPE1@ int @ARG1@ ot_weight 25953daebaSmrg@PURPOSE@ Convert from OpenType weight values to fontconfig ones 26953daebaSmrg@DESC@ 27953daebaSmrg<function>FcWeightFromOpenType</function> returns an integer value 28953daebaSmrgto use with FC_WEIGHT, from an integer in the 1..1000 range, resembling 29953daebaSmrgthe numbers from OpenType specification's OS/2 usWeight numbers, which 30953daebaSmrgare also similar to CSS font-weight numbers. If input is negative, 31953daebaSmrgzero, or greater than 1000, returns -1. This function linearly interpolates 32953daebaSmrgbetween various FC_WEIGHT_* constants. As such, the returned value does not 33953daebaSmrgnecessarily match any of the predefined constants. 34953daebaSmrg@SINCE@ 2.11.91 35953daebaSmrg@@ 36953daebaSmrg 37953daebaSmrg@RET@ int 38953daebaSmrg@FUNC@ FcWeightToOpenType 39953daebaSmrg@TYPE1@ int @ARG1@ ot_weight 40953daebaSmrg@PURPOSE@ Convert from fontconfig weight values to OpenType ones 41953daebaSmrg@DESC@ 42953daebaSmrg<function>FcWeightToOpenType</function> is the inverse of 43953daebaSmrg<function>FcWeightFromOpenType</function>. If the input is less than 44953daebaSmrgFC_WEIGHT_THIN or greater than FC_WEIGHT_EXTRABLACK, returns -1. Otherwise 45953daebaSmrgreturns a number in the range 1 to 1000. 46953daebaSmrg@SINCE@ 2.11.91 47953daebaSmrg@@ 48