Skip to content
This repository
Browse code

latest version

  • Loading branch information...
commit fc02c6beae8409333d81b7659e198df6b1502b7f 1 parent 6908048
rmagick authored

Showing 1 changed file with 84 additions and 6 deletions. Show diff stats Hide diff stats

  1. +84 6 doc/rvgtext.html
90 doc/rvgtext.html
@@ -21,7 +21,13 @@
21 21 </script>
22 22 <style type="text/css">
23 23 /*<![CDATA[*/
24   - }
  24 + .styles_header h3 {
  25 + background-color: #c0c0c0;
  26 + width:100%;
  27 + color: #000;
  28 + margin-top: 0;
  29 + }
  30 +
25 31 /*]]>*/
26 32 </style>
27 33 </head>
@@ -73,14 +79,10 @@ <h6 id="header">RMagick User's Guide and Reference</h6>
73 79 <div class="toccol">
74 80 <ul>
75 81 <li><a href="#basic">basic styles</a></li>
76   - </ul>
77   - </div>
78   -
79   - <div class="toccol">
80   - <ul>
81 82 <li><a href="#advanced">advanced styles</a></li>
82 83 </ul>
83 84 </div>
  85 +
84 86 </div>
85 87 </div>
86 88
@@ -94,6 +96,30 @@ <h3 id="new">new</h3>
94 96 <span class="arg">{ |text| ...}</span> ] -&gt; aText</p>
95 97 </div>
96 98
  99 + <div class="desc">
  100 + <h4>Description</h4>
  101 + <p>This method is usually invoked indirectly via the text method in the <a href="rvgclip.html#new">RVG::ClipPath</a>, <a href="rvggroup.html#new">RVG::Group</a>, <a href="rvgpattern.html#new">RVG::Pattern</a>, and <a href="rvg.html#new">RVG</a> classes.</p>
  102 + <p>Text objects are containers, so this method yields to a block if one is present. A text object can contain <a href="rvgtspan.html#new">RVG::Tspan</a> objects that are added directly via <a href="#tspan">tspan</a>, or indirectly via <a href="#tref">tref</a>.</p>
  103 + <h4>Arguments</h4>
  104 + <p>All arguments are optional. You can
  105 + omit all the arguments when you just want to use the <code>text</code> object as a container for <code>tspans</code>.</p>
  106 + <dl>
  107 + <dt>x, y</dt>
  108 + <dd>The [x, y] coordinate of the initial text position within the current user coordinate system. If omitted the default is [0, 0]. </dd>
  109 + <dt>text</dt>
  110 + <dd>A string. If present, this string is drawn at the initial text position. If omitted, only the initial text position is established.
  111 + By default the string is positioned with the lower-left corner of the first glyph at [x, y]. Use the <a href="#text_anchor">:text_anchor</a> style
  112 + to override this behavior.</dd>
  113 + </dl>
  114 + <h4>Example</h4>
  115 + <p><a href=
  116 + "javascript:popup('text01.rb.html')"><img src=
  117 + "ex/text01.gif" title=
  118 + "Click to see the example script" alt=
  119 + "preserve_aspect_ratio example" /></a></p>
  120 +
  121 + </div>
  122 +
97 123 <h2 class="methods">instance methods</h2>
98 124
99 125 <div class='sig'>
@@ -130,6 +156,58 @@ <h3 id='tspan'>tspan</h3>
130 156 </div>
131 157
132 158 <h2 class="methods">text styles</h2>
  159 + <div class="styles_header">
  160 + <h3 id="basic">basic styles</h3>
  161 + </div>
  162 + <div class="desc">
  163 + <h4>Description</h4>
  164 + <p>The basic styles include font styles and text styles. Note that &times;Magick uses the font styles to select a font from the available fonts. If it cannot find a font that exactly matches it will use the closest matching font. Unlike MS Windows, &times;Magick will <em>not</em> alter a font - by artificially slanting it to to simulate italics, for example - to produce a match.</p>
  165 + <h4>Styles</h4>
  166 + <dl>
  167 + <dt>:font</dt>
  168 + <dd>font name or font file name, such as "C:/Windows/Fonts/Arial.ttf" or "pfb:-urw-helvetica-medium-o-condensed--0-0-0-0-p-0-iso10646-1"</dd>
  169 + <dt>:font_family</dt>
  170 + <dd>font family name, such as "serif" or "courier"</dd>
  171 + <dt>:font_size</dt>
  172 + <dd>the font size in points</dd>
  173 + <dt>:font_stretch</dt>
  174 + <dd>one of the following strings: 'normal', 'ultra_condensed', 'extra_condensed', 'condensed', 'semi_condensed', 'semi_expanded', 'expanded', 'extra_expanded', 'ultra_expanded'</dd>
  175 + <dt>:font_style</dt>
  176 + <dd>one of the following strings: 'normal', 'italic', 'oblique'</dd>
  177 + <dt>:font_weight</dt>
  178 + <dd>one of the following strings: 'normal', 'bold', 'bolder', 'lighter', or a multiple of 100 between 100 and 900</dd>
  179 + <dt id='text_anchor'>:text_anchor</dt>
  180 + <dd>one of the following strings: 'start', 'middle', 'end'</dd>
  181 + <dt>:text_decoration</dt>
  182 + <dd>one of the following strings: 'none', 'underline', 'overline', 'line_through'</dd>
  183 + </dl>
  184 + <h4>Examples</h4>
  185 + </div>
  186 + <div class="styles_header">
  187 + <h3 id="advanced">advanced styles</h3>
  188 + <div class="desc">
  189 + <h4>Description</h4>
  190 + <p>Unlike the basic styles, these styles are emulated by RVG. Consequently any use of a non-default value for one of these styles will probably cause your script to slow down noticeably. If you specify an invalid value for any of these styles RVG ignores the value and uses the default. RVG frequently uses approximate measurements to emulate these styles so the results will not be as precise as when &times;Magick is doing the work.</p>
  191 + <h4>Styles</h4>
  192 + <dl>
  193 + <dt>:writing_mode</dt>
  194 + <dd>There are two possible values for :writing_mode, 'lr' for left-to-right (most Latin-based documents) and 'tb' for top-to-bottom (or vertical) text such as for column labels. The default is 'lr'.</dd>
  195 + <dt>:baseline_shift</dt>
  196 + <dd>Adjusts the baseline. There are five possible values: 'baseline' (the default), 'super', 'sub', a percentage specified as 'NN%', or a number. For the last two choices, positive numbers move the baseline upward. The percentage is a percentage of the line height.</dd>
  197 + <dt>:letter_spacing</dt>
  198 + <dd>Specifies an amount of space to be added between each letter. The default is 0.</dd>
  199 + <dt>:word_spacing</dt>
  200 + <dd>Specifies an amount of space to be added between each word. This amount is added for each blank between words, so if the words are separated by two blanks, for example, then twice the additional space is added. The default is 0.</dd>
  201 + <dd>RVG uses this statement to separate words: <strong>words = text.split(::Magick::RVG::WORD_SEP)
  202 +</strong>You can change the regular expression that RVG uses to determine word breaks by assigning a new value to the <code>::Magick::RVG::WORD_SEP</code> constant. By default the value of <code>::Magick::RVG::WORD_SEP</code> is <code>/ /</code>.</dd>
  203 + <dt>:glyph_orientation_vertical</dt>
  204 + <dd>Applies only when :writing_mode='tb'. This style can have one of four values: 0, 90, 180, 270. The default is 90. This style specifies a rotation on each glyph. With the default value, each glyph is rotated 90 degrees. When :glyph_orientation_vertical=0 each glyph appears in its "normal" (upright) orientation.</dd>
  205 + <dt>:glyph_orientation_horizontal</dt>
  206 + <dd>Applies only when :writing_mode='lr'. This style can have one of four values: 0, 90, 180, 270. The default is 0. This style specifies a rotation on each glyph. With the default value, each glyph appears in its "normal" (upright) orientation.</dd>
  207 + </dl>
  208 + <h4>Examples</h4>
  209 + </div>
  210 + </div>
133 211
134 212 <p class="spacer">&nbsp;</p>
135 213

0 comments on commit fc02c6b

Please sign in to comment.
Something went wrong with that request. Please try again.