@@ -29,6 +29,7 @@ You should have received a copy of the GNU Affero General Public License
29
29
using iText . IO . Util ;
30
30
using iText . Kernel . Utils ;
31
31
using iText . Layout . Font ;
32
+ using iText . Layout . Font . Selectorstrategy ;
32
33
using iText . StyledXmlParser . Css . Media ;
33
34
using iText . Test ;
34
35
using iText . Test . Attributes ;
@@ -271,19 +272,22 @@ public virtual void DoNotDownloadUnusedFontTest() {
271
272
272
273
[ NUnit . Framework . Test ]
273
274
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 ) ;
276
279
}
277
280
278
281
[ NUnit . Framework . Test ]
279
282
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 ) ;
282
287
}
283
288
284
289
[ NUnit . Framework . Test ]
285
290
public virtual void OverwrittenUnicodeRangeTextInLineTest ( ) {
286
- // TODO DEVSIX-2052
287
291
RunTest ( "overwrittenUnicodeRangeTextInLineTest" ) ;
288
292
}
289
293
@@ -307,19 +311,23 @@ public virtual void UnusedFontWithUnicodeRangeTest() {
307
311
RunTest ( "unusedFontWithUnicodeRangeTest" ) ;
308
312
}
309
313
310
- private void RunTest ( String name ) {
314
+ private void RunTest ( String name , FontProvider fontProvider ) {
311
315
String htmlPath = sourceFolder + name + ".html" ;
312
316
String pdfPath = destinationFolder + name + ".pdf" ;
313
317
String cmpPdfPath = sourceFolder + "cmp_" + name + ".pdf" ;
314
318
String diffPrefix = "diff_" + name + "_" ;
315
319
System . Console . Out . WriteLine ( "html: " + UrlUtil . GetNormalizedFileUriString ( htmlPath ) + "\n " ) ;
316
320
ConverterProperties converterProperties = new ConverterProperties ( ) . SetMediaDeviceDescription ( new MediaDeviceDescription
317
- ( MediaType . PRINT ) ) . SetFontProvider ( new DefaultFontProvider ( ) ) ;
321
+ ( MediaType . PRINT ) ) . SetFontProvider ( fontProvider ) ;
318
322
HtmlConverter . ConvertToPdf ( new FileInfo ( htmlPath ) , new FileInfo ( pdfPath ) , converterProperties ) ;
319
323
NUnit . Framework . Assert . IsFalse ( converterProperties . GetFontProvider ( ) . GetFontSet ( ) . Contains ( "droid serif" ) ,
320
324
"Temporary font was found." ) ;
321
325
NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( pdfPath , cmpPdfPath , destinationFolder , diffPrefix
322
326
) ) ;
323
327
}
328
+
329
+ private void RunTest ( String name ) {
330
+ RunTest ( name , new DefaultFontProvider ( ) ) ;
331
+ }
324
332
}
325
333
}
0 commit comments