@@ -132,6 +132,37 @@ public void createDocumentWithKozmin() throws IOException, InterruptedException
132132 Assert .assertNull (new CompareTool ().compareByContent (filename , cmpFilename , destinationFolder , "diff_" ));
133133 }
134134
135+ @ Test
136+ public void createDocumentWithKozminAndDifferentCodespaceRanges () throws IOException , InterruptedException {
137+ String filename = destinationFolder + "DocumentWithKozminDifferentCodespaceRanges.pdf" ;
138+ String cmpFilename = sourceFolder + "cmp_DocumentWithKozminDifferentCodespaceRanges.pdf" ;
139+ String title = "Type 0 test" ;
140+
141+ PdfWriter writer = new PdfWriter (filename );
142+ writer .setCompressionLevel (CompressionConstants .NO_COMPRESSION );
143+ PdfDocument pdfDoc = new PdfDocument (writer );
144+
145+ pdfDoc .getDocumentInfo ().setAuthor (author ).
146+ setCreator (creator ).
147+ setTitle (title );
148+ PdfFont type0Font = PdfFontFactory .createFont ("KozMinPro-Regular" , "83pv-RKSJ-H" , true );
149+ Assert .assertTrue ("Type0Font expected" , type0Font instanceof PdfType0Font );
150+ Assert .assertTrue ("CidFont expected" , type0Font .getFontProgram () instanceof CidFont );
151+ PdfPage page = pdfDoc .addNewPage ();
152+ PdfCanvas canvas = new PdfCanvas (page );
153+ canvas .saveState ()
154+ .beginText ()
155+ .moveText (36 , 700 )
156+ .setFontAndSize (type0Font , 50 )
157+ .showText (type0Font .createGlyphLine ("Hello\u7121 \u540d world\u6b98 \u528d " ))
158+ .endText ()
159+ .restoreState ();
160+ canvas .release ();
161+ page .flush ();
162+ pdfDoc .close ();
163+ Assert .assertNull (new CompareTool ().compareByContent (filename , cmpFilename , destinationFolder , "diff_" ));
164+ }
165+
135166 @ Test
136167 public void createDocumentWithStSongUni () throws IOException , InterruptedException {
137168 String filename = destinationFolder + "DocumentWithStSongUni.pdf" ;
0 commit comments