This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
bulente  
#1 Posted : Saturday, November 3, 2018 8:59:33 PM(UTC)
bulente

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

Fedor  
#2 Posted : Saturday, November 3, 2018 10:39:56 PM(UTC)
Fedor

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)
Could you attach or send to support@aurigma.com the SVG file you want to render?
Best regards,

Fedor Skvortsov

bulente  
#3 Posted : Saturday, November 3, 2018 11:21:11 PM(UTC)
bulente

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).

Fedor  
#4 Posted : Monday, November 5, 2018 10:07:51 PM(UTC)
Fedor

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

bulente  
#5 Posted : Tuesday, November 6, 2018 2:38:16 AM(UTC)
bulente

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

Fedor  
#6 Posted : Wednesday, November 7, 2018 11:53:57 PM(UTC)
Fedor

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

Fedor  
#7 Posted : Wednesday, November 7, 2018 11:55:25 PM(UTC)
Fedor

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

Users browsing this topic
Guest
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.