pango-sharp 0.0.0.0 neutral Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. High-level driver for formatting entire paragraphs of text at once. While complete access to the layout capabilities of Pango is provided using the detailed interfaces for itemization and shaping, using that functionality directly involves writing a fairly large amount of code. The objects and functions in provide a high-level driver for formatting entire paragraphs of text at once. The represents and entire paragraph of text. It is initialized with a , UTF-8 string and set of attributes for that string. Once that is done, the set of formatted lines can be extracted from the object, the layout can be rendered, and conversion between logical character positions within the layout's text, and the physical position of the resulting glyphs can be made. There are also a number of parameters to adjust the formatting of a . It is possible, as well, to ignore the 2-D setup, and simply treat the results of a as a list of lines. using System; using Gtk; using Pango; class LayoutSample : DrawingArea { Pango.Layout layout; static void Main () { Application.Init (); new LayoutSample (); Application.Run (); } LayoutSample () { Window win = new Window ("Layout sample"); win.SetDefaultSize (400, 300); win.DeleteEvent += OnWinDelete; this.Realized += OnRealized; this.ExposeEvent += OnExposed; win.Add (this); win.ShowAll (); } void OnExposed (object o, ExposeEventArgs args) { this.GdkWindow.DrawLayout (this.Style.TextGC (StateType.Normal), 100, 150, layout); } void OnRealized (object o, EventArgs args) { layout = new Pango.Layout (this.PangoContext); layout.Wrap = Pango.WrapMode.Word; layout.FontDescription = FontDescription.FromString ("Tahoma 16"); layout.SetMarkup ("Hello Pango.Layout"); } void OnWinDelete (object o, DeleteEventArgs args) { Application.Quit (); } } GLib.Object GLib.IWrapper System.IDisposable Method System.Void To be added To be added: an object of type 'string' To be added Method System.Void Set the text of the layout. To be added: an object of type 'string' To be added Method Pango.LayoutLine Retrieves a particular line. the index of a line. the requested , or null if the index is out of range. To be added Method System.Void To be added To be added: an object of type 'int&' To be added: an object of type 'int&' To be added Method Pango.Layout To be added To be added: an object of type 'Pango.Layout' To be added Method System.Void To be added To be added Method System.Void Determine the logical width and height of a in device units. To be added: an object of type 'int&' To be added: an object of type 'int&' To be added Method System.Void Disposes the resources associated with the object. Constructor Internal constructor Pointer to the C object. An instance of Layout, wrapping the C object. This is an internal constructor, and should not be used by user code. Constructor Create a new PangoLayout object with attributes initialized to default values for a particular . a . a new . To be added Property System.Int32 To be added To be added: an object of type 'int' To be added Property System.Int32 Return the lines of the layout as a list. To be added: an object of type 'int' To be added: an object of type 'int' To be added Property Pango.Alignment The amount by which the first line should be shorter than the rest of the lines. the amount by which to indent. To be added: an object of type 'Pango.Alignment' The value be negative, in which case the subsequent lines will be shorter than the first line. (However, in either case, the entire width of the layout will be given by the value. Property Pango.TabArray The alignment for the layout. The new alignment. The current alignment. Specifies how partial lines are positioned within the horizontal space available. Property System.Boolean The tabs to use for the layout. the tabs to use for the layout. the current used by this layout. If no has been set, then the default tabs are in use and null is returned. By default, tabs are every 8 spaces. Setting new tabs overrides the default tabs. If Tabs is set to null, the default tabs are reinstated. Property Pango.Context Whether or not to treat newlines and similar characters as paragraph separators. To be added: an object of type 'Pango.Context' If set to true, do not treat newlines and similar characters as paragraph separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters. Used when you want to allow editing of newlines on a single text line. Property Pango.LayoutIter the used for this layout. To be added: an object of type 'Pango.LayoutIter' To be added Property Pango.AttrList An iterator to iterate over the visual extents of the layout. To be added: an object of type 'Pango.AttrList' a new . To be added Property System.Int32 To be added To be added: an object of type 'int' To be added: an object of type 'int' To be added Property System.Boolean The amount of spacing between the lines of the layout. the amount of spacing. To be added: an object of type 'bool' To be added Property System.Int32 Sets whether or not each complete line should be stretched to fill the entire width of the layout. whether the lines in the layout should be justified. To be added: an object of type 'int' This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification is done by extending the characters. Property System.String Sets the width to which the lines of the Layout should be wrapped. To be added: an object of type 'string' To be added Property Pango.WrapMode To be added To be added: an object of type 'Pango.WrapMode' To be added: an object of type 'Pango.WrapMode' To be added Property Pango.FontDescription Sets the . To be added: an object of type 'Pango.FontDescription' To be added: an object of type 'Pango.FontDescription' The wrap style only has an effect if a width is set on the layout. To turn off wrapping, set the width to -1. Method System.Void To be added a a a a a a To be added Method System.Boolean Computes a new cursor position from an old position and a count of positions to move visually. whether the moving cursor is the strong cursor or the weak cursor. The strong cursor is the cursor corresponding to text insertion in the base direction for the layout. the byte index of the grapheme for the old index. if 0, the cursor was at the trailing edge of the grapheme indicated by old_index, if > 0, the cursor was at the leading edge. direction to move cursor. A negative value indicates motion to the left. a If count is positive, then the new strong cursor position will be one position to the right of the old cursor position. If count is position then the new strong cursor position will be one position to the left of the old cursor position. In the presence of bidirection text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run. Motion here is in cursor positions, not in characters, so a single call to MoveCursorVisually() may move the cursor over multiple characters when multiple characters combine to form a single grapheme. Property GLib.GType To be added a To be added Constructor Convert from X and Y position within a layout to the byte index to the character at that logical position. the X offset from the left edge of the layout. true if the coordinates were inside text. If the position is not inside the layout, the closest position is chosen (the x/y position will be clamped inside the layout). If a closest position is chosen, then the function returns false; on an exact hit, it returns true. Property Pango.LayoutLine[] The count of lines for the layout. The count of lines for the layout. Method System.Void To be added a a To be added Method Pango.Rectangle To be added a a To be added Method System.Int32 To be added a a To be added Method System.Void Compute the logical and ink extents of layout. Rectangle used to store the extents of the layout as drawn. Rectangle used to store the logical extents of the layout. Logical extents are usually what you want for positioning things. The extents are given in layout coordinates; layout coordinates begin at the top left corner of the layout. Method System.Void To be added a a a To be added