Rank: Newbie
Groups: Guest
Joined: 8/30/2017(UTC) Posts: 5
|
Hi, I'm trying to convert a SVG file to a raster format like JPG. When I opened the final jpg file, I see that the fonts aren't the ones used in the svg file. I have these fonts used in the svg file installed in my fonts directory. I also tried to add these fonts to svgreader like below but this also doesn't work. Code:
using (var svg = new SvgReader(stream))
var fontRoboto = new CustomFontRegistry(FontRegistry.Installed);
fontRoboto.Add(@"C:\Windows\Fonts\RobotoCondensed-Light.ttf");
fontRoboto.Add(@"C:\Windows\Fonts\RobotoCondensed-Regular.ttf");
svg.FontRegistry = fontRoboto;
Edited by moderator Saturday, November 3, 2018 10:38:32 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
|
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 8/30/2017(UTC) Posts: 5
|
In the attached archive you will find the sample svg file and the result jpg file d.zip (2kb) downloaded 3 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Thank you for the provided file. We confirm the bug (#445) and will fix it in the future releases. You can expect the update in December. We will let you know as soon as we release the fixed version. Edited by user Monday, November 5, 2018 10:14:31 PM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 8/30/2017(UTC) Posts: 5
|
Hi Fedor, Could you also look at your svg rendering routines? A free svg library like this renders the same svg x100 times faster then yours: SVG library
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
We fixed the problem in the recently release version 10.0.22 It should work with the following code: Code:var fontRegistry = new CustomFontRegistry(FontRegistry.Installed);
fontRegistry.Add(@"C:\temp\RobotoCondensed-Light.ttf");
fontRegistry.Add(@"C:\temp\RobotoCondensed-Regular.ttf");
using (var svgReader = new SvgReader(@"C:\temp\test.svg", fontRegistry))
using (var bitmap = svgReader.Frames[0].GetBitmap())
using (var jpegWriter = new JpegWriter(@"C:\temp\test_correct.jpg"))
{
bitmap.ColorManagement.Convert(PixelFormat.Format24bppRgb);
(bitmap + jpegWriter).Run();
}
If you have any questions please let me know. |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Quote:A free svg library like this renders the same svg x100 times faster then yours: Thank you for the link. We will check it. |
Best regards, Fedor Skvortsov
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.