linebender / resvg

An SVG rendering library.
Apache License 2.0
2.84k stars 229 forks source link

Deduplicate fontdb types #808

Closed dhardy closed 2 months ago

dhardy commented 2 months ago

resvg optionally depends on fontdb. Meanwhile,

Worse, there isn't even a conversion method between the two. This is a pain when implementing a usvg::FontResolver.

RazrFalcon commented 2 months ago

Erm... what exactly is your solution?

Also, there are like 2 people who would need to implement usvg::FontResolver themselves. It's a super niche case.

dhardy commented 2 months ago

The simplest I can think of is to make this feature dependent:

RazrFalcon commented 2 months ago

This will only complicate things.

dhardy commented 2 months ago

No, it will simplify things for anyone downstream happening to need to use both types.

An alternative would be to implement From conversions. Probably more robust (to unforeseen changes in fontdb definitions of the types), but slightly more complicated.

RazrFalcon commented 2 months ago

From is fine.