12c393a42Smrg/* 2a6844aabSmrg * fontconfig/doc/fcfile.fncs 32c393a42Smrg * 42c393a42Smrg * Copyright © 2003 Keith Packard 52c393a42Smrg * 62c393a42Smrg * Permission to use, copy, modify, distribute, and sell this software and its 72c393a42Smrg * documentation for any purpose is hereby granted without fee, provided that 82c393a42Smrg * the above copyright notice appear in all copies and that both that 92c393a42Smrg * copyright notice and this permission notice appear in supporting 10ca08ab68Smrg * documentation, and that the name of the author(s) not be used in 112c393a42Smrg * advertising or publicity pertaining to distribution of the software without 12ca08ab68Smrg * specific, written prior permission. The authors make no 132c393a42Smrg * representations about the suitability of this software for any purpose. It 142c393a42Smrg * is provided "as is" without express or implied warranty. 152c393a42Smrg * 16a6844aabSmrg * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 172c393a42Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 18a6844aabSmrg * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR 192c393a42Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 202c393a42Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 212c393a42Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 222c393a42Smrg * PERFORMANCE OF THIS SOFTWARE. 232c393a42Smrg */ 242c393a42Smrg 251cc69409Smrg@RET@ FcBool 261cc69409Smrg@FUNC@ FcFileScan 271cc69409Smrg@TYPE1@ FcFontSet * @ARG1@ set 281cc69409Smrg@TYPE2@ FcStrSet * @ARG2@ dirs 291cc69409Smrg@TYPE3@ FcFileCache * @ARG3@ cache 301cc69409Smrg@TYPE4@ FcBlanks * @ARG4@ blanks 311cc69409Smrg@TYPE5@ const FcChar8 * @ARG5@ file 321cc69409Smrg@TYPE6@ FcBool% @ARG6@ force 331cc69409Smrg@PURPOSE@ scan a font file 342c393a42Smrg@DESC@ 352c393a42SmrgScans a single file and adds all fonts found to <parameter>set</parameter>. 362c393a42SmrgIf <parameter>force</parameter> is FcTrue, then the file is scanned even if 372c393a42Smrgassociated information is found in <parameter>cache</parameter>. If 382c393a42Smrg<parameter>file</parameter> is a directory, it is added to 392c393a42Smrg<parameter>dirs</parameter>. Whether fonts are found depends on fontconfig 402c393a42Smrgpolicy as well as the current configuration. Internally, fontconfig will 412c393a42Smrgignore BDF and PCF fonts which are not in Unicode (or the effectively 422c393a42Smrgequivalent ISO Latin-1) encoding as those are not usable by Unicode-based 432c393a42Smrgapplications. The configuration can ignore fonts based on filename or 442c393a42Smrgcontents of the font file itself. Returns FcFalse if any of the fonts cannot be 452c393a42Smrgadded (due to allocation failure). Otherwise returns FcTrue. 462c393a42Smrg@@ 472c393a42Smrg 481cc69409Smrg@RET@ FcBool 491cc69409Smrg@FUNC@ FcFileIsDir 501cc69409Smrg@TYPE1@ const FcChar8 * @ARG1@ file 511cc69409Smrg@PURPOSE@ check whether a file is a directory 522c393a42Smrg@DESC@ 532c393a42SmrgReturns FcTrue if <parameter>file</parameter> is a directory, otherwise 542c393a42Smrgreturns FcFalse. 552c393a42Smrg@@ 562c393a42Smrg 571cc69409Smrg@RET@ FcBool 581cc69409Smrg@FUNC@ FcDirScan 591cc69409Smrg@TYPE1@ FcFontSet * @ARG1@ set 601cc69409Smrg@TYPE2@ FcStrSet * @ARG2@ dirs 611cc69409Smrg@TYPE3@ FcFileCache * @ARG3@ cache 621cc69409Smrg@TYPE4@ FcBlanks * @ARG4@ blanks 631cc69409Smrg@TYPE5@ const FcChar8 * @ARG5@ dir 641cc69409Smrg@TYPE6@ FcBool% @ARG6@ force 651cc69409Smrg@PURPOSE@ scan a font directory without caching it 662c393a42Smrg@DESC@ 67a6844aabSmrgIf <parameter>cache</parameter> is not zero or if <parameter>force</parameter> 68a6844aabSmrgis FcFalse, this function currently returns FcFalse. Otherwise, it scans an 69a6844aabSmrgentire directory and adds all fonts found to <parameter>set</parameter>. 70a6844aabSmrgAny subdirectories found are added to <parameter>dirs</parameter>. Calling 71a6844aabSmrgthis function does not create any cache files. Use FcDirCacheRead() if 72a6844aabSmrgcaching is desired. 732c393a42Smrg@@ 742c393a42Smrg 751cc69409Smrg@RET@ FcBool 761cc69409Smrg@FUNC@ FcDirSave 771cc69409Smrg@TYPE1@ FcFontSet * @ARG1@ set 781cc69409Smrg@TYPE2@ FcStrSet * @ARG2@ dirs 791cc69409Smrg@TYPE3@ const FcChar8 * @ARG3@ dir 801cc69409Smrg@PURPOSE@ DEPRECATED: formerly used to save a directory cache 812c393a42Smrg@DESC@ 822c393a42SmrgThis function now does nothing aside from returning FcFalse. It used to creates the 832c393a42Smrgper-directory cache file for <parameter>dir</parameter> and populates it 842c393a42Smrgwith the fonts in <parameter>set</parameter> and subdirectories in 852c393a42Smrg<parameter>dirs</parameter>. All of this functionality is now automatically 862c393a42Smrgmanaged by FcDirCacheLoad and FcDirCacheRead. 872c393a42Smrg@@ 882c393a42Smrg 89