Example #1
0
 // TextLayoutOptions => uiDrawTextLayoutParams
 public static uiDrawTextLayoutParams ToLibuiDrawTextLayoutParams(this TextLayoutOptions o) => new uiDrawTextLayoutParams()
 {
     String      = o.Text.Handle.DangerousGetHandle(),
     DefaultFont = ToLibuiFontDescriptor(o.DefaultFont),
     Width       = o.Width,
     Align       = (uiDrawTextAlign)o.Alignment
 };
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, String initialLayoutStyle)
     : this(font, width, height, flags, options, UltravioletFontStyle.Regular, initialLayoutStyle)
 {
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="fontStyle">The initial font style.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, UltravioletFontStyle fontStyle)
     : this(font, width, height, flags, options, fontStyle, null)
 {
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="fontStyle">The initial font style.</param>
 /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, UltravioletFontStyle fontStyle, String initialLayoutStyle)
 {
     this.font               = font;
     this.width              = width;
     this.height             = height;
     this.flags              = (flags == 0) ? TextFlags.Standard : flags;
     this.style              = fontStyle;
     this.options            = options;
     this.initialLayoutStyle = initialLayoutStyle;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="fontStyle">The initial font style.</param>
 public TextLayoutSettings(SpriteFont font, Int32? width, Int32? height, TextFlags flags, TextLayoutOptions options, SpriteFontStyle fontStyle)
     : this(font, width, height, flags, options, fontStyle, null)
 {
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 public TextLayoutSettings(SpriteFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options)
     : this(font, width, height, flags, options, SpriteFontStyle.Regular)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
 public TextLayoutSettings(SpriteFont font, Int32? width, Int32? height, TextFlags flags, TextLayoutOptions options, String initialLayoutStyle)
     : this(font, width, height, flags, options, SpriteFontStyle.Regular, initialLayoutStyle)
 {
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="fontStyle">The initial font style.</param>
 /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
 public TextLayoutSettings(SpriteFont font, Int32? width, Int32? height, TextFlags flags, TextLayoutOptions options, SpriteFontStyle fontStyle, String initialLayoutStyle)
 {
     this.font = font;
     this.width = width;
     this.height = height;
     this.flags = (flags == 0) ? TextFlags.Standard : flags;
     this.style = fontStyle;
     this.options = options;
     this.initialLayoutStyle = initialLayoutStyle;
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="fontStyle">The initial font style.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, UltravioletFontStyle fontStyle)
     : this(font, width, height, flags, options, TextDirection.LeftToRight, TextScript.Unknown, fontStyle, null)
 {
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="direction">A value indicating the direction in which the text should be laid out.</param>
 /// <param name="script">A value specifying which script is used to draw the text.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, TextDirection direction, TextScript script)
     : this(font, width, height, flags, options, direction, script, UltravioletFontStyle.Regular, null)
 {
 }
Example #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
        /// </summary>
        /// <param name="font">The default font.</param>
        /// <param name="width">The width of the layout area.</param>
        /// <param name="height">The height of the layout area.</param>
        /// <param name="flags">A set of flags that specify how to render and align the text.</param>
        /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
        /// <param name="direction">A value indicating the direction in which the text should be laid out.</param>
        /// <param name="script">A value specifying which script is used to draw the text.</param>
        /// <param name="fontStyle">The initial font style.</param>
        /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
        /// <param name="language">The ISO 639 name of the text language.</param>
        public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, TextDirection direction, TextScript script, UltravioletFontStyle fontStyle, String initialLayoutStyle, String language = "en")
        {
            if (direction == TextDirection.TopToBottom || direction == TextDirection.BottomToTop)
            {
                throw new NotSupportedException(UltravioletStrings.UnsupportedTextDirection);
            }

            this.Font               = font;
            this.Width              = width;
            this.Height             = height;
            this.Flags              = (flags == 0) ? TextFlags.Standard : flags;
            this.Style              = fontStyle;
            this.Direction          = direction;
            this.Script             = script;
            this.Options            = options;
            this.InitialLayoutStyle = initialLayoutStyle;
            this.Language           = language;
        }
Example #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="direction">A value indicating the direction in which the text should be laid out.</param>
 /// <param name="script">A value specifying which script is used to draw the text.</param>
 /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
 /// <param name="language">The ISO 639 name of the text language.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, TextDirection direction, TextScript script, String initialLayoutStyle, String language = "en")
     : this(font, width, height, flags, options, direction, script, UltravioletFontStyle.Regular, initialLayoutStyle, language)
 {
 }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextLayoutSettings"/> structure.
 /// </summary>
 /// <param name="font">The default font.</param>
 /// <param name="width">The width of the layout area.</param>
 /// <param name="height">The height of the layout area.</param>
 /// <param name="flags">A set of flags that specify how to render and align the text.</param>
 /// <param name="options">A set of options which can be used to modify the behavior of the layout engine.</param>
 /// <param name="initialLayoutStyle">The name of the initial layout style, or <see langword="null"/> to use no initial layout style.</param>
 public TextLayoutSettings(UltravioletFont font, Int32?width, Int32?height, TextFlags flags, TextLayoutOptions options, String initialLayoutStyle)
     : this(font, width, height, flags, options, TextDirection.LeftToRight, TextScript.Unknown, UltravioletFontStyle.Regular, initialLayoutStyle)
 {
 }