Blame doc/fontconfig-devel/fcpatternformat.html

Packit 352660
Packit 352660
Packit 352660
>
Packit 352660
>
Packit 352660
>FcPatternFormat
Packit 352660
>
Packit 352660
NAME="GENERATOR"
Packit 352660
CONTENT="Modular DocBook HTML Stylesheet Version 1.79">
Packit 352660
REL="HOME"
Packit 352660
HREF="t1.html">
Packit 352660
REL="UP"
Packit 352660
TITLE="FcPattern"
Packit 352660
HREF="x103.html#AEN242">
Packit 352660
REL="PREVIOUS"
Packit 352660
TITLE="FcNameUnparse"
Packit 352660
HREF="fcnameunparse.html">
Packit 352660
>
Packit 352660
CLASS="REFENTRY"
Packit 352660
BGCOLOR="#FFFFFF"
Packit 352660
TEXT="#000000"
Packit 352660
LINK="#0000FF"
Packit 352660
VLINK="#840084"
Packit 352660
ALINK="#0000FF"
Packit 352660
>
Packit 352660
CLASS="NAVHEADER"
Packit 352660
>
Packit 352660
SUMMARY="Header navigation table"
Packit 352660
WIDTH="100%"
Packit 352660
BORDER="0"
Packit 352660
CELLPADDING="0"
Packit 352660
CELLSPACING="0"
Packit 352660
>
Packit 352660
>
Packit 352660
COLSPAN="3"
Packit 352660
ALIGN="center"
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="10%"
Packit 352660
ALIGN="left"
Packit 352660
VALIGN="bottom"
Packit 352660
>
Packit 352660
HREF="fcnameunparse.html"
Packit 352660
ACCESSKEY="P"
Packit 352660
><<< Previous
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="80%"
Packit 352660
ALIGN="center"
Packit 352660
VALIGN="bottom"
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="10%"
Packit 352660
ALIGN="right"
Packit 352660
VALIGN="bottom"
Packit 352660
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
ALIGN="LEFT"
Packit 352660
WIDTH="100%">
Packit 352660
>
Packit 352660
>
Packit 352660
NAME="FCPATTERNFORMAT"
Packit 352660
>
Packit 352660
>FcPatternFormat
Packit 352660
>
Packit 352660
CLASS="REFNAMEDIV"
Packit 352660
>
Packit 352660
NAME="AEN1190"
Packit 352660
>
Packit 352660
>
Packit 352660
>Name
Packit 352660
>FcPatternFormat -- Format a pattern into a string according to a format specifier
Packit 352660
>
Packit 352660
CLASS="REFSYNOPSISDIV"
Packit 352660
>
Packit 352660
NAME="AEN1193"
Packit 352660
>
Packit 352660
>
Packit 352660
>Synopsis
Packit 352660
>
Packit 352660
CLASS="FUNCSYNOPSIS"
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
NAME="AEN1194"
Packit 352660
>
Packit 352660
>
Packit 352660
BORDER="0"
Packit 352660
BGCOLOR="#E0E0E0"
Packit 352660
WIDTH="100%"
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="FUNCSYNOPSISINFO"
Packit 352660
>#include <fontconfig/fontconfig.h>
Packit 352660
	
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="FUNCDEF"
Packit 352660
>FcChar8 * 
Packit 352660
CLASS="FUNCTION"
Packit 352660
>FcPatternFormat
Packit 352660
>
Packit 352660
>(FcPattern *
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pat
Packit 352660
>
Packit 352660
>, const FcChar8 *
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>format
Packit 352660
>
Packit 352660
>);
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="REFSECT1"
Packit 352660
>
Packit 352660
NAME="AEN1203"
Packit 352660
>
Packit 352660
>
Packit 352660
>Description
Packit 352660
>
Packit 352660
>Converts given pattern 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pat
Packit 352660
>
Packit 352660
> into text described by
Packit 352660
the format specifier 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>format
Packit 352660
>
Packit 352660
>.
Packit 352660
The return value refers to newly allocated memory which should be freed by the
Packit 352660
caller using free(), or NULL if 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>format
Packit 352660
>
Packit 352660
> is invalid.
Packit 352660
>
Packit 352660
>
The format is loosely modeled after printf-style format string.
Packit 352660
The format string is composed of zero or more  directives: ordinary
Packit 352660
characters (not "%"), which are copied unchanged to the output stream;
Packit 352660
and tags which are interpreted to construct text from the pattern in a
Packit 352660
variety of ways (explained below).
Packit 352660
Special characters can be escaped
Packit 352660
using backslash.  C-string style special characters like \n and \r are
Packit 352660
also supported (this is useful when the format string is not a C string
Packit 352660
literal).
Packit 352660
It is advisable to always escape curly braces that
Packit 352660
are meant to be copied to the output as ordinary characters.
Packit 352660
>
Packit 352660
>
Each tag is introduced by the character "%",
Packit 352660
followed by an optional minimum field width,
Packit 352660
followed by tag contents in curly braces ({}).
Packit 352660
If the minimum field width value is provided the tag
Packit 352660
will be expanded and the result padded to achieve the minimum width.
Packit 352660
If the minimum field width is positive, the padding will right-align
Packit 352660
the text.  Negative field width will left-align.
Packit 352660
The rest of this section describes various supported tag contents
Packit 352660
and their expansion.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>simple
Packit 352660
> tag
Packit 352660
is one where the content is an identifier.  When simple
Packit 352660
tags are expanded, the named identifier will be looked up in
Packit 352660
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> and the resulting list of values returned,
Packit 352660
joined together using comma.  For example, to print the family name and style of the
Packit 352660
pattern, use the format "%{family} %{style}\n".  To extend the family column
Packit 352660
to forty characters use "%-40{family}%{style}\n".
Packit 352660
>
Packit 352660
>
Simple tags expand to list of all values for an element.  To only choose
Packit 352660
one of the values, one can index using the syntax "%{elt[idx]}".  For example,
Packit 352660
to get the first family name only, use "%{family[0]}".
Packit 352660
>
Packit 352660
>
If a simple tag ends with "=" and the element is found in the pattern, the
Packit 352660
name of the element followed by "=" will be output before the list of values.
Packit 352660
For example, "%{weight=}" may expand to the string "weight=80".  Or to the empty
Packit 352660
string if 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> does not have weight set.
Packit 352660
>
Packit 352660
>
If a simple tag starts with ":" and the element is found in the pattern, ":"
Packit 352660
will be printed first.  For example, combining this with the =, the format
Packit 352660
"%{:weight=}" may expand to ":weight=80" or to the empty string
Packit 352660
if 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> does not have weight set.
Packit 352660
>
Packit 352660
>
If a simple tag contains the string ":-", the rest of the the tag contents
Packit 352660
will be used as a default string.  The default string is output if the element
Packit 352660
is not found in the pattern.  For example, the format
Packit 352660
"%{:weight=:-123}" may expand to ":weight=80" or to the string
Packit 352660
":weight=123" if 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> does not have weight set.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>count
Packit 352660
> tag
Packit 352660
is one that starts with the character "#" followed by an element
Packit 352660
name, and expands to the number of values for the element in the pattern.
Packit 352660
For example, "%{#family}" expands to the number of family names
Packit 352660
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> has set, which may be zero.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>sub-expression
Packit 352660
> tag
Packit 352660
is one that expands a sub-expression.  The tag contents
Packit 352660
are the sub-expression to expand placed inside another set of curly braces.
Packit 352660
Sub-expression tags are useful for aligning an entire sub-expression, or to
Packit 352660
apply converters (explained later) to the entire sub-expression output.
Packit 352660
For example, the format "%40{{%{family} %{style}}}" expands the sub-expression
Packit 352660
to construct the family name followed by the style, then takes the entire
Packit 352660
string and pads it on the left to be at least forty characters.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>filter-out
Packit 352660
> tag
Packit 352660
is one starting with the character "-" followed by a
Packit 352660
comma-separated list of element names, followed by a sub-expression enclosed
Packit 352660
in curly braces.  The sub-expression will be expanded but with a pattern that
Packit 352660
has the listed elements removed from it.
Packit 352660
For example, the format "%{-size,pixelsize{sub-expr}}" will expand "sub-expr"
Packit 352660
with 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> sans the size and pixelsize elements.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>filter-in
Packit 352660
> tag
Packit 352660
is one starting with the character "+" followed by a
Packit 352660
comma-separated list of element names, followed by a sub-expression enclosed
Packit 352660
in curly braces.  The sub-expression will be expanded but with a pattern that
Packit 352660
only has the listed elements from the surrounding pattern.
Packit 352660
For example, the format "%{+family,familylang{sub-expr}}" will expand "sub-expr"
Packit 352660
with a sub-pattern consisting only the family and family lang elements of
Packit 352660
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
>.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>conditional
Packit 352660
> tag
Packit 352660
is one starting with the character "?" followed by a
Packit 352660
comma-separated list of element conditions, followed by two sub-expression
Packit 352660
enclosed in curly braces.  An element condition can be an element name,
Packit 352660
in which case it tests whether the element is defined in pattern, or
Packit 352660
the character "!" followed by an element name, in which case the test
Packit 352660
is negated.  The conditional passes if all the element conditions pass.
Packit 352660
The tag expands the first sub-expression if the conditional passes, and
Packit 352660
expands the second sub-expression otherwise.
Packit 352660
For example, the format "%{?size,dpi,!pixelsize{pass}{fail}}" will expand
Packit 352660
to "pass" if 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
> has size and dpi elements but
Packit 352660
no pixelsize element, and to "fail" otherwise.
Packit 352660
>
Packit 352660
>
An 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>enumerate
Packit 352660
> tag
Packit 352660
is one starting with the string "[]" followed by a
Packit 352660
comma-separated list of element names, followed by a sub-expression enclosed
Packit 352660
in curly braces.  The list of values for the named elements are walked in
Packit 352660
parallel and the sub-expression expanded each time with a pattern just having
Packit 352660
a single value for those elements, starting from the first value and
Packit 352660
continuing as long as any of those elements has a value.
Packit 352660
For example, the format "%{[]family,familylang{%{family} (%{familylang})\n}}"
Packit 352660
will expand the pattern "%{family} (%{familylang})\n" with a pattern
Packit 352660
having only the first value of the family and familylang elements, then expands
Packit 352660
it with the second values, then the third, etc.
Packit 352660
>
Packit 352660
>
As a special case, if an enumerate tag has only one element, and that element
Packit 352660
has only one value in the pattern, and that value is of type FcLangSet, the
Packit 352660
individual languages in the language set are enumerated.
Packit 352660
>
Packit 352660
>
A 
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>builtin
Packit 352660
> tag
Packit 352660
is one starting with the character "=" followed by a builtin
Packit 352660
name.  The following builtins are defined:
Packit 352660
Packit 352660
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="VARIABLELIST"
Packit 352660
>
Packit 352660
>
Packit 352660
>unparse
Packit 352660
>
Packit 352660
>
Packit 352660
>Expands to the result of calling FcNameUnparse() on the pattern.
Packit 352660
>
Packit 352660
>
Packit 352660
>fcmatch
Packit 352660
>
Packit 352660
>
Packit 352660
>Expands to the output of the default output format of the fc-match
Packit 352660
command on the pattern, without the final newline.
Packit 352660
>
Packit 352660
>
Packit 352660
>fclist
Packit 352660
>
Packit 352660
>
Packit 352660
>Expands to the output of the default output format of the fc-list
Packit 352660
command on the pattern, without the final newline.
Packit 352660
>
Packit 352660
>
Packit 352660
>fccat
Packit 352660
>
Packit 352660
>
Packit 352660
>Expands to the output of the default output format of the fc-cat
Packit 352660
command on the pattern, without the final newline.
Packit 352660
>
Packit 352660
>
Packit 352660
>pkgkit
Packit 352660
>
Packit 352660
>
Packit 352660
>Expands to the list of PackageKit font() tags for the pattern.
Packit 352660
Currently this includes tags for each family name, and each language
Packit 352660
from the pattern, enumerated and sanitized into a set of tags terminated
Packit 352660
by newline.  Package management systems can use these tags to tag their
Packit 352660
packages accordingly.
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
Packit 352660
For example, the format "%{+family,style{%{=unparse}}}\n" will expand
Packit 352660
to an unparsed name containing only the family and style element values
Packit 352660
from 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
>.
Packit 352660
>
Packit 352660
>
The contents of any tag can be followed by a set of zero or more
Packit 352660
Packit 352660
CLASS="FIRSTTERM"
Packit 352660
>converter
Packit 352660
>s.  A converter is specified by the
Packit 352660
character "|" followed by the converter name and arguments.  The
Packit 352660
following converters are defined:
Packit 352660
Packit 352660
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="VARIABLELIST"
Packit 352660
>
Packit 352660
>
Packit 352660
>basename
Packit 352660
>
Packit 352660
>
Packit 352660
>Replaces text with the results of calling FcStrBasename() on it.
Packit 352660
>
Packit 352660
>
Packit 352660
>dirname
Packit 352660
>
Packit 352660
>
Packit 352660
>Replaces text with the results of calling FcStrDirname() on it.
Packit 352660
>
Packit 352660
>
Packit 352660
>downcase
Packit 352660
>
Packit 352660
>
Packit 352660
>Replaces text with the results of calling FcStrDowncase() on it.
Packit 352660
>
Packit 352660
>
Packit 352660
>shescape
Packit 352660
>
Packit 352660
>
Packit 352660
>Escapes text for one level of shell expansion.
Packit 352660
(Escapes single-quotes, also encloses text in single-quotes.)
Packit 352660
>
Packit 352660
>
Packit 352660
>cescape
Packit 352660
>
Packit 352660
>
Packit 352660
>Escapes text such that it can be used as part of a C string literal.
Packit 352660
(Escapes backslash and double-quotes.)
Packit 352660
>
Packit 352660
>
Packit 352660
>xmlescape
Packit 352660
>
Packit 352660
>
Packit 352660
>Escapes text such that it can be used in XML and HTML.
Packit 352660
(Escapes less-than, greater-than, and ampersand.)
Packit 352660
>
Packit 352660
>
Packit 352660
>delete(
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>chars
Packit 352660
>
Packit 352660
>)
Packit 352660
>
Packit 352660
>
Packit 352660
>Deletes all occurrences of each of the characters in 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>chars
Packit 352660
>
Packit 352660
>
Packit 352660
from the text.
Packit 352660
FIXME: This converter is not UTF-8 aware yet.
Packit 352660
>
Packit 352660
>
Packit 352660
>escape(
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>chars
Packit 352660
>
Packit 352660
>)
Packit 352660
>
Packit 352660
>
Packit 352660
>Escapes all occurrences of each of the characters in 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>chars
Packit 352660
>
Packit 352660
>
Packit 352660
by prepending it by the first character in 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>chars
Packit 352660
>
Packit 352660
>.
Packit 352660
FIXME: This converter is not UTF-8 aware yet.
Packit 352660
>
Packit 352660
>
Packit 352660
>translate(
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>from
Packit 352660
>
Packit 352660
>,
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>to
Packit 352660
>
Packit 352660
>)
Packit 352660
>
Packit 352660
>
Packit 352660
>Translates all occurrences of each of the characters in 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>from
Packit 352660
>
Packit 352660
>
Packit 352660
by replacing them with their corresponding character in 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>to
Packit 352660
>
Packit 352660
>.
Packit 352660
If 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>to
Packit 352660
>
Packit 352660
> has fewer characters than
Packit 352660
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>from
Packit 352660
>
Packit 352660
>, it will be extended by repeating its last
Packit 352660
character.
Packit 352660
FIXME: This converter is not UTF-8 aware yet.
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
Packit 352660
For example, the format "%{family|downcase|delete( )}\n" will expand
Packit 352660
to the values of the family element in 
Packit 352660
CLASS="PARAMETER"
Packit 352660
>
Packit 352660
>pattern
Packit 352660
>
Packit 352660
>,
Packit 352660
lower-cased and with spaces removed.
Packit 352660
	    
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="REFSECT1"
Packit 352660
>
Packit 352660
NAME="AEN1313"
Packit 352660
>
Packit 352660
>
Packit 352660
>Since
Packit 352660
>
Packit 352660
>version 2.9.0
Packit 352660
>
Packit 352660
>
Packit 352660
CLASS="NAVFOOTER"
Packit 352660
>
Packit 352660
ALIGN="LEFT"
Packit 352660
WIDTH="100%">
Packit 352660
SUMMARY="Footer navigation table"
Packit 352660
WIDTH="100%"
Packit 352660
BORDER="0"
Packit 352660
CELLPADDING="0"
Packit 352660
CELLSPACING="0"
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="33%"
Packit 352660
ALIGN="left"
Packit 352660
VALIGN="top"
Packit 352660
>
Packit 352660
HREF="fcnameunparse.html"
Packit 352660
ACCESSKEY="P"
Packit 352660
><<< Previous
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="34%"
Packit 352660
ALIGN="center"
Packit 352660
VALIGN="top"
Packit 352660
>
Packit 352660
HREF="t1.html"
Packit 352660
ACCESSKEY="H"
Packit 352660
>Home
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="33%"
Packit 352660
ALIGN="right"
Packit 352660
VALIGN="top"
Packit 352660
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="33%"
Packit 352660
ALIGN="left"
Packit 352660
VALIGN="top"
Packit 352660
>FcNameUnparse
Packit 352660
>
Packit 352660
WIDTH="34%"
Packit 352660
ALIGN="center"
Packit 352660
VALIGN="top"
Packit 352660
>
Packit 352660
HREF="x103.html#AEN242"
Packit 352660
ACCESSKEY="U"
Packit 352660
>Up
Packit 352660
>
Packit 352660
>
Packit 352660
WIDTH="33%"
Packit 352660
ALIGN="right"
Packit 352660
VALIGN="top"
Packit 352660
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>
Packit 352660
>