fcfile.fncs revision 2c393a42
12c393a42Smrg/* 22c393a42Smrg * $Id: fcfile.fncs,v 1.1.1.1 2008/07/30 01:24:21 mrg Exp $ 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 * 162c393a42Smrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 172c393a42Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 182c393a42Smrg * EVENT SHALL KEITH PACKARD 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 322c393a42Smrg@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 642c393a42Smrg@TYPE6@ FcBool% @ARG6@ force 652c393a42Smrg@PURPOSE@ DEPRECATED: formerly used to scan a font directory 662c393a42Smrg@DESC@ 672c393a42SmrgThis function does nothing aside from returning FcFalse. It used to scan an 682c393a42Smrgentire directory and add all fonts found to 692c393a42Smrg<parameter>set</parameter>. If <parameter>force</parameter> was FcTrue, then 702c393a42Smrgthe directory and all files within it were scanned even if information was 712c393a42Smrgpresent in the per-directory cache file or <parameter>cache</parameter>. Any 722c393a42Smrgsubdirectories found were added to <parameter>dirs</parameter>. 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