@@ -45,6 +45,9 @@ public class AlignmentTest : ExtendedITextTest {
45
45
private static readonly String DESTINATION_FOLDER = NUnit . Framework . TestContext . CurrentContext . TestDirectory
46
46
+ "/test/itext/layout/AlignmentTest/" ;
47
47
48
+ private static readonly String FONTS_FOLDER = iText . Test . TestUtil . GetParentProjectDirectory ( NUnit . Framework . TestContext
49
+ . CurrentContext . TestDirectory ) + "/resources/itext/layout/fonts/" ;
50
+
48
51
[ NUnit . Framework . OneTimeSetUp ]
49
52
public static void BeforeClass ( ) {
50
53
CreateOrClearDestinationFolder ( DESTINATION_FOLDER ) ;
@@ -519,6 +522,23 @@ public virtual void FlexItemHorizontalAlignmentTest() {
519
522
, "diff" ) ) ;
520
523
}
521
524
525
+ [ NUnit . Framework . Test ]
526
+ public virtual void JustifiedAlignmentWithZeroFreeSpaceTest ( ) {
527
+ String outFileName = DESTINATION_FOLDER + "justifiedAlignmentWithZeroFreeSpaceTest.pdf" ;
528
+ String cmpFileName = SOURCE_FOLDER + "cmp_justifiedAlignmentWithZeroFreeSpaceTest.pdf" ;
529
+ using ( PdfDocument pdfDoc = new PdfDocument ( new PdfWriter ( outFileName ) ) ) {
530
+ Document document = new Document ( pdfDoc ) ;
531
+ PdfFont font = PdfFontFactory . CreateFont ( FONTS_FOLDER + "NotoSansCJKjp-Regular.otf" ) ;
532
+ Text t1 = new Text ( "期期期" ) . SetFont ( font ) ;
533
+ Text t2 = new Text ( "期期期" ) . SetFont ( font ) ;
534
+ Paragraph p = new Paragraph ( t1 ) . Add ( t2 ) . SetSpacingRatio ( 1 ) . SetWidth ( 60 ) . SetTextAlignment ( TextAlignment . JUSTIFIED
535
+ ) ;
536
+ document . Add ( p ) ;
537
+ }
538
+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , DESTINATION_FOLDER
539
+ , "diff" ) ) ;
540
+ }
541
+
522
542
private static void CreateDocumentWithInlineAlignment ( String outPdf , String cmpPdf , InlineVerticalAlignmentType ?
523
543
verticalAlignment1 ) {
524
544
CreateDocumentWithInlineAlignment ( outPdf , cmpPdf , verticalAlignment1 , null ) ;
0 commit comments