fcfile.fncs revision a6844aab
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 102c393a42Smrg * documentation, and that the name of Keith Packard not be used in 112c393a42Smrg * advertising or publicity pertaining to distribution of the software without 122c393a42Smrg * specific, written prior permission. Keith Packard makes 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 252c393a42Smrg@RET@ FcBool 262c393a42Smrg@FUNC@ FcFileScan 272c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ set 282c393a42Smrg@TYPE2@ FcStrSet * @ARG2@ dirs 292c393a42Smrg@TYPE3@ FcFileCache * @ARG3@ cache 302c393a42Smrg@TYPE4@ FcBlanks * @ARG4@ blanks 312c393a42Smrg@TYPE5@ const FcChar8 * @ARG5@ file 32a6844aabSmrg@TYPE6@ FcBool% @ARG6@ force 332c393a42Smrg@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 482c393a42Smrg@RET@ FcBool 492c393a42Smrg@FUNC@ FcFileIsDir 502c393a42Smrg@TYPE1@ const FcChar8 * @ARG1@ file 512c393a42Smrg@PURPOSE@ check whether a file is a directory 522c393a42Smrg@DESC@ 532c393a42SmrgReturns FcTrue if <parameter>file</parameter> is a directory, otherwise 542c393a42Smrgreturns FcFalse. 552c393a42Smrg@@ 562c393a42Smrg 572c393a42Smrg@RET@ FcBool 582c393a42Smrg@FUNC@ FcDirScan 592c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ set 602c393a42Smrg@TYPE2@ FcStrSet * @ARG2@ dirs 612c393a42Smrg@TYPE3@ FcFileCache * @ARG3@ cache 622c393a42Smrg@TYPE4@ FcBlanks * @ARG4@ blanks 632c393a42Smrg@TYPE5@ const FcChar8 * @ARG5@ dir 64a6844aabSmrg@TYPE6@ FcBool% @ARG6@ force 65a6844aabSmrg@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 752c393a42Smrg@RET@ FcBool 762c393a42Smrg@FUNC@ FcDirSave 772c393a42Smrg@TYPE1@ FcFontSet * @ARG1@ set 782c393a42Smrg@TYPE2@ FcStrSet * @ARG2@ dirs 792c393a42Smrg@TYPE3@ const FcChar8 * @ARG3@ dir 802c393a42Smrg@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