<?xml version="1.0" encoding="utf-8"?><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rx="http://www.renderx.com/XSL/Extensions">
<!-- ============================================================ -->
<!--                                                              -->
<!-- 	This file makes a part of RenderX XSL Test Suite          -->
<!--                                                              -->
<!--    Author: Alexander Peshkov                                 -->
<!--                                                              -->
<!--    (c) RenderX, 2003                                         -->
<!--                                                              -->
<!-- ============================================================ --><fo:layout-master-set><fo:simple-page-master master-name="document-master" margin="0.4in"><fo:region-body margin="20pt" padding="0pt"/></fo:simple-page-master></fo:layout-master-set><fo:page-sequence master-reference="document-master"><fo:flow flow-name="xsl-region-body" padding="6pt">
   
  <fo:block font="bold 16pt Helvetica" space-before="16pt" space-after="16pt" text-align="center" span="all">Using <fo:wrapper font-family="monospace">character-by-character</fo:wrapper> value of <fo:wrapper font-family="monospace">font-selection-strategy</fo:wrapper> attribute</fo:block>
  <fo:block font-size="12pt" space-before="6pt" space-after="6pt" text-align="justify" text-indent="16pt">
    Often you need to compose text blocks whith several language mixed together or with use of special characters.
    It these cases there might be necesary to render such a block using multiple different fonts since
    neither of them have all required glyphs. XSL FO provides special property <fo:wrapper font-family="monospace">font-selection-strategy</fo:wrapper>
    that targets this problem togher with <fo:wrapper font-family="monospace">font-family</fo:wrapper> property.
	<fo:block font-size="12pt" font-style="italic" space-before="6pt" space-after="6pt">
      <fo:basic-link external-destination="url(http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#font-family)" color="#0000C0" text-decoration="underline">XSL FO Recommendation, Chapter 7.8.2 "font-family"</fo:basic-link>
    </fo:block>    
	<fo:block font-size="12pt" font-style="italic" space-before="6pt" space-after="6pt">
      <fo:basic-link external-destination="url(http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#font-selection-strategy)" color="#0000C0" text-decoration="underline">XSL FO Recommendation, Chapter 7.8.3 "font-selection-strategy"</fo:basic-link>
    </fo:block>
    The <fo:wrapper font-family="monospace">font-family</fo:wrapper> property allows you to specify several font families (separated by comma)
    and <fo:wrapper font-family="monospace">font-selection-strategy</fo:wrapper> defines how these fonts will by applied by rendering engine.
    When <fo:wrapper font-family="monospace">font-selection-strategy</fo:wrapper> is set to <fo:wrapper font-family="monospace">character-by-character</fo:wrapper>,
    formatter will trigger font selection process for every character rendered.
  </fo:block>
  <fo:block font-size="12pt" space-before="6pt" space-after="6pt" text-align="justify" text-indent="16pt">
    Consider following example:
    <fo:block white-space="pre" font-family="monospace">
      &lt;fo:block font-size="24pt"
                font-family="Courier, ArialMT"
                font-selection-strategy="character-by-character"&gt;
        &amp;#1072;&amp;#1073;ABC&amp;#1074;
      &lt;/fo:block&gt;
    </fo:block>
    First, second and sixth characters are Russian, the rest are basic Latin characters.
    Font Courier has glyps only for Latin characters, while ArialMT covers both Latin and Russian.
    In this example formatter will look through all fonts in order to find one that has appropriate glyph.
    This process will be repeated for every character no metter which font was selected on previous step.
    Thus characters 3, 4 and 5 will be rendered using Courier and characters 1, 2 and 6 will be
    rendered using ArialMT:
  </fo:block>
  <fo:block font-selection-strategy="character-by-character" font-family="Courier, ArialMT" font-size="24pt">
    абABCв
  </fo:block>
  <fo:block font-size="12pt" space-before="6pt" space-after="6pt" text-align="justify" text-indent="16pt">
    If we replace <fo:wrapper font-family="monospace">font-selection-strategy="character-by-character"</fo:wrapper> with 
    <fo:wrapper font-family="monospace">font-selection-strategy="auto"</fo:wrapper> in the example above,
    formatter will restart font selecting process only when previously selected font has no required glyph.
    In such a case all six characters will be rendered using ArialMT font as shown below:
  </fo:block>
  <fo:block font-selection-strategy="auto" font-family="Courier, ArialMT" font-size="24pt">
    абABCв
  </fo:block>
</fo:flow></fo:page-sequence></fo:root>