public TextAtom(float orgX, float orgY, V2DTextRun tr) { this.Text = tr.Text; this.Font = FontManager.Instance.GetFont(tr.FontName); //this.Origin = new Microsoft.Xna.Framework.Vector2(orgX + tr.Left, orgY + tr.Top); this.Origin = new Microsoft.Xna.Framework.Vector2(tr.Left, tr.Top); uint c = tr.Color; byte a = (byte)(c >> 24); byte r = (byte)(c >> 16); byte g = (byte)(c >> 8); byte b = (byte)(c >> 0); this.Color = new Color(r, g, b, a); this.LetterSpacing = GetAttributeValue(tr.Text, "letterSpacing"); this.Kerning = GetAttributeValue(tr.Text, "kerning"); this.Align = GetAlign(tr.Text); }
public V2DTextRun GetRun(TextRun tr) { V2DTextRun result = new V2DTextRun(); result.Text = tr.Text; result.FontName = tr.FontName; result.FontSize = tr.FontSize; result.Top = tr.Top; result.Left = tr.Left; result.Color = (uint)tr.Color.ARGB; result.isHtml = tr.isHtml; result.isBold = tr.isBold; result.isItalic = tr.isItalic; result.isMultiline = tr.isMultiline; result.isUnderlined = tr.isUnderlined; result.isStrikeout = tr.isStrikeout; result.isWrapped = tr.isWrapped; result.isPassword = tr.isPassword; result.isEditable = tr.isEditable; result.isSelectable = tr.isSelectable; return(result); }