All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xslt.base.html.graphics.xsl Maven / Gradle / Ivy









  
    
    
      
Process an image The HTML img element only supports the notion of content-area scaling; it doesn't support the distinction between a content-area and a viewport-area, so we have to make some compromises. If only the content-area is specified, everything is fine. (If you ask for a three inch image, that's what you'll get.) If only the viewport-area is provided: If scalefit=1, treat it as both the content-area and the viewport-area. (If you ask for an image in a five inch area, we'll make the image five inches to fill that area.) If scalefit=0, ignore the viewport-area specification. This is not quite the right semantic and has the additional problem that it can result in anamorphic scaling, which scalefit should never cause. If both the content-area and the viewport-area is specified on a graphic element, ignore the viewport-area. (If you ask for a three inch image in a five inch area, we'll assume it's better to give you a three inch image in an unspecified area than a five inch image in a five inch area. Relative units also cause problems. As a general rule, the stylesheets are operating too early and too loosely coupled with the rendering engine to know things like the current font size or the actual dimensions of an image. Therefore: We use a fixed size for pixels, $pixels.per.inch We use a fixed size for "em"s, $points.per.em Percentages are problematic. In the following discussion, we speak of width and contentwidth, but the same issues apply to depth and contentdepth A width of 50% means "half of the available space for the image." That's fine. But note that in HTML, this is a dynamic property and the image size will vary if the browser window is resized. A contentwidth of 50% means "half of the actual image width". But the stylesheets have no way to assess the image's actual size. Treating this as a width of 50% is one possibility, but it produces behavior (dynamic scaling) that seems entirely out of character with the meaning. Instead, the stylesheets define a $nominal.image.width and convert percentages to actual values based on that nominal size. Scale can be problematic. Scale applies to the contentwidth, so a scale of 50 when a contentwidth is not specified is analagous to a width of 50%. (If a contentwidth is specified, the scaling factor can be applied to that value and no problem exists.) If scale is specified but contentwidth is not supplied, the nominal.image.width is used to calculate a base size for scaling. As a consequence of these decisions, unless the aspect ratio of your image happens to be exactly the same as (nominal width / nominal height), specifying contentwidth="50%" and contentdepth="50%" is NOT going to scale the way you expect (or really, the way it should). Don't do that. In fact, a percentage value is not recommended for content size at all. Use scale instead. Finally, align and valign are troublesome. Horizontal alignment is now supported by wrapping the image in a <div align="{@align}"> (in block contexts!). I can't think of anything (practical) to do about vertical alignment. tag The name of the HTML element to create (img, object, etc.). alt The alt text. longdesc A pointer to the long description (textobject) for this element. Markup for the image. Cannot read image properties for . (No extension) 0 0 0 1 0 1.0 1.0 px px px px Imagemap skipped: not supported on scaled images Imagemap skipped: intrinsics extension not available Warning: imagemaps not supported on scaled images Warning: imagemaps require image intrinsics extension middle height: px
background-color:
, , , Warning: only calspair supported in imageobjectco
middle




© 2015 - 2024 Weber Informatics LLC | Privacy Policy