<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>xlfont</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="xlfont"> load a font in the graphic context or query loaded font</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>xlfont(font-name,font-id)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>fonts=xlfont()  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>font-name</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: string, name of the font family.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>font-id</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: integer between 0 and 10.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>fonts</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: a column vector of currently loaded font names.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Without any argument, <VERB>xlfont()</VERB> returns the list of
    currently loaded fonts.
    </P>
    <P>
    With arguments, <VERB>xlfont</VERB> is used to load a new font at different sizes 
    in the graphics context. The font must be available with size 8, 10, 12, 14, 18 and 24.
    </P>
    <P>
    Default fonts are &quot;Courier Roman&quot; (0), &quot;Symbol&quot; (1), &quot;Times Roman&quot; 
    (2), &quot;Times Italic&quot; (3), &quot;Times Bold&quot; (4), &quot;Times Bold Italic&quot; 
    (5), &quot;Helvetica&quot; (6), &quot;Helvetica Oblique&quot; (7), &quot;Helvetica Bold&quot; 
    (8), &quot;Helvetica Bold Oblique&quot; (9). These default fonts are automaticaly loaded
    when needed and so <VERB>xlfont</VERB> is not really required for them. In fact 
    <VERB>xlfont</VERB> is essentially useful to load a new font.
    </P>
    <P>
    font-name can be of 2 types:
    </P>
    <DESCRIPTION_INDENT>
      <DESCRIPTION_ITEM label="-">
        <SP> if it contains the character &quot;%&quot;, it is supposed to be an  X11 font name 
            with %s in the size field of the name, for example 
            <VERB>&quot;-b&amp;h-lucidabright-demibold-r-normal--%s-*-75-75-p-*-iso8859-1&quot;</VERB>
        </SP>
      </DESCRIPTION_ITEM>
      <DESCRIPTION_ITEM label="-">
        <SP> if it does not contain the character &quot;%&quot;, it is supposed  to be an alias 
            name and the fonts aliased by <VERB>font-name08,...,font-name24</VERB> are loaded.
        </SP>
      </DESCRIPTION_ITEM>
      <DESCRIPTION_ITEM label="font-id">
        <SP>: give the id <VERB>font-id</VERB> to the loaded font <VERB>font-name</VERB>.</SP>
      </DESCRIPTION_ITEM>
    </DESCRIPTION_INDENT>
    <P>
       Currently this load font feature works only for screen drivers and not for others
       (Postscript, Fig, Gif, PPM). If you export a graphical screen output in Postscript,
       Fig, Gif or PPM while you have previously loaded a new font, the behavior depends of
       the choice of the identifier <VERB>font-id</VERB> for the loaded font :
    </P>
    <DESCRIPTION_INDENT>
      <DESCRIPTION_ITEM label="-"> <SP>if <VERB>font-id=10</VERB> then the strings (drawn
        with this font) will be drawn with the default font (Times) at the same size;</SP>
      </DESCRIPTION_ITEM>
      <DESCRIPTION_ITEM label="-"> <SP>else the strings will be drawn with the default font
        corresponding to <VERB>font-id</VERB>.</SP>
      </DESCRIPTION_ITEM>
    </DESCRIPTION_INDENT>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
// Caution : this example may not work if your system have not
//           the schoolbook bold font 
if MSDOS then
   xlfont("Century Schoolbook Bold",10)
else
   xlfont("-adobe-new century schoolbook-bold-r-normal-*-%s-*-75-75-*-*-iso8859-1",10)
end
xset("font", 10, 4) // use Schoolbook bold at 18 pts
plot2d()
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM><LINK>xset</LINK></SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM><LINK>getfont</LINK></SEE_ALSO_ITEM>
  </SEE_ALSO>
  <AUTHOR>J.Ph.C.  </AUTHOR>
</MAN>
