/** * This element specifies the amount by which text shall be raised or * lowered for this run.in relation to the default baseline of the * surrounding non-positioned text. This allows the text to be repositioned * without altering the font size of the contents. * * If the val attribute is positive, then the parent run.shall be raised * above the baseline of the surrounding text by the specified number of * half-points. If the val attribute is negative, then the parent run.shall * be lowered below the baseline of the surrounding text by the specified * number of half-points. * * * If this element is not present, the default value is to leave the * formatting applied at previous level in the style hierarchy. If this * element is never applied in the style hierarchy, then the text shall not * be raised or lowered relative to the default baseline location for the * contents of this run. */ public void SetTextPosition(int val) { CT_RPr pr = run.IsSetRPr() ? run.rPr : run.AddNewRPr(); CT_SignedHpsMeasure position = pr.IsSetPosition() ? pr.position : pr.AddNewPosition(); position.val = (val.ToString()); }
public void TestSetGetTextForegroundBackground() { CT_RPr rpr = ctRun.AddNewRPr(); rpr.AddNewPosition().val = "4000"; XWPFRun run = new XWPFRun(ctRun, p); Assert.AreEqual(4000, run.GetTextPosition()); run.SetTextPosition(2400); Assert.AreEqual(2400, int.Parse(rpr.position.val)); }
public void SetTextPosition(int val) { CT_RPr ctRpr = this.run.IsSetRPr() ? this.run.rPr : this.run.AddNewRPr(); (ctRpr.IsSetPosition() ? ctRpr.position : ctRpr.AddNewPosition()).val = val.ToString(); }