JezK
Edit File: text-i.ri
U:RDoc::AnyMethod[iI" text:EFI"Prawn::Text#text;FF:publico:RDoc::Markup::Document:@parts["o:RDoc::Markup::Paragraph; [ I"NIf you want text to flow onto a new page or between columns, this is the ;TI"Nmethod to use. If, instead, if you want to place bounded text outside of ;TI"Pthe flow of a document (for captions, labels, charts, etc.), use Text::Box ;TI"(or its convenience method text_box.;To:RDoc::Markup::BlankLine o; ; [I"PDraws text on the page. Prawn attempts to wrap the text to fit within your ;TI"Lcurrent bounding box (or margin_box if no bounding box is being used). ;TI"IText will flow onto the next page when it reaches the bottom of the ;TI"Mbounding box. Text wrap in Prawn does not re-flow linebreaks, so if you ;TI"Kwant fully automated text wrapping, be sure to remove newlines before ;TI"$attempting to draw your string.;T@S:RDoc::Markup::Heading: leveli: textI" Examples;T@o:RDoc::Markup::Verbatim; [ I"Kpdf.text "Will be wrapped when it hits the edge of your bounding box" ;TI"9pdf.text "This will be centered", :align => :center ;TI"=pdf.text "This will be right aligned", :align => :right ;TI"Fpdf.text "This <i>includes <b>inline</b></i> <font size='24'>" + ;TI": "formatting</font>", :inline_format => true ;T:@format0o; ; [ I"GIf your font contains kerning pair data that Prawn can parse, the ;TI"Jtext will be kerned by default. You can disable kerning by including ;TI"La false <tt>:kerning</tt> option. If you want to disable kerning on an ;TI"Centire document, set default_kerning = false for that document;T@S;; i;I"Text Positioning Details;T@o; ; [I"AThe text is positioned at font.ascender below the baseline, ;TI"Gmaking it easy to use this method within bounding boxes and spans.;T@S;; i;I" Encoding;T@o; ; [I"KNote that strings passed to this function should be encoded as UTF-8. ;TI"KIf you get unexpected characters appearing in your rendered document, ;TI"check this.;T@o; ; [I"HIf the current font is a built-in one, although the string must be ;TI"Eencoded as UTF-8, only characters that are available in WinAnsi ;TI"are allowed.;T@o; ; [I"JIf an empty box is rendered to your PDF instead of the character you ;TI"Mwanted it usually means the current font doesn't include that character.;T@S;; i;I"*Options (default values marked in []);T@o:RDoc::Markup::List: @type: NOTE:@items[o:RDoc::Markup::ListItem:@label[I"<tt>:inline_format</tt>;T; [o; ; [I"I<tt>boolean</tt>. If true, then the string parameter is interpreted ;TI"?as a HTML-esque string that recognizes the following tags ;TI"3(assuming the default text formatter is used):;To;;;;[o;;[I"<tt>\<b></b></tt>;T; [o; ; [I" bold;To;;[I"<tt>\<i></i></tt>;T; [o; ; [I"italic;To;;[I"<tt>\<u></u></tt>;T; [o; ; [I"underline;To;;[I".<tt>\<strikethrough></strikethrough></tt>;T; [o; ; [I"strikethrough;To;;[I"<tt>\<sub></sub></tt>;T; [o; ; [I"subscript;To;;[I"<tt>\<sup></sup></tt>;T; [o; ; [I"superscript;To;;[I"<tt>\<font></font></tt>;T; [o; ; [I"Bwith the following attributes (using double or single quotes);To;; [ I"<tt>size="24"</tt>:: ;TI"$ attribute for setting size ;TI"(<tt>character_spacing="2.5"</tt>:: ;TI"1 attribute for setting character spacing ;TI"!<tt>name="Helvetica"</tt>:: ;TI"B attribute for setting the font. The font name must be an ;TI"C AFM font with the desired faces or must be a font that is ;TI"@ already registered using Prawn::Document#font_families ;T;0o;;[I"<tt>\<color></color></tt>;T; [o; ; [I""with the following attributes;To;; [I".<tt>rgb="ffffff" or rgb="#ffffff"</tt>:: ;TI"0<tt>c="100" m="100" y="100" k="100"</tt>:: ;T;0o;;[I"<tt>\<link></link></tt>;T; [ o; ; [I""with the following attributes;To;; [I";<tt>href="http://example.com"</tt>:: an external link ;T;0o; ; [I"ANote that you must explicitly underline and color using the ;TI"@appropriate tags if you which to draw attention to the link;T@o;;[I"<tt>:kerning</tt>;T; [o; ; [I"<<tt>boolean</tt>. Whether or not to use kerning (if it ;TI"(is available with the current font);To;;: LABEL;[o;;[I"'value of document.default_kerning?;T; [@o;;[I"<tt>:size</tt>;T; [o; ; [I":<tt>number</tt>. The font size to use. [current font ;TI" size];To;;[I"<tt>:color</tt>;T; [o; ; [I"<an RGB color ("ff0000") or CMYK array [10, 20, 30, 40].;To;;[I" <tt>:character_spacing</tt>;T; [o; ; [I"1<tt>number</tt>. The amount of space to add ;TI"-to or remove from the default character ;TI"spacing. [0];To;;[I"<tt>:style</tt>;T; [o; ; [I";The style to use. The requested style must be part of ;TI".the current font familly. [current style];To;;[I" <tt>:indent_paragraphs</tt>;T; [o; ; [I"/<tt>number</tt>. The amount to indent the ;TI"-first line of each paragraph. Omit this ;TI")option if you do not want indenting.;To;;[I"<tt>:direction</tt>;T; [o; ; [I"H<tt>:ltr</tt>, <tt>:rtl</tt>, Direction of the text (left-to-right ;TI"9or right-to-left) [value of document.text_direction];To;;[I"<tt>:fallback_fonts</tt>;T; [o; ; [I"JAn array of font names. Each name must be the name of an AFM font or ;TI"Cthe name that was used to register a family of TTF fonts (see ;TI"IPrawn::Document#font_families). If present, then each glyph will be ;TI"Jrendered using the first font that includes the glyph, starting with ;TI"Cthe current font and then moving through :fallback_fonts from ;TI"left to right.;To;;[I"<tt>:align</tt>;T; [o; ; [I";<tt>:left</tt>, <tt>:center</tt>, <tt>:right</tt>, or ;TI"8<tt>:justify</tt> Alignment within the bounding box;To;;;;[o;;[I"<:left if direction is :ltr, :right if direction is :rtl;T; [@o;;[I"<tt>:valign</tt>;T; [o; ; [I";<tt>:top</tt>, <tt>:center</tt>, or <tt>:bottom</tt>. ;TI"6Vertical alignment within the bounding box [:top];To;;[I"<tt>:leading</tt>;T; [o; ; [I"?<tt>number</tt>. Additional space between lines [value of ;TI"document.default_leading];To;;[I"<tt>:final_gap</tt>;T; [o; ; [ I"7<tt>boolean</tt>. If true, then the space between ;TI"0each line is included below the last line; ;TI"4otherwise, document.y is placed just below the ;TI".descender of the last line printed [true];To;;[I"<tt>:mode</tt>;T; [o; ; [ I"@The text rendering mode to use. Use this to specify if the ;TI"=text should render with the fill color, stroke color or ;TI"<both. See the comments to text_rendering_mode() to see ;TI"!a list of valid options. [0];T@S;; i;I"Exceptions;T@o; ; [I"BRaises <tt>ArgumentError</tt> if <tt>:at</tt> option included;T@o; ; [I"KRaises <tt>Prawn::Errrors::CannotFit</tt> if not wide enough to print ;TI" any text;T: @fileI"lib/prawn/text.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(string, options = {});T@#FI" Text;FcRDoc::NormalModule00