Re: Scaling non-uniformly in svg

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Scaling non-uniformly in svg

thomas.deweese
Arian Hojat wrote:

> I can scale using pretend tranform="scale(2.0)" easily. but i wanna
> stretch so an image fits the svg size. If i do width="100%" and
> height="100%" for an image, the svg opened in SVGViewer shows the
> image 'stretched' correctly with aspect ratio,

    Hmm?  Your image element has 'preserveAspectRatio' (PAR) set
to 'xMidYMid meet', this disables non-uniform scaling, so I think
you must have been looking at a different image...

> but the saved jpeg from JpegTranscoder doesnt seem to want to
> save it... Is this a Batik issue or is my svg a lil screwy...

    I think it's your SVG, but what do you mean by the JPEGTranscoder
doesn't want to save it?  It saves it with uniform scale?  Or it
bails completely?  If it saves it - what are the dimensions of the
saved JPEG?

> Here is the svg it saves if interested...

    What saves this?

> <svg contentScriptType="text/ecmascript" width="400"
> xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify"
> contentStyleType="text/css" height="100" preserveAspectRatio="xMidYMid
> meet" xmlns="http://www.w3.org/2000/svg" version="1.0">
>
> <image x="0" y="0" width="100%"
> xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="a.jpg"
> xlink:type="simple" xlink:actuate="onLoad" height="100%"
> preserveAspectRatio="xMidYMid meet" xlink:show="embed"/>
>
> </svg>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

batiks ttf2svg on tomcat (running via code rather than command line)

Arian Hojat
hello guy....
i want to allow the user to upload a ttf which i can do. now i want to
run in a servlet the ttf2svg utility. not sure how to run this in a
java servlet (not sure if somehow command line can be used in a
servlet but security might be an issue for users). is there another
option. bascially i allow the user to upload their 'cool' fonts and
use them to draw text with the glyphs svg provides by converting from
ttf to a system independant format...

Also if there is an easier option... such as just uploading the ttf to
the current directory/directory batik looks for fonts, and using the
font name (in qoutes?) in the svg, and then deleting the ttf when i am
done writing my image... can this be done and works both on windows
and unix (nice cause no xml parsing for me if possible)?

I usually get the same 2-3 people who answer batik questions so i will
thank in advance those batik enthusiasts for helping the commmunity
for all their work. :). Are you guys batik/svg developers?

Thanx,
Arian Hojat

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: batiks ttf2svg on tomcat (running via code rather than command line)

Måns Rullgård
Arian Hojat <[hidden email]> writes:

> hello guy....
> i want to allow the user to upload a ttf which i can do. now i want to
> run in a servlet the ttf2svg utility. not sure how to run this in a
> java servlet (not sure if somehow command line can be used in a
> servlet but security might be an issue for users).

Runtime.exec() works in a default configuration, but yours might have
stricter security settings.

> is there another option. bascially i allow the user to upload their
> 'cool' fonts and use them to draw text with the glyphs svg provides
> by converting from ttf to a system independant format...
>
> Also if there is an easier option... such as just uploading the ttf to
> the current directory/directory batik looks for fonts, and using the
> font name (in qoutes?) in the svg, and then deleting the ttf when i am
> done writing my image... can this be done and works both on windows
> and unix (nice cause no xml parsing for me if possible)?

Using truetype fonts from batik is certainly possible.  One was is
using a @font-face CSS section.  There may be others.

--
M?ns Rullg?rd
[hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]