[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] GSoC: OT-SVG: Error propagation from SVG library hooks
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] GSoC: OT-SVG: Error propagation from SVG library hooks |
Date: |
Sun, 28 Jul 2019 12:12:15 +0200 (CEST) |
> I was trying to write some good error handling code in the
> `librsvg' rendering port.
If you say `rendering port', you mean code that gets added to librsvg,
to FreeType, or to the calling application?
> What I did is that I created a new error `Invalid_SVG_Document'.
> Then, I check the errors returned by the SVG rendering library and
> either return `Invalid_SVG_Document' or `Out_Of_Memory' or
> `Invalid_Outline' depending on what might have caused it.
Hmm.
> This worked well but I just realized that `FT_Throw' is something
> internal to FreeType just like `FT_NEW' and can't be used from
> outside. As long as FreeType is being linked statically, it works
> great, otherwise I get an undefined reference error.
So this sounds as if the code is not part of FreeType...
> Exposing these functions outside is probably not a good idea.
`FT_Throw' is just an auxiliary means to help debugging so that you
can set a breakpoint in case of an error. It can be omitted.
I'm not sure whether it makes sense to define error codes for external
stuff that is not directly used by FreeType. Maybe you just return
values like -1 or -2 as error codes?
Werner