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 */ 221cc69409Smrg@RET@ double 231cc69409Smrg@FUNC@ FcWeightFromOpenTypeDouble 241cc69409Smrg@TYPE1@ double @ARG1@ ot_weight 251cc69409Smrg@PURPOSE@ Convert from OpenType weight values to fontconfig ones 26953daebaSmrg@DESC@ 27a32e9e42Smrg<function>FcWeightFromOpenTypeDouble</function> returns an double value 28a32e9e42Smrgto use with FC_WEIGHT, from an double 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, 31a4e54154Smrgzero, 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. 341cc69409Smrg@SINCE@ 2.12.92 35a32e9e42Smrg@@ 36a32e9e42Smrg 371cc69409Smrg@RET@ double 381cc69409Smrg@FUNC@ FcWeightToOpenTypeDouble 391cc69409Smrg@TYPE1@ double @ARG1@ ot_weight 401cc69409Smrg@PURPOSE@ Convert from fontconfig weight values to OpenType ones 41a32e9e42Smrg@DESC@ 42a32e9e42Smrg<function>FcWeightToOpenTypeDouble</function> is the inverse of 43a32e9e42Smrg<function>FcWeightFromOpenType</function>. If the input is less than 44a32e9e42SmrgFC_WEIGHT_THIN or greater than FC_WEIGHT_EXTRABLACK, returns -1. Otherwise 45a32e9e42Smrgreturns a number in the range 1 to 1000. 461cc69409Smrg@SINCE@ 2.12.92 47a32e9e42Smrg@@ 48a32e9e42Smrg 491cc69409Smrg@RET@ int 501cc69409Smrg@FUNC@ FcWeightFromOpenType 511cc69409Smrg@TYPE1@ int @ARG1@ ot_weight 521cc69409Smrg@PURPOSE@ Convert from OpenType weight values to fontconfig ones 53a32e9e42Smrg@DESC@ 54a32e9e42Smrg<function>FcWeightFromOpenType</function> is like 55a32e9e42Smrg<function>FcWeightFromOpenTypeDouble</function> but with integer arguments. 56a32e9e42SmrgUse the other function instead. 571cc69409Smrg@SINCE@ 2.11.91 58953daebaSmrg@@ 59953daebaSmrg 601cc69409Smrg@RET@ int 611cc69409Smrg@FUNC@ FcWeightToOpenType 621cc69409Smrg@TYPE1@ int @ARG1@ ot_weight 631cc69409Smrg@PURPOSE@ Convert from fontconfig weight values to OpenType ones 64953daebaSmrg@DESC@ 65a32e9e42Smrg<function>FcWeightToOpenType</function> is like 66a32e9e42Smrg<function>FcWeightToOpenTypeDouble</function> but with integer arguments. 67a32e9e42SmrgUse the other function instead. 681cc69409Smrg@SINCE@ 2.11.91 69953daebaSmrg@@ 70