linebender / resvg

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

README: Limitations section unclear (native text rendering) #703

Closed Chealer closed 9 months ago

Chealer commented 10 months ago

The Limitations section of the README contains:

No native text rendering resvg doesn't rely on any system libraries, which implies that we cannot use native text rendering. Nevertheless, native text rendering is optimized for small horizontal text, which is not that common is SVG.

Please clarify what this calls "native text rendering" and "small horizontal text".

By the way, I assume "is SVG" should read "in SVG".

RazrFalcon commented 9 months ago

"native text rendering" is the text rendering provided by the OS/platform. "small horizontal text" is what you see right now.

Chealer commented 9 months ago

I'm sorry but that is not clear to me. What would you consider as non-small horizontal text?

RazrFalcon commented 9 months ago

I would say at least 40px tall. At this scale it shouldn't matter that we're using a generic Bezier rasterizer instead of font-specific one. Aka resvg doesn't perform hinting, RGB-antialiasing, stem darkening and other font related rendering stuff. In resvg, text is just paths.

Chealer commented 9 months ago

Thank you @RazrFalcon

I am skeptical that native text rendering is optimized for small horizontal text, and suggest linking to a reference supporting/detailing that.

Otherwise, this should be rephrased to document the features resvg lacks, without discussing internals. I do not know what exactly resvg lacks, but for example, based on the above, this could read:

No text hinting, antialiasing and stem darkening

Or, the first line could merely read "Basic text rendering", and details about missing features could go in the paragraph under.

RazrFalcon commented 9 months ago

Basic text rendering

This is even more misleading. Most people confuse text layout and text rendering. And resvg has a very advanced layout support, while text render is ok.

I am skeptical that native text rendering is optimized for small horizontal text

Nothing to be skeptical about. This is exactly what it is designed for. Small, horizontal, black on white text.

and suggest linking to a reference supporting/detailing that

I'm not aware of any good one.

Overall, I will see how the readme can be clarified.

Chealer commented 9 months ago

Basic text rendering

This is even more misleading. Most people confuse text layout and text rendering.

You may be right about people, but the current version already uses that term, so it shouldn't be "even more misleading". If a reader was to misunderstand, reading the paragraph should fix any misinterpretation anyway.

[...]

I am skeptical that native text rendering is optimized for small horizontal text

Nothing to be skeptical about. This is exactly what it is designed for. Small, horizontal, black on white text.

and suggest linking to a reference supporting/detailing that

I'm not aware of any good one.

I remain skeptical, and recommend removal until:

  1. The sentence is fixed.
  2. The meaning of "small horizontal text" is specified.
  3. The implication that native text rendering is optimized for small horizontal text is supported.
  4. The meaning of "that common" is specified.
  5. The claim that "small horizontal text" is not "that common" in SVG is supported.

Overall, I will see how the readme can be clarified.

Thanks

RazrFalcon commented 9 months ago

Welp, I don't plan doing any of those, sorry.