Fix more warnings.
[platform/upstream/fontconfig.git] / doc / fontconfig-user.sgml
index c6ab856..c842371 100644 (file)
@@ -112,7 +112,7 @@ convenience for the applications' rendering mechanism.
   hintstyle       Int     Automatic hinting style
   verticallayout  Bool    Use vertical layout
   autohint        Bool    Use autohinter instead of normal hinter
-  globaladvance   Bool    Use font global advance data
+  globaladvance   Bool    Use font global advance data (deprecated)
   file            String  The filename holding the font
   index           Int     The index of the font within the file
   ftface          FT_Face Use the specified FreeType face object
@@ -434,8 +434,9 @@ zero for purely fractional values (e.g. use 0.5 instead of .5 and -0.5
 instead of -.5).
   </para></refsect2>
   <refsect2><title><literal>&lt;matrix&gt;</literal></title><para>
-This element holds the four <literal>&lt;double&gt;</literal> elements of an affine
-transformation.
+This element holds four numerical expressions of an affine transformation.
+At their simplest these will be four <literal>&lt;double&gt;</literal> elements
+but they can also be more involved expressions.
   </para></refsect2>
   <refsect2><title><literal>&lt;range&gt;</literal></title><para>
 This element holds the two <literal>&lt;int&gt;</literal> elements of a range
@@ -451,7 +452,12 @@ a RFC-3066-style languages or more.
   </para></refsect2>
   <refsect2><title><literal>&lt;name&gt;</literal></title><para>
 Holds a property name.  Evaluates to the first value from the property of
-the font, not the pattern.
+the pattern.  If the 'target' attribute is not present, it will default to
+'default', in which case the property is returned from the font pattern
+during a target="font" match, and to the pattern during a target="pattern"
+match.  The attribute can also take the values 'font' or 'pattern' to
+explicitly choose which pattern to use.  It is an error to use a target
+of 'font' in a match that has target="pattern".
   </para></refsect2>
   <refsect2><title><literal>&lt;const&gt;</literal></title><para>
 Holds the name of a constant; these are always integers and serve as
@@ -627,6 +633,29 @@ This is an example of a system-wide configuration file
        &lt;family&gt;monospace&lt;/family&gt;
        &lt;prefer&gt;&lt;family&gt;Andale Mono&lt;/family&gt;&lt;/prefer&gt;
 &lt;/alias&gt;
+
+&lt;--
+       The example of the requirements of OR operator;
+       If the 'family' contains 'Courier New' OR 'Courier'
+       add 'monospace' as the alternative
+--&gt;
+&lt;match target="pattern"&gt;
+       &lt;test name="family" mode="eq"&gt;
+               &lt;string&gt;Courier New&lt;/string&gt;
+       &lt;/test&gt;
+       &lt;edit name="family" mode="prepend"&gt;
+               &lt;string&gt;monospace&lt;/string&gt;
+       &lt;/edit&gt;
+&lt;/match&gt;
+&lt;match target="pattern"&gt;
+       &lt;test name="family" mode="eq"&gt;
+               &lt;string&gt;Courier&lt;/string&gt;
+       &lt;/test&gt;
+       &lt;edit name="family" mode="prepend"&gt;
+               &lt;string&gt;monospace&lt;/string&gt;
+       &lt;/edit&gt;
+&lt;/match&gt;
+
 &lt;/fontconfig&gt;
     </programlisting>
   </refsect2>
@@ -654,6 +683,41 @@ $XDG_CONFIG_HOME/fontconfig/fonts.conf
 &lt;match target="font"&gt;
        &lt;edit name="rgba" mode="assign"&gt;&lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
 &lt;/match&gt;
+&lt;!--
+       use WenQuanYi Zen Hei font when serif is requested for Chinese
+--&gt;
+&lt;match&gt;
+       &lt;!--
+               If you don't want to use WenQuanYi Zen Hei font for zh-tw etc,
+               you can use zh-cn instead of zh.
+               Please note, even if you set zh-cn, it still matches zh.
+               if you don't like it, you can use compare="eq"
+               instead of compare="contains".
+       --&gt;
+       &lt;test name="lang" compare="contains"&gt;
+               &lt;string&gt;zh&lt;/string&gt;
+       &lt;/test&gt;
+       &lt;test name="family"&gt;
+               &lt;string&gt;serif&lt;/string&gt;
+       &lt;/test&gt;
+       &lt;edit name="family" mode="prepend"&gt;
+               &lt;string&gt;WenQuanYi Zen Hei&lt;/string&gt;
+       &lt;/edit&gt;
+&lt;/match&gt;
+&lt;!--
+       use VL Gothic font when sans-serif is requested for Japanese
+--&gt;
+&lt;match&gt;
+       &lt;test name="lang" compare="contains"&gt;
+               &lt;string&gt;ja&lt;/string&gt;
+       &lt;/test&gt;
+       &lt;test name="family"&gt;
+               &lt;string&gt;sans-serif&lt;/string&gt;
+       &lt;/test&gt;
+       &lt;edit name="family" mode="prepend"&gt;
+               &lt;string&gt;VL Gothic&lt;/string&gt;
+       &lt;/edit&gt;
+&lt;/match&gt;
 &lt;/fontconfig&gt;
     </programlisting>
   </refsect2>