public virtual void TestParsingIncorrectFontWeight()
 {
     NUnit.Framework.Assert.AreEqual((short)-1, FontCharacteristicsUtils.ParseFontWeight(""));
     NUnit.Framework.Assert.AreEqual((short)-1, FontCharacteristicsUtils.ParseFontWeight(null));
     NUnit.Framework.Assert.AreEqual((short)-1, FontCharacteristicsUtils.ParseFontWeight("dfgdgdfgdfgdf"));
     NUnit.Framework.Assert.AreEqual((short)-1, FontCharacteristicsUtils.ParseFontWeight("italic"));
 }
 public virtual void TestParsingNumberFontWeight()
 {
     NUnit.Framework.Assert.AreEqual((short)100, FontCharacteristicsUtils.ParseFontWeight("-1"));
     NUnit.Framework.Assert.AreEqual((short)100, FontCharacteristicsUtils.ParseFontWeight("50"));
     NUnit.Framework.Assert.AreEqual((short)300, FontCharacteristicsUtils.ParseFontWeight("360"));
     NUnit.Framework.Assert.AreEqual((short)900, FontCharacteristicsUtils.ParseFontWeight("25000"));
 }
 public virtual void TestParseAllowedFontWeight()
 {
     NUnit.Framework.Assert.AreEqual((short)400, FontCharacteristicsUtils.ParseFontWeight("normal"));
     NUnit.Framework.Assert.AreEqual((short)700, FontCharacteristicsUtils.ParseFontWeight("bold"));
 }
Ejemplo n.º 4
0
 public iText.Layout.Font.FontCharacteristics SetFontWeight(String fw)
 {
     return(SetFontWeight(FontCharacteristicsUtils.ParseFontWeight(fw)));
 }