TinyVG / specification

The specification for TinyVG. This is the central authority for the file system

Home Page:https://tinyvg.tech/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Clarification] Define pixel units

rsheeter opened this issue · comments

commented

Spec refers to pixels in several places (width, height, and "at least a single display pixel"). Pixel is a fairly ambiguous unit, suggest further definition or avoidance.

  1. CSS "pixel" https://drafts.csswg.org/css-values/#absolute-lengths
  2. Android has several "pixels"; https://developer.android.com/guide/topics/resources/more-resources.html#Dimension

Yeah, this is something which is bugging me as well and which is definitly underspecified.

My proposal here is:

A line width of 0 is actually a display pixel. It is as thin as possible, but definitly visible. The anti-alias renderer already respects this and scales a line up to a "logical" pixel in the final output.

For everything else, i would exchange the word pixel for something like more abstract like unit, which doesn't have a physical dimension applied. This isn't removing any features, as it's vector graphics. The size only defines the aspect and viewbox of the image, but not the actual final dimensions

commented

I think it would be good to have a physical scale embedded into the file (e.g. through a DPI value, assuming an isotropic display/print technology). If nothing else it would allow a viewer that does not know anything about the file to display it at a "sensible" scale on an unknown display (e.g. a High-DPI one).

Without this scale, a viewer displaying a random TinyVG file could either a) scale it to screen (which would be extremely goofy for e.g. icons), or it could apply an arbitrary scale (e.g. "1 unit = 1mm"), but that would also be goofy in many cases because some files might be in pixels @ something like 90 DPI, others in inches.

It is now clarified that a TinyVG display unit is a CSS pixel (1/96 inch)