@@ -29,6 +29,7 @@ You should have received a copy of the GNU Affero General Public License
2929using iText . IO . Util ;
3030using iText . Kernel . Utils ;
3131using iText . Layout . Font ;
32+ using iText . Layout . Font . Selectorstrategy ;
3233using iText . StyledXmlParser . Css . Media ;
3334using iText . Test ;
3435using iText . Test . Attributes ;
@@ -271,19 +272,22 @@ public virtual void DoNotDownloadUnusedFontTest() {
271272
272273 [ NUnit . Framework . Test ]
273274 public virtual void CorrectUrlWithUsedUnicodeRangeTest ( ) {
274- //TODO: update after DEVSIX-2052
275- RunTest ( "correctUrlWithUsedUnicodeRangeTest" ) ;
275+ FontProvider fontProvider = new DefaultFontProvider ( ) ;
276+ fontProvider . SetFontSelectorStrategyFactory ( new BestMatchFontSelectorStrategy . BestMatchFontSelectorStrategyFactory
277+ ( ) ) ;
278+ RunTest ( "correctUrlWithUsedUnicodeRangeTest" , fontProvider ) ;
276279 }
277280
278281 [ NUnit . Framework . Test ]
279282 public virtual void CorrectUnicodeRangeSignificantTest ( ) {
280- //TODO: update after DEVSIX-2052
281- RunTest ( "correctUnicodeRangeSignificantTest" ) ;
283+ FontProvider fontProvider = new DefaultFontProvider ( ) ;
284+ fontProvider . SetFontSelectorStrategyFactory ( new BestMatchFontSelectorStrategy . BestMatchFontSelectorStrategyFactory
285+ ( ) ) ;
286+ RunTest ( "correctUnicodeRangeSignificantTest" , fontProvider ) ;
282287 }
283288
284289 [ NUnit . Framework . Test ]
285290 public virtual void OverwrittenUnicodeRangeTextInLineTest ( ) {
286- // TODO DEVSIX-2052
287291 RunTest ( "overwrittenUnicodeRangeTextInLineTest" ) ;
288292 }
289293
@@ -307,19 +311,23 @@ public virtual void UnusedFontWithUnicodeRangeTest() {
307311 RunTest ( "unusedFontWithUnicodeRangeTest" ) ;
308312 }
309313
310- private void RunTest ( String name ) {
314+ private void RunTest ( String name , FontProvider fontProvider ) {
311315 String htmlPath = sourceFolder + name + ".html" ;
312316 String pdfPath = destinationFolder + name + ".pdf" ;
313317 String cmpPdfPath = sourceFolder + "cmp_" + name + ".pdf" ;
314318 String diffPrefix = "diff_" + name + "_" ;
315319 System . Console . Out . WriteLine ( "html: " + UrlUtil . GetNormalizedFileUriString ( htmlPath ) + "\n " ) ;
316320 ConverterProperties converterProperties = new ConverterProperties ( ) . SetMediaDeviceDescription ( new MediaDeviceDescription
317- ( MediaType . PRINT ) ) . SetFontProvider ( new DefaultFontProvider ( ) ) ;
321+ ( MediaType . PRINT ) ) . SetFontProvider ( fontProvider ) ;
318322 HtmlConverter . ConvertToPdf ( new FileInfo ( htmlPath ) , new FileInfo ( pdfPath ) , converterProperties ) ;
319323 NUnit . Framework . Assert . IsFalse ( converterProperties . GetFontProvider ( ) . GetFontSet ( ) . Contains ( "droid serif" ) ,
320324 "Temporary font was found." ) ;
321325 NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( pdfPath , cmpPdfPath , destinationFolder , diffPrefix
322326 ) ) ;
323327 }
328+
329+ private void RunTest ( String name ) {
330+ RunTest ( name , new DefaultFontProvider ( ) ) ;
331+ }
324332 }
325333}
0 commit comments