Esempio n. 1
0
        public virtual void fillText(string text, double x, double y)
        {
            unchecked
            {
                global::System.Windows.Controls.TextBlock textBlock = new global::System.Windows.Controls.TextBlock();
                textBlock.Text       = text;
                textBlock.Foreground = this._brush;
                textBlock.FontFamily = new global::System.Windows.Media.FontFamily(global::haxe.lang.Runtime.toString(this._font.getFamily()));
                textBlock.FontSize   = this._font.getSize();
                if ((((this._font.getStyle() & 2)) != 0))
                {
                    textBlock.FontStyle = global::System.Windows.FontStyles.Italic;
                }

                if ((((this._font.getStyle() & 1)) != 0))
                {
                    textBlock.FontWeight = global::System.Windows.FontWeights.Bold;
                }

                global::AlphaTab.Utils.AlignmentHelper.SetAlignment(textBlock, this._textAlign);
                global::AlphaTab.Utils.AlignmentHelper.SetLineAlignment(textBlock, this._textBaseline);
                global::System.Windows.Controls.Canvas.SetLeft(textBlock, x);
                global::System.Windows.Controls.Canvas.SetTop(textBlock, y);
                this._canvas.Children.Add(textBlock);
            }
        }
Esempio n. 2
0
		public virtual   void fillText(string text, double x, double y)
		{
			unchecked 
			{
				global::System.Windows.Controls.TextBlock textBlock = new global::System.Windows.Controls.TextBlock();
				textBlock.Text = text;
				textBlock.Foreground = this._brush;
				textBlock.FontFamily = new global::System.Windows.Media.FontFamily(global::haxe.lang.Runtime.toString(this._font.getFamily()));
				textBlock.FontSize = this._font.getSize();
				if (( (( this._font.getStyle() & 2 )) != 0 )) 
				{
					textBlock.FontStyle = global::System.Windows.FontStyles.Italic;
				}
				
				if (( (( this._font.getStyle() & 1 )) != 0 )) 
				{
					textBlock.FontWeight = global::System.Windows.FontWeights.Bold;
				}
				
				global::AlphaTab.Utils.AlignmentHelper.SetAlignment(textBlock, this._textAlign);
				global::AlphaTab.Utils.AlignmentHelper.SetLineAlignment(textBlock, this._textBaseline);
				global::System.Windows.Controls.Canvas.SetLeft(textBlock, x);
				global::System.Windows.Controls.Canvas.SetTop(textBlock, y);
				this._canvas.Children.Add(textBlock);
			}
		}