Difference between revisions of "Reference:Text"

From POV-Wiki
Jump to navigation Jump to search
m (1 revision: Initial Load (TF))
 
m (clarification)
 
(5 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
{{#indexentry:keyword, ttf}}  
 
{{#indexentry:keyword, ttf}}  
 
{{#indexentry:ttf}}
 
{{#indexentry:ttf}}
<p>A <code>text</code> object creates 3-D text as an extruded block letter.
+
<p>A <code>text</code> object creates 3-D text as an extruded block letter. Currently only TrueType fonts (ttf) and TrueType Collections (ttc) are supported but the syntax allows for other font types to be added in the future. If TrueType Collections are used, the first font found in the collection will be used. The syntax is:</p>
Currently only TrueType fonts (ttf) and TrueType Collections (ttc) are supported
 
but the syntax allows for other font types to be added in the future. If TrueType Collections
 
are used, the first font found in the collection will be used. The syntax is:</p>
 
 
<pre>
 
<pre>
 
TEXT_OBECT:
 
TEXT_OBECT:
Line 19: Line 16:
 
</pre>
 
</pre>
  
<p>Where <code>fontname.ttf</code> or <code>fontname.ttc</code> is the name of the TrueType font file. It
+
<p>Where <code>fontname.ttf</code> or <code>fontname.ttc</code> is the name of the TrueType font file. It is a quoted string literal or string expression. The string expression which follows is the actual text of the string object. It too may be a quoted string literal or string expression. See section <!--<linkto "Strings">Strings</linkto>--->[[Reference:Strings|Strings]] for more on string expressions.</p>
is a quoted string literal or string expression. The string expression which
+
 
follows is the actual text of the string object. It too may be a quoted
+
<p>In version 3.7 several fonts are now <em>built-in</em>. It should be noted that this is only a preliminary solution so the benchmark program will run without installing POV-Ray. Future versions may lack this mechanism, so in scene files (other than the built-in benchmark) you should continue to reference the external font files as before. Consequently, the following <em>alternate</em> syntax is available:</p>
string literal or string expression. See section <!--<linkto "Strings">Strings</linkto>--->[[Reference:Strings|Strings]] for more
+
<pre>
on string expressions.</p>
+
TEXT_OBECT:
<p>
+
  text {
The text will start with the origin at the lower left, front of the first
+
    internal Font_Number &quot;String_of_Text&quot;
character and will extend in the +x-direction. The baseline of the text
+
    Thickness, &lt;Offset&gt;
follows the x-axis and descender drop into the -y-direction. The front of the
+
    [OBJECT_MODIFIERS] }
character sits in the x-y-plane and the text is extruded in the +z-direction.
+
    }
The front-to-back thickness is specified by the required value <em><code>
+
</pre>
 +
 
 +
<p>Where <code><em>Font_Number</em></code> is one of the <em>integer</em> values from the list below:</p>
 +
<ol start=0>
 +
  <li>povlogo.ttf</li>
 +
  <li>timrom.ttf</li>
 +
  <li>cyrvetic.ttf</li>
 +
  <li>crystal.ttf</li>
 +
</ol>
 +
 
 +
<p class="Note"><strong>Note:</strong> An out of range <code><em>Font_Number</em></code> value will default to 0.</p>
 +
 
 +
<p>The text will start with the origin at the lower left, front of the first character and will extend in the +x-direction. The baseline of the text follows the x-axis and descender drop into the -y-direction. The front of the character sits in the x-y-plane and the text is extruded in the +z-direction. The front-to-back thickness is specified by the required value <em><code>
 
Thickness</code></em>.</p>
 
Thickness</code></em>.</p>
<p>
+
 
Characters are generally sized so that 1 unit of vertical spacing is
+
<p>Characters are generally sized so that 1 unit of vertical spacing is correct. The characters are about 0.5 to 0.75 units tall.</p>
correct. The characters are about 0.5 to 0.75 units tall.</p>
+
 
<p>
+
<p>The horizontal spacing is handled by POV-Ray internally including any kerning information stored in the font. The required vector <em><code>&lt;Offset&gt;</code></em> defines any extra translation between each character. Normally you should specify a zero for this value. Specifying <code>0.1*x</code> would put additional 0.1 units of space between each character. Here is an example:</p>
The horizontal spacing is handled by POV-Ray internally including any kerning
 
information stored in the font. The required vector <em><code>
 
&lt;Offset&gt;</code></em> defines any extra translation between each
 
character. Normally you should specify a zero for this value. Specifying
 
<code>0.1*x</code> would put additional 0.1 units of space between each
 
character. Here is an example:</p>
 
 
<pre>
 
<pre>
 
text {
 
text {
Line 48: Line 51:
 
</pre>
 
</pre>
  
<p>Only printable characters are allowed in text objects. Characters such as
+
<p>Only printable characters are allowed in text objects. Characters such as return, line feed, tabs, backspace etc. are not supported.</p>
return, line feed, tabs, backspace etc. are not supported.</p>
 
  
<p>For easy access to your fonts, set the [[Reference:Scene_Parsing_Options#Library_Paths|:Library_Path|Library_Path]]
+
<p>For easy access to your fonts, set the [[Reference:Scene Parsing Options#Library Paths|:Library_Path|Library_Path]] to the directory that contains your font collection.</p>
to the directory that contains your font collection.</p>
 

Latest revision as of 16:15, 29 December 2012

A text object creates 3-D text as an extruded block letter. Currently only TrueType fonts (ttf) and TrueType Collections (ttc) are supported but the syntax allows for other font types to be added in the future. If TrueType Collections are used, the first font found in the collection will be used. The syntax is:

TEXT_OBECT:
  text {
    ttf "fontname.ttf/ttc" "String_of_Text"
    Thickness, <Offset>
    [OBJECT_MODIFIERS...]
    }

Where fontname.ttf or fontname.ttc is the name of the TrueType font file. It is a quoted string literal or string expression. The string expression which follows is the actual text of the string object. It too may be a quoted string literal or string expression. See section Strings for more on string expressions.

In version 3.7 several fonts are now built-in. It should be noted that this is only a preliminary solution so the benchmark program will run without installing POV-Ray. Future versions may lack this mechanism, so in scene files (other than the built-in benchmark) you should continue to reference the external font files as before. Consequently, the following alternate syntax is available:

TEXT_OBECT:
  text {
    internal Font_Number "String_of_Text"
    Thickness, <Offset>
    [OBJECT_MODIFIERS] }
    }

Where Font_Number is one of the integer values from the list below:

  1. povlogo.ttf
  2. timrom.ttf
  3. cyrvetic.ttf
  4. crystal.ttf

Note: An out of range Font_Number value will default to 0.

The text will start with the origin at the lower left, front of the first character and will extend in the +x-direction. The baseline of the text follows the x-axis and descender drop into the -y-direction. The front of the character sits in the x-y-plane and the text is extruded in the +z-direction. The front-to-back thickness is specified by the required value Thickness.

Characters are generally sized so that 1 unit of vertical spacing is correct. The characters are about 0.5 to 0.75 units tall.

The horizontal spacing is handled by POV-Ray internally including any kerning information stored in the font. The required vector <Offset> defines any extra translation between each character. Normally you should specify a zero for this value. Specifying 0.1*x would put additional 0.1 units of space between each character. Here is an example:

text {
  ttf "timrom.ttf" "POV-Ray" 1, 0
  pigment { Red }
  }

Only printable characters are allowed in text objects. Characters such as return, line feed, tabs, backspace etc. are not supported.

For easy access to your fonts, set the Library_Path to the directory that contains your font collection.