fontconfig/doc/fcconfig.fncs

293 lines
11 KiB
Plaintext
Raw Normal View History

2003-03-07 09:44:32 +01:00
/*
* $Id$
*
2004-12-07 02:14:46 +01:00
* Copyright © 2003 Keith Packard
2003-03-07 09:44:32 +01:00
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
@RET@ FcConfig *
2003-03-07 09:44:32 +01:00
@FUNC@ FcConfigCreate
@TYPE1@ void
@PURPOSE@ Create a configuration
@DESC@
Creates an empty configuration.
@@
@RET@ void
@FUNC@ FcConfigDestroy
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Destroy a configuration
@DESC@
Destroys a configuration and any data associated with it. Note that calling
this function with the return from FcConfigGetCurrent will place the library
in an indeterminate state.
@@
@RET@ FcBool
@FUNC@ FcConfigSetCurrent
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Set configuration as default
@DESC@
2003-03-07 09:51:14 +01:00
Sets the current default configuration to <parameter>config</parameter>. Implicitly calls
2003-03-07 09:44:32 +01:00
FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
@@
@RET@ FcConfig *
2003-03-07 09:44:32 +01:00
@FUNC@ FcConfigGetCurrent
@TYPE1@ void
@PURPOSE@ Return current configuration
@DESC@
Returns the current default configuration.
@@
@RET@ FcBool
@FUNC@ FcConfigUptoDate
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Check timestamps on config files
@DESC@
2003-03-07 09:51:14 +01:00
Checks all of the files related to <parameter>config</parameter> and returns whether the
2003-03-07 09:44:32 +01:00
in-memory version is in sync with the disk version.
@@
@RET@ FcBool
@FUNC@ FcConfigBuildFonts
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Build font database
@DESC@
Builds the set of available fonts for the given configuration. Note that
any changes to the configuration after this call have indeterminate effects.
Returns FcFalse if this operation runs out of memory.
@@
@RET@ FcStrList *
@FUNC@ FcConfigGetConfigDirs
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get config directories
@DESC@
Returns the list of font directories specified in the configuration files
2003-03-07 09:51:14 +01:00
for <parameter>config</parameter>. Does not include any subdirectories.
2003-03-07 09:44:32 +01:00
@@
@RET@ FcStrList *
@FUNC@ FcConfigGetFontDirs
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get font directories
@DESC@
2003-03-07 09:51:14 +01:00
Returns the list of font directories in <parameter>config</parameter>. This includes the
2003-03-07 09:44:32 +01:00
configured font directories along with any directories below those in the
filesystem.
@@
@RET@ FcStrList *
@FUNC@ FcConfigGetConfigFiles
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get config files
@DESC@
2003-03-07 09:51:14 +01:00
Returns the list of known configuration files used to generate <parameter>config</parameter>.
2003-03-07 09:44:32 +01:00
Note that this will not include any configuration done with FcConfigParse.
@@
@RET@ char *
@FUNC@ FcConfigGetCache
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get cache filename
@DESC@
Returns the name of the file used to store per-user font information.
@@
@RET@ FcFontSet *
@FUNC@ FcConfigGetFonts
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcSetName @ARG2@ set
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get config font set
@DESC@
Returns one of the two sets of fonts from the configuration as specified
2003-03-07 09:51:14 +01:00
by <parameter>set</parameter>.
2003-03-07 09:44:32 +01:00
@@
@RET@ FcBlanks *
@FUNC@ FcConfigGetBlanks
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get config blanks
@DESC@
Returns the FcBlanks object associated with the given configuration, if no
blanks were present in the configuration, this function will return 0.
@@
@RET@ int
@FUNC@ FcConfigGetRescanInverval
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Get config rescan interval
@DESC@
Returns the interval between automatic checks of the configuration (in
2003-03-07 09:51:14 +01:00
seconds) specified in <parameter>config</parameter>. The configuration is checked during
2003-03-07 09:44:32 +01:00
a call to FcFontList when this interval has passed since the last check.
@@
@RET@ FcBool
@FUNC@ FcConfigSetRescanInverval
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ int @ARG2@ rescanInterval
@PURPOSE@ Set config rescan interval
@DESC@
Sets the rescan interval; returns FcFalse if an error occurred.
@@
@RET@ FcBool
@FUNC@ FcConfigAppFontAddFile
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ const char * @ARG2@ file
2003-03-07 09:44:32 +01:00
@PURPOSE@ Add font file to font database
@DESC@
Adds an application-specific font to the configuration.
@@
@RET@ FcBool
@FUNC@ FcConfigAppFontAddDir
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ const char * @ARG1@ dir
2003-03-07 09:44:32 +01:00
@PURPOSE@ Add fonts from directory to font database
@DESC@
Scans the specified directory for fonts, adding each one found to the
application-specific set of fonts.
@@
@RET@ void
@FUNC@ FcConfigAppFontClear
@TYPE1@ FcConfig * @ARG1@ config
2003-03-07 09:44:32 +01:00
@PURPOSE@ Remove all app fonts from font database
@DESC@
Clears the set of application-specific fonts.
@@
@RET@ FcBool
@FUNC@ FcConfigSubstituteWithPat
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcPattern * @ARG2@ p
@TYPE3@ FcPattern * @ARG3@ p_pat
@TYPE4@ FcMatchKind @ARG4@ kind
2003-03-07 09:44:32 +01:00
@PURPOSE@ Execute substitutions
@DESC@
2003-03-07 09:51:14 +01:00
Performs the sequence of pattern modification operations, if <parameter>kind</parameter> is
FcMatchPattern, then those tagged as pattern operations are applied, else
2003-03-07 09:51:14 +01:00
if <parameter>kind</parameter> is FcMatchFont, those tagged as font operations are applied and
2003-03-07 09:44:32 +01:00
p_pat is used for &lt;test&gt; elements with target=pattern.
@@
@RET@ FcBool
@FUNC@ FcConfigSubstitute
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcPattern * @ARG2@ p
@TYPE3@ FcMatchKind @ARG3@ kind
2003-03-07 09:44:32 +01:00
@PURPOSE@ Execute substitutions
@DESC@
Calls FcConfigSubstituteWithPat setting p_pat to NULL.
@@
@RET@ FcPattern *
@FUNC@ FcFontMatch
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcPattern * @ARG2@ p
@TYPE3@ FcResult * @ARG3@ result
2003-03-07 09:44:32 +01:00
@PURPOSE@ Return best font
@DESC@
2003-03-07 09:51:14 +01:00
Returns the font in <parameter>config</parameter> most close matching <parameter>p</parameter>. This function
2003-03-07 09:44:32 +01:00
should be called only after FcConfigSubstitute and FcDefaultSubstitute have
2003-03-07 09:51:14 +01:00
been called for <parameter>p</parameter>; otherwise the results will not be correct.
2003-03-07 09:44:32 +01:00
@@
@RET@ FcFontSet *
@FUNC@ FcFontSort
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcPattern * @ARG2@ p
@TYPE3@ FcBool @ARG3@ trim
@TYPE4@ FcCharSet ** @ARG4@ csp
@TYPE5@ FcResult * @ARG5@ result
2003-03-07 09:44:32 +01:00
@PURPOSE@ Return list of matching fonts
@DESC@
2003-03-07 09:51:14 +01:00
Returns the list of fonts sorted by closeness to <parameter>p</parameter>. If <parameter>trim</parameter> is FcTrue,
2003-03-07 09:44:32 +01:00
elements in the list which don't include Unicode coverage not provided by
earlier elements in the list are elided. The union of Unicode coverage of
2003-03-07 09:51:14 +01:00
all of the fonts is returned in <parameter>csp</parameter>, if <parameter>csp</parameter> is not NULL. This function
2003-03-07 09:44:32 +01:00
should be called only after FcConfigSubstitute and FcDefaultSubstitute have
2003-03-07 09:51:14 +01:00
been called for <parameter>p</parameter>; otherwise the results will not be correct.
2003-03-07 09:44:32 +01:00
</para><para>
The returned FcFontSet references FcPattern structures which may be shared
by the return value from multiple FcFontSort calls, applications must not
2003-03-07 09:51:14 +01:00
modify these patterns. Instead, they should be passed, along with <parameter>p</parameter> to
2003-03-07 09:44:32 +01:00
FcFontRenderPrepare which combines them into a complete pattern.
</para><para>
The FcFontSet returned by FcFontSort is destroyed by caling FcFontSetDestroy.
@@
@RET@ FcPattern *
@FUNC@ FcFontRenderPrepare
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcPattern * @ARG2@ pat
@TYPE3@ FcPattern * @ARG3@ font
2003-03-07 09:44:32 +01:00
@PURPOSE@ Prepare pattern for loading font file
@DESC@
2003-03-07 09:51:14 +01:00
Creates a new pattern consisting of elements of <parameter>font</parameter> not appearing
in <parameter>pat</parameter>, elements of <parameter>pat</parameter> not appearing in <parameter>font</parameter> and the best matching
value from <parameter>pat</parameter> for elements appearing in both. The result is passed to
FcConfigSubstitute with <parameter>kind</parameter> FcMatchFont and then returned.
2003-03-07 09:44:32 +01:00
@@
@RET@ FcFontSet *
@FUNC@ FcFontList
2003-03-07 09:44:32 +01:00
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ FcPattern * @ARG2@ p
@TYPE3@ FcObjectSet * @ARG3@ os
2003-03-07 09:44:32 +01:00
@PURPOSE@ List fonts
@DESC@
2003-03-07 09:51:14 +01:00
Selects fonts matching <parameter>p</parameter>, creates patterns from those fonts containing
only the objects in <parameter>os</parameter> and returns the set of unique such patterns.
2003-03-07 09:44:32 +01:00
@@
@RET@ char *
@FUNC@ FcConfigFilename
@TYPE1@ const char * @ARG1@ name
2003-03-07 09:44:32 +01:00
@PURPOSE@ Find a config file
@DESC@
Given the specified external entity name, return the associated filename.
This provides applications a way to convert various configuration file
references into filename form.
2003-03-07 09:44:32 +01:00
</para><para>
2003-03-07 09:51:14 +01:00
A null or empty <parameter>name</parameter> indicates that the default configuration file should
2003-03-07 09:44:32 +01:00
be used; which file this references can be overridden with the
2003-03-07 09:51:14 +01:00
FC_CONFIG_FILE environment variable. Next, if the name starts with <parameter>~</parameter>, it
2003-03-07 09:44:32 +01:00
refers to a file in the current users home directory. Otherwise if the name
doesn't start with '/', it refers to a file in the default configuration
directory; the built-in default directory can be overridden with the
FC_CONFIG_DIR environment variable.
@@
@RET@ FcBool
@FUNC@ FcConfigParseAndLoad
@TYPE1@ FcConfig * @ARG1@ config
@TYPE2@ const FcChar8 * @ARG2@ file
@TYPE2@ FcBool @ARG3@ complain
@PURPOSE@ load a configuration file
@DESC@
Walks the configuration in 'file' and constructs the internal representation
in 'config'. Any include files referenced from within 'file' will be loaded
with FcConfigLoad and also parsed. If 'complain' is FcFalse, no warning
will be displayed if 'file' does not exist.
@@