Loading ...
Sorry, an error occurred while loading the content.
 

Re: [svg-developers] Re: Embarrassingly basic viewport/viewbox Q

Expand Messages
  • alex
    ... Well, yes, not being /completely/ senile, yet. ;-) But both the spec (and Eisenberg s _SVG Essentials_) keep saying things like The value of the viewBox
    Message 1 of 7 , Aug 5, 2009
      > Have you tried it? ;-)
      Well, yes, not being /completely/ senile, yet. ;-)

      But both the spec (and Eisenberg's _SVG Essentials_) keep saying things
      like "The value of the viewBox attribute... specif[ies] a rectangle in
      user space which should be mapped to the bounds of the viewport
      established by the given element" -- nowhere have i seen anything even
      hinting that the viewBox could be bigger than the viewport as declared
      in the <svg> element.

      It occurred to me in the shower this morning that the user agent might
      be refusing to let 1 user coordinate "pixel" be smaller than the actual
      current physical device pixel.


      > I'd also suggest Opera when testing SVG content
      This will end up being displayed on FireFox 3.x, which seems to be doing
      OK so far.


      > I recall this being discussed several times already, so you may find
      > tightly related threads by crawling this group's archive and/or the
      > Batik mailing lists archive [6] (where I've seen this also).
      A simple search didn't bring up much, but i shall certainly spend some
      more time doing that. Thank you for your patient and extensive answer to
      what must be for regulars a pretty annoyingly common question.

      --alex.
    • alex
      After searching the archives and reading the spec, i still have some sort of mental block about the viewBox and user units. If someone could show me what a svg
      Message 2 of 7 , Aug 7, 2009
        After searching the archives and reading the spec, i still have some
        sort of mental block about the viewBox and user units. If someone could
        show me what a svg tag would look like that would print an area of 8" x
        10", at 300dpi, such that a line with a stroke-size of 1px is 1/300"
        wide, and 10pt text is 10pt, i'd very much appreciate it. (Most of the
        samples i've found are in dimensionless user units, and i simply don't
        understand how long "20" is.)

        Thanks,

        --alex.
      • steltenpower
        viewBox / preserveAspectRatio / view/width / units / clipping (?) / overflow seem like things people have a hard time understanding, both as standalone SVG, or
        Message 3 of 7 , Aug 8, 2009
          viewBox / preserveAspectRatio / view/width / units / clipping (?) / overflow seem like things people have a hard time understanding, both as standalone SVG, or 'embedded' in HTML or other SVG

          Maybe you could make an interactive experiment that shows how all (many of) these things work, to save people a lot of time figuring it out. That would make good content for planetsvg.com

          Anyway, good luck



          --- In svg-developers@yahoogroups.com, alex <alyxtmp-netbeans@...> wrote:
          >
          > After searching the archives and reading the spec, i still have some
          > sort of mental block about the viewBox and user units. If someone could
          > show me what a svg tag would look like that would print an area of 8" x
          > 10", at 300dpi, such that a line with a stroke-size of 1px is 1/300"
          > wide, and 10pt text is 10pt, i'd very much appreciate it. (Most of the
          > samples i've found are in dimensionless user units, and i simply don't
          > understand how long "20" is.)
          >
          > Thanks,
          >
          > --alex.
          >
        • alex
          That s an excellent suggestion, and after playing around with basic settings, i think i ve finally got a handle on things... Apparently you can have a
          Message 4 of 7 , Aug 8, 2009
            That's an excellent suggestion, and after playing around with basic
            settings, i think i've finally got a handle on things... Apparently you
            can have a resolution higher than the default (screen), or
            properly-sized absolute units (in, cm, etc.), but not both at the same
            time, as the sizes of the latter are calculated based on the initial
            (screen) resolution.

            So, a 1" x 1", 300dpi graphic would look something like:

            // 1" at screen resolution - <object> won't take absolute units
            (<object width="96" height="96">)

            <svg width="96" height="96" viewBox="0 0 300 300"
            preserveAspectRatio="xMinYMin meet">

            (etc.)

            </svg>
            (</object>)

            However, within the graphic, "1in" won't be 1in, but rather 96/300 =
            0.32in. This, coupled with the fact that you can't use absolute units
            in <path> data, would seem to make them pretty much useless in any case
            other than a non-transformed, screen-destined graphic. Which i suppose
            the spec does get around to pointing out, but i sure wish _SVG
            Essentials_ had. As i'm just about to roof-test the damn thing, has
            anyone a recommendation for a good (and recent) SVG book?

            If i'm *still* wrong, please correct me; otherwise, hope this might help
            any other pathetic newbies with this same confusion in the future.

            --alex.

            steltenpower wrote:
            >
            >
            > viewBox / preserveAspectRatio / view/width / units / clipping (?) /
            > overflow seem like things people have a hard time understanding, both as
            > standalone SVG, or 'embedded' in HTML or other SVG
            >
            > Maybe you could make an interactive experiment that shows how all (many
            > of) these things work, to save people a lot of time figuring it out.
            > That would make good content for planetsvg.com
            >
            > Anyway, good luck
            >
            > --- In svg-developers@yahoogroups.com
            > <mailto:svg-developers%40yahoogroups.com>, alex <alyxtmp-netbeans@...>
            > wrote:
            > >
            > > After searching the archives and reading the spec, i still have some
            > > sort of mental block about the viewBox and user units. If someone could
            > > show me what a svg tag would look like that would print an area of 8" x
            > > 10", at 300dpi, such that a line with a stroke-size of 1px is 1/300"
            > > wide, and 10pt text is 10pt, i'd very much appreciate it. (Most of the
            > > samples i've found are in dimensionless user units, and i simply don't
            > > understand how long "20" is.)
            > >
            > > Thanks,
            > >
            > > --alex.
          Your message has been successfully submitted and would be delivered to recipients shortly.