Re: Converting SVG to SVG and replacing viewBox

2021-03-20 Thread Helder Magalhães
Hello Konstantin,

Because SVG is vector graphics, you don't have to resize the whole contents
but only the viewBox, as you've already stated.
In this case, Batik would be overkill in my opinion: a simple XML
manipulation workflow would be sufficient:

   1. open SVG (XML) document;
   2. read 'viewBox' attribute;
   3. possibly to some maths;
   4. edit 'viewBox' attribute;
   5. save document.

One might use Batik XML interfaces, of course, but it might be even simpler
to use a "plain" XML parser - such as TinyXML or pugixml (where there's a
nice benchmark  comparison with many
more, if there are performance-related goals involved).

Hope this helps,
Helder


Konstantin Bulenkov  escreveu no dia quinta,
11/03/2021 à(s) 19:47:

> Hello everyone,
>
> What's a proper way to convert an SVG image file and replace its viewBox
> size, and then save?
>
> For example, loading 32x32 svg file, and save it as 16x16.
>
> input:
>
>  xmlns="http://www.w3.org/2000/svg;>
> 
> 
> 
> 
>  y2="26.4673" gradientUnits="userSpaceOnUse">
> 
> 
> 
> 
> 
> 
>
> output (using Figma):
>
>  xmlns="http://www.w3.org/2000/svg;>
> 
> 
>  x2="9.9591" y2="13.2336" gradientUnits="userSpaceOnUse">
> 
> 
> 
> 
> 
> 
>
> My first attempt was to use SVGGraphics2D with loaded svg document and then 
> change svgCanvasSize. However, I got invalid file with missing defs and 
> invalid formatting.
>
> Thank you in advance for any help.
>
> Konstantin
>
>
>


Re: Performance and rendering quality degradation between Batik Squiggle 1.9 and 1.11

2019-08-17 Thread Helder Magalhães
Hi John,

Could you elaborate a bit on the comparison?
1. Is it between the same Operating System? And same OS version? Please
state which one/ones are they.
2. Is it between the same JRE/JDK (Oracle/OpenJDK/etc.)? And same
versions? Please
state which one/ones are they.

Also, given it's a quality difference, one or two pairs of screenshots
between same content in the two environments would quite improve the
explanation.

Regards,
Helder Magalhães

A Sáb, 17/08/2019, 06:54, John-Val Rose 
escreveu:

> Does anyone know why there appears to be a noticeable degradation in both
> rendering/scaling performance and also in rendering quality of SVGs in
> Squiggle between Batik 1.9 and 1.11?
>
>
>
> What are the major changes that may have resulted in this degradation?
>
>
>
> Graciously,
>
>
>
> John-Val
>


Re: Print svg file with PrintTranscoder in applet

2013-07-25 Thread Helder Magalhães
 Hi Batik users,

Hi minh tuan,

 I'm doing an applet which can print svg sttring to printer.
 But when i use PrinterJob and set printable is PrintTranscoder then
print, it has error with sun class unknown source.
 Could i use PrintTranscoder in applet ? or i wrong in something ?

You must use the JDK/JRE from Sun (now Oracle) with all currently released
versions. You can use other JDK/JRE if you compile Batik from source (trunk
version currently stands for 1.8). If you have trouble with that, there are
also nightly builds available.

 Pls help me,
 Thank you in advance.
 Tuan.

Let us know how it goes!
Hope this helps,
  Helder


Re: Download

2012-11-12 Thread Helder Magalhães
 Hi,

Hi Oliver,


 The download link seems to be down.

 http://xmlgraphics.apache.org/batik/download.cgi

 Clicking the binary distribution (first download link) takes me to

 http://mirror.catn.com/pub/apache//xmlgraphics/batik/batik-1.7.zip

 which isn't there. I've tried a few different mirrors.

I've quickly checked and you are right: apparently the downloads seem
to have moved to pub/apache/xmlgraphics-org/batik ([1] for your
case) for some reason. Please download from there while we check
what's happening (CC'ing general@).

 Regards
 Oliver
 www.agilebase.co.uk

Thanks for the report,
 Helder


[1] http://mirror.catn.com/pub/apache/xmlgraphics-org/batik/batik-1.7.zip

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG which renders in 1.7 fails in 1.8pre

2012-10-10 Thread Helder Magalhães
Hi Joel,


 What's in classes but not in the JARs is the
 org/apache/batik/ext/awt/image/codec/imageio subtree, which neatly
 explains why image rendering fails when it's absent.

 Is it a bug in the build.xml that this subtree is omitted?

Yes, this was a regression introduced with the already stated bug (#46513)...


 Here's a patch which adds the missing classes to batik-codec.jar when
 sun-codes.present is false.

Great, thanks for your investigation and contribution! Thomas has
committed it in revision 1396431. I've noticed it and double checked
that it now works as expected (thanks, Thomas!).


Cheers,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: How to create a Bar-Graph or Chart using Batik?

2012-10-06 Thread Helder Magalhães
 Hi,

Hi Arihant,


 Am a new user of Batik Tool-Kit  I wish to create a Graph or Chart object
 with X-Y axis, axis labels, legends panel?
 Is there any class within the tool-kit for the same?

Batik is neutral in terms of target usage. If you really intend doing
charts, I'd suggest JFreeCharts [1], a project aimed at charting (like
its name suggests) which uses Batik under the hood.


 Regards,
 Arihant Bapna

Cheers,
 Helder


[1] http://xmlgraphics.apache.org/batik/uses.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG editor app

2012-09-24 Thread Helder Magalhães
 Hello,

Hi Oliver,


 I've recently forked and resurrected the GLIPS project which is an SVG editor 
 that uses Batik,

 http://glipssvgeditor.sourceforge.net

 for my own use and code is now on github:

 https://github.com/okohll/svg_editor

Those are great news, I've always liked GLIPS and was quite sorry its
development had stalled...


 I wonder if anyone else is interested in collaborating on this. If so, 
 patches (pull requests) are most welcome, or even just suggestions. The main 
 task currently is basic compatibility with all SVG files - it opens some but 
 not others.

Time will tell. I'll be watching from close, as time permits. Given
that most of the code belongs to Batik, I'd suggest finding such
incompatible test cases and reporting bugs against Batik. Several
known issues are currently related with text support but, apart from
these, there shouldn't  shouldn't be many more.


 Regards
 Oliver Kohll

Good luck,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Bug 51908 - Illegal character in path at index 0

2012-08-05 Thread Helder Magalhães
Hi John,


 Is there a workaround/fix for the following build failure message?

A workaround was already proposed by you [1]. ;-)


 It seems that this is a year-old bug, started in the 1.7 build jars.

Apparently it started way before that. I could trace related changes
to around 2003...


Nevertheless, I've just committed a fix in trunk (future version 1.8),
so feel free to try it out and confirm that it helps.


Cheers,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=51908#c3

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Rendering CSS in JSVGCanvas

2012-03-14 Thread Helder Magalhães
Hi everyone,


    We don't support the CSS hover property.  You can achieve the same basic
 effect with script however.

After the good hint from Thomas, you might be interested in taking a
look at the project status [1] to check for other possible things with
limited support and/or known caveats.


Cheers,
 Helder

[1] http://xmlgraphics.apache.org/batik/status.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Batik still does not compile with Java 7

2012-03-11 Thread Helder Magalhães
Hi everyone,


 I just tried to compile batik svn from today with Oracle JDK 7u3 (on Windows, 
 under cygwin) and it failed with multiple errors of the form

 error: package com.sun.image.codec.jpeg does not exist

 It works with Sun JDK 1.6.0_20.

Right. A quick research showed that it appears to be a bug (or
feature) in JDK 7: what happens is that both can be found (the source
files in src.zip and the corresponding class files in rt.jar) but
something is blocking their access. Without further research, I'm
guessing that they are still present in case some compatibility mode
is forced in JDK and access to the classes is then allowed.

I didn't realize this first because this is configurable, and my local
copy has that setting for a while: just create a file named
build.properties in the root Batik directory (next to build.xml)
and add the following line:
sun-codecs.disabled=true

I'll try to check if the heuristics performed (by Ant) in build.xml
can be improved (if someone has an idea, please share!). In the
meantime the configuration described can be used as a workaround. :-)


Cheers,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: errors in viewing svg file. help needed

2012-02-01 Thread Helder Magalhães
Hi wolnic,


 Any suggestions why the image don't work with batik 1.7 ?

I tried with Batik 1.8 trunk version and here are some hints:
 * attempt to prototype things is apparently confusing Rhino
(Javascript engine);
 * window.* methods (like innerWidth/Height) are not supported and
therefore lead to NaN;
 * inherited is not a valid value for visibility (found twice,
should be inherit);
 * SVGRoot.style.cursor = move doesn't work, although
SVGRoot.setAttribute(style, cursor:move) is equivalent and works.

You can have further feedback by taking a look at the Java console or
by running Batik from the console.


 Thanks.

Hope this helps,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: errors in viewing svg file. help needed

2012-01-24 Thread Helder Magalhães
Hi wolnic,


 but in batik version 1.7 the file gets erros and cannot displayed correctly
 like firefox

Just checked in Batik 1.8-pre (development version) and confirmed that
the problem is the doctype being used: it isn't supposed that quotes
are escaped (as quot;) at that point. Replacing the guilty lines
with:

!DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN
http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;

Works around the problem.

In the meantime, the specification states that it is not recommended
that a DOCTYPE declaration be included in SVG documents [1] so, if
you or your software support that sort of configuration, you may want
to review it.


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/intro.html#NamespaceAndDTDIdentifiers

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Create a multi page pdf using Batik

2011-08-22 Thread Helder Magalhães
 Hi,

Hi Dayana,


 How is it possible to create multiple page pdf using batik PDFTranscoder?

 My SVG file is very big and I wish to convert it to multiple pages in pdf to
 print it across mutiple pages

If you crawled through the mailing lists, you'd find a couple
interesting threads [1] [2]. ;-)

The best approach (coding or using an additional tool) will depend on
your expertize.


 Any advice would be highly  appreciated.

 Thanks,
 Dayana

Good luck,
 Helder


[1] 
http://batik.2283329.n4.nabble.com/Multiple-pages-with-PDFTranscoder-td2972320.html
[2] http://batik.2283329.n4.nabble.com/Creating-multiple-page-pdf-td3435523.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: batik stopped working

2011-08-18 Thread Helder Magalhães
 Hi,


Hi Mattijs,


The same day, last Friday the 12th of August, it just stopped working. It
 seems that it can’t generate a file in the temp folder.

 ** **

 I have looked into the log, and I see this error message:

 [15-Aug-2011 12:06:08] PHP Warning:  shell_exec() [a
 href='function.shell-exec'function.shell-exec/a]: Unable to execute 'java
 -jar batik-1.7/batik-rasterizer.jar -m image/png -d
 temp/273f5064dc00c682c73b05f36d00f2a1.png -w 800
 temp/273f5064dc00c682c73b05f36d00f2a1.svg' in
 D:\inetpub\webhost\5836\www_export\index.php on line 70

 [15-Aug-2011 12:06:08] PHP Warning:
 unlink(temp/273f5064dc00c682c73b05f36d00f2a1.png) [a
 href='function.unlink'function.unlink/a]: No such file or directory in
 D:\inetpub\webhost\5836\www_export\index.php on line 87

 **


This log doesn't help diagnosing Batik but only a possible
PHP/permission/disk space issue...


I have set all permissions to max for the whole website, so it should have
 write rights.

 Also, when I post to export.highcharts.com, the Highcharts server, it
 works fine. So the SVG (which is generated by Highcharts) seems to be valid.
 


Well, I'd say that first you should attempt to diagnose your service with a
simple file (such as the ones included in Batik samples) to be sure that it
is working properly. You may also quickly start by running the same command
line (displayed in the error message above) using a command prompt to make
sure it works.

If all that works and a particular file (or set of files) still triggers the
unexpected error, please attach it to a follow up message, else it will be
very hard to provide any additional assistance. ;-)


 I hope you can give me a push in the right direction.

 ** **

 Regards,
 Mattijs Spierings


Hope this helps,
 Helder


Re: generate DXF File

2011-06-30 Thread Helder Magalhães
Hi Olaf,

 I´m looking for a solution to convert an svg (batik) to DXF.
[...]
 On the other hand I start thinking about doing this by myself.

 What could be an a approach -  writing a transcoder or using the GVT Tree ?

Although the name is somehow misleading, taking a look at the
rasterizer [1] would be my hint (note the output support for PDF, a
vector format), specially if you intend to share/contribute the code
afterwards.

Cheers,
 Helder

[1] http://xmlgraphics.apache.org/batik/tools/rasterizer.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Combine SVG out of single SVG files

2011-06-22 Thread Helder Magalhães
Hi everyone,

 One way to do it...assumes the file was read and placed into a byte array by
 loadMyFile() (your implementation).
 All fluff and exception handling removed, but the basic sequence is:
[...]

Apart from this (good) suggestion, note that SVG also has an import
mechanism, namely the 'use' element [1]. Just in case someone missed
it! ;-)

Cheers,
 Helder


[1] http://www.w3.org/TR/SVG11/struct.html#UseElement

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Empty batik.jar and version identification

2011-06-14 Thread Helder Magalhães
 Hi all,

Hi Daniel,


 quick note at first: I send this question to the mailing list last week.
 Today I saw that there was a verification mail for subscription. I don't
 know if my first email has been broadcastet through the mailing list.

Yes it did [1]. ;-)


 If the first mail
 came in, please answer to the first one and ignore this mail.

Henryk already replied to your message. Please check the archived
thread if you aren't receiving the messages yet.


 Sry for
 inconvenience.

Cheers,
 Helder


[1] 
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/201106.mbox/browser#msg-9

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: text-anchor: middle bug?

2011-06-12 Thread Helder Magalhães
Hi Henryk,


 Effectively, the problem
 appears to be that under some circumstances, text-anchor: middle does not
 work, and instead aligns the text somewhat in the text-advance direction of
 where it ought to be; specifically, in the figure below, the line should
 bisect all three tspans, but fails to do so for the second of them.
[...]
 If a text element contains additional tspans, all but the last will be
 shifted.

Humm... Could this be the same as bug 49736 [1]? The whitespace
removal workaround should help confirming it.


Cheers,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=49736

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: batik osgi bundles

2011-06-06 Thread Helder Magalhães
 Dear Helder,

Hi Martina,


 Thanks for your reply.
 We are using the batik library which is downloadable form the download page.
 So I downloaded the binary distribution for JRE 1.4+ and there we are using
 all the jar files in the lib folder (batik-anim.jar,
 batik-awt-util.jar,...).
 I want to use these as OSGi bundles in my application.

OK, I took a quick look at what's involved and it seems all that it's
necessary is appending metadata to the manifest [1].


 I could easily make them into bundles myself, [...]

Great, that means you already have the knowledge. Could you please
file a bug [2] so that we can try to address this in the shipped jars
for the next release? If possible attaching a patch and/or which
proposed metadata you had in mind. Thanks.


 but I am not completely sure
 about the dependencies between the separate jar files. So I was wondering if
 you 1) have already a OSGi bundle version of these libraries? or (2) can
 help me with figuring out the dependencies between them.

1) No. Recently, bmargulies has helped adding Batik to maven, but
apparently it was compiled with JDK 1.6 [3].
2) Maybe. Batik provides a dependency graph [4], although it's a bit outdated.


 Thanks,
 Martina

 Hope this helps,
 Helder


[1] http://blog.springsource.com/2008/02/18/creating-osgi-bundles/
[2] 
https://issues.apache.org/bugzilla/buglist.cgi?query_format=specificbug_status=__open__product=Batik
[3] https://issues.apache.org/bugzilla/show_bug.cgi?id=51263
[4] http://xmlgraphics.apache.org/batik/install.html#dependencyGraph

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: batik osgi bundles

2011-06-03 Thread Helder Magalhães
 Hello,

Hi Martina,


 I want to use batik within my OSGi application. Are there already bundle
 versions of the batik library available?

Do you mean the ones available in the download page [1]? Note that you
have instructions about source code access there as well.

Also, Cameron has been providing nightly builds [2] for a while, if
you want to try the latest version and don't want to setup a source
code/build environment. ;-)

Please be more specific if that doesn't help.


 Best Regards,
 Martina Kutmon

Have a nice weekend,
 Helder


[1] http://xmlgraphics.apache.org/batik/download.cgi
[2] http://mcc.id.au/batik-nightly/

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Is Batik Bug Report 44151 fixed?

2011-01-11 Thread Helder Magalhães
 Hi All, Pahonel Laviniu and Helder Maglhaes,

Hi Scott,


  I have the same problem with Batik Bug Report 44151, which is reported
 by Pahonel Laviniu

 And also reported by Helder Maglhaes at 2009-5-15.

I didn't report the issue, I just updated its summary [1].


  I am wondering whether this bug report related to Batik component SVG
 Rasterizer get fix
 Or not.

If/when it gets fixed, the issue *will* be closed...


    I sent out an e-mail on Friday, December 17, with very detailed
 description of this issue, which
 I encounter during Batik application by using Batik API to rasterize a SVG
 format China Airline
 Passenger boarding pass to PNG format. (The problem that I reported is not
 Sun’s version JPEG
 Decoder problem because I created an image, encoded and decoded by the same
 Sun’s IPEG
 Codec software and it works good.

I don't understand this. Are you *not* using Sun's classes to perform
the work? You may be interested at take a look at bug 46513 which is
tightly related with that.


    For around 2 weeks, I have got back from anyone. So, I really
 appreciate that someone can tell
 How Batik bug report 44151 get resolved.

When that (silence) happens, it's either because active
developers/users are very busy and/or because you didn't ask the
question in a smart way [3]. In this case, I guess it's both (asking
for an update on an item in the bug tracker without confirming it
using the source code [4] is generally a waste of time for
everyone...). ;-)


     Hopefully, I get some luck this time!

You did: I'm homesick today so I have some extra time for stuff like
this (instead of fixing Batik bugs, could you imagine that?!). :-D


 Thanks,
 Scott Lo

Hope this helps,
 Helder


--
Helder M. A. Magalhães
http://heldermagalhaes.com/


[1] 
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/200905.mbox/%3c20090515180323.03ff6234c...@brutus.apache.org%3e
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=46513
[3] http://catb.org/~esr/faqs/smart-questions.html
[4] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: BATIK RASTERIZER under Linux is not rendering TEXT

2010-12-20 Thread Helder Magalhães
Hi Petronel,


 BATIK RASTERIZER under Linux is not rendering TEXT
 Anyone please have any ideea what can be wrong with this ?

It's funny that's under Linux and you provide almost no information
(Java vendor, JDK/JRE version, Linux flavor - remember there are
dozens!, Batik version, etc.) but it might be related with bug 47917
[1].

Please confirm if so and add, at least, the missing information above
and other you may find interesting to help us understanding what's
happening.

Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=47917

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Minimum acceptable/desired Java version and related thoughts

2010-11-13 Thread Helder Magalhães
Hi everyone,


 In the scope of bug 46434 [1], I believe it was highly desired to have
 user feedback about this.

It's great to see user expressing their feedback, thanks! :-)


 FYI, Java 5 is already end of life as well, http://java.sun.com/j2se/1.5/

Yeah, but Java for Business releases will be supported for up to
eight years from initial release date [1], which means that 1.5
should still be around for a few years more. ;-)


 Cheers
 Tonny Kohar

Cheers,
 Helder


[1] http://www.oracle.com/us/technologies/java/java-for-business-071123.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Minimum acceptable/desired Java version and related thoughts

2010-11-07 Thread Helder Magalhães
Hi everyone,


In the scope of bug 46434 [1], I believe it was highly desired to have
user feedback about this. To sum up, the question is which Java
version are you using and/or, tightly related, whether you'd agree to
raise the minimum version to Java 1.5.

Note that currently in 1.8-pre (trunk version, available through
SVN/nightly builds) the requirement was already raised to Java 1.4 (in
contrast with the 1.7 release, which had a mix of Java 1.2 and 1.3,
the latter allowing some more advanced features whenever available.

So, I'm asking who (and why):
1. Is still using Java 1.3 in production environment(s)?
2. Would be affected by the current Java 1.4 as minimum (which is
already done, so this is mostly an alert, as well as the desire to
have more user feedback on this).
3. Would oppose to switching to Java 1.5 still in the scope of the
next release (although, for what it's worth, as I've stated myself [2]
I'd vote against that before releasing a stable version). :-)

Also, if you have good technical/practical reasons to support your
answers, please don't just skip them - make sure they are properly
explained so we all can know/learn about it. ;-)


Cheers,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=46434
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=46434#c5

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: How to remove a JSVGComponent AND killing the threads created by it?

2010-11-01 Thread Helder Magalhães
Hi Andreas,


 Thanks for your reply! I've been finally able to fix the problem. However I 
 don't think that the patch provided on Bugzilla works.
 Therefore here my changes on the CleanerThread class for anyone interested:

Overall, it looks good. Could you turn it into a patch and attach to
the relevant bug, please? (And add a link to that message/thread [1]
as well). Thanks! (If you are unable to/not interested in
contributing, at least confirm it so one can try to pick up from
here.) :-)


 I capitalised the constants:
[...]
 And introduced a control variable for the thread:
[...]
 A static access method for the singleton implementation of the CleanerThread. 
 Please note that the user Archie Cobbs is right with his estimation, that the 
 existing method isn't thread safe (although the suggested double check lock 
 won't work). I got several instances of CleanerThreads with the existing code:
 And one for the ReferenceQueue (which isn't actually a singleton):
[...]
 The CleanerThread-constructor should at least throw an exception if one tries 
 to create more than one instance:
[...]
 The run method evaluates the control variable, which is only possible if we 
 use the timeout facility of the remove method:
[...]
 And finally the exit method, which can be called to stop the CleanerThread:
[...]
 I identified furthermore the UpdateManager as a source of these 
 RunnableQueue-nn and Timer-nn threads. A call to interrupt stops these 
 threads, maybe its somewhere documented, but I couldn't find it:
[...]

The reasoning is very coherent and sounds fine - I'd even invite you
to consider becoming an active contributor through being more active
in the mailing list and/or even pick up on a few open issues [2]...
;-)

@Other developers: what do you think about this? Overall, to me they
look good but I'm not enough into the details to properly estimate the
impact introduced by the these changes.


 Remains the question why Batik needs all this thread-stuff? Unfortunately I 
 don't have the time to figure this out.

I guess this is already answered in the previously provided link: it
has to do with thread safety [3]. ;-)


 The solution above works fine for me.

Glad to hear you find your way! :-)


 Cheers,
        Andreas

Thanks for sharing,
 Helder


[1] 
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/201011.mbox/browser#msg-1
[2] 
https://issues.apache.org/bugzilla/buglist.cgi?query_format=specificbug_status=__open__product=Batik
[3] http://xmlgraphics.apache.org/batik/using/scripting/java.html#Threads

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: How to remove a JSVGComponent AND killing the threads created by it?

2010-10-30 Thread Helder Magalhães
 Hi everybody,

Hi Andreas,


 I created a GUI using several instances of the batik JSVGComponent. Some
 of these components gets removed after a while, e.g. dialogues. Though
 each comnponent creates some threads, called RunnableQueue-nn and
 Timer-nn.
 Where are these threads created and why?

Actually, there's plenty of good documentation available (IMO, without
being too lengthy and boring, Batik documentation is one of the best
I've seen in OSS projects). You may be interested in taking a look at
scripting with Java [1] (that's what's probably happening under the
hood. :-)


 And most importantly: how can I
 get rid of them?

A quick look at open bugs [2] (note that several were fixed since
Batik 1.7 - they relate with the trunk SVN version) showed bug 48771
[3] as the potential guilty. You could help by testing that patch and
add your results to the bug report [3]. Thanks! ;-)


 Any hints are highly appreciated!

 Cheers,
        Andreas

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html
[2] 
https://issues.apache.org/bugzilla/buglist.cgi?query_format=specificbug_status=__open__product=Batik
[3] https://issues.apache.org/bugzilla/show_bug.cgi?id=48771

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Nagabhushan Sss is out of the office.

2010-10-22 Thread Helder Magalhães
Hi Nagabhushan,


 I will be out of the office starting  10/19/2010 and will not return until
 10/25/2010.

 I will respond to your message when I return.
 For an urgent issue, please contact Rachna Issar

I believe this has already happened in the past. Again, please
consider disabling out-of-office replies to this (and other) mailing
list address(es) to avoid further nagging. Note that this is part of
common sense and/or mailing list netiquettes [1]. ;-)


Cheers,
 Helder


[1] http://tortoisesvn.tigris.org/list_etiquette.html (yeah, I known I
should have crawled for the particular ASF-related netiquette, but I
particularly like this one and am quite short of time at the moment.)

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Oracle (previously Sun) JDK/JRE: couple of imageio fixes + critical security update

2010-10-14 Thread Helder Magalhães
Hi everyone,


Today I stumbled across the (Oracle) SE 1.6 update 22 release notes
[1]. Initially, it made me curious about a couple of imageio-related
issues [2] [3], something which may become useful in the scope of
related Batik issue 46513 [4] (possibly/probably there is also related
interest in the scope of xmlgraphics-commons [5] and/or FOP [7]).
Afterward, I noticed the highly relevant security fixes [7], which may
currently affect most (any?) current Java-based project, with the
specially alarmist nuance of potentially exposing Java applets and Web
start applications (which is pretty serious in my opinion). Note that
the security issue, as far as I could see, affects all known Java
versions (ranging from Java 1.3.x to 6.0, previous versions probably
just unlisted due already been EOL'ed).

I'm thinking if this may worth a mention in the software download
pages, kind of the Batik 1.5.0 release security warning [8]...? (Yes,
it's not the same as this is due to a VM issue but... How to others
feel about this?)

Please forward at will, keep software updated and please reply to
general@ only to avoid (more) cross-posting. (Non-Oracle users and
watchers of several of the targeted mailing lists, please excuse the
spam-effect, if any.)


Cheers,
 Helder


[1] http://www.oracle.com/technetwork/java/javase/6u22releasenotes-176121.html
[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6547241
[3] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6557086
[4] https://issues.apache.org/bugzilla/show_bug.cgi?id=46513
[5] http://xmlgraphics.apache.org/commons/
[6] http://xmlgraphics.apache.org/fop/
[7] http://www.oracle.com/technetwork/topics/security/javacpuoct2010-176258.html
[8] http://xmlgraphics.apache.org/batik/index.html#download

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVGGraphics2D cannot reproduce gradients (Bug 42387)

2010-10-10 Thread Helder Magalhães
Hi tiwaris,


 I am facing the exact same problem as described in Bug 42387.

 https://issues.apache.org/bugzilla/show_bug.cgi?id=42387

No, I believe you have faced bug 49558 [1]. I've marked it as
duplicate (although works for me might be formally more correct as
there's no formal proof) to reflect that.


 This is what I am doing in my application.

 I am drawing my model which contains SVG icons. Now I want to add the
 functionality to store a snapshot of my model as SVG file. This amounts to
 Rendering a GraphicsNode object onto SVGGraphics2D. Th gradients are
 painted black in my model.

Yup, this really seems like bug 49558. Please attach a test case to
bug 42387 and reopen it if it's still occurring after following the
suggestions below.


 This bug is marked resolved as of 2007. I am using Batik 1.7, but am still
 seeing this bug.

 Any ideas/helpful suggestions?

You may try to apply the changes made by Thomas (in revision 961322
[2]) to your working copy if you are compiling Batik from source.
Else, you may want to try with a 1.8pre nightly build [3] and check if
it helps (if it does, please confirm it by replying to this thread or
to bug 42387).


Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=49558
[2] http://svn.eu.apache.org/viewvc?view=revisionrevision=961322
[3] 
http://xmlgraphics.apache.org/batik/download.cgi#Current+development+snapshot

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Nabble mailing list interface: migration request

2010-10-10 Thread Helder Magalhães
Hi everyone,

I've asked [1] the Nabble team to migrate the Batik forums [2] to the
newest format. There were some issues with the current
(old.nabble.com), detailed in my request [1] for whoever is curious,
and I believe that migrating to the current (nabble2) interface is
probably better than hanging to something which is frozen and might
get into more issues as time elapses. ;-)  As a negative side-effect,
new accounts will need to be created. Sorry for the hassle! :-)

(For who doesn't know, Nabble [3] is a mailing list interface service
which beside indexing them, allows to post directly from the site and,
specially, provides search features which AFAIK the official interface
[4] [5] doesn't provide - if anyone is aware of how to perform
searches using the official interface, please correct me! On the other
hand, Nabble only indexes messages since about 2005-6 therefore older
threads are missing.)

Cheers,
 Helder

[1] 
http://nabble-support.1.n2.nabble.com/Migrating-forums-from-Nabble1-to-Nabble2-td3791390i220.html#a5620036
[2] http://old.nabble.com/Batik-f308.html
[3] http://www.nabble.com/
[4] http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-dev/
[5] http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Batik and XmlHttpRequest / accessing Batik objects from javascript in svg

2010-10-07 Thread Helder Magalhães
 Hi there,

Hi Roland,


 The difficulty is WHEN to bind the object. First try was to simply call it
 in the init()-Method of the Applet after using canvas.setURI(…). However,
 this method is async, so my bind-method will not yet find even a
 bridgeContext (it is null). Therefore, I thought it would be best to bind
 the object AFTER the document is loaded (via setURI) by using something
 like:
snippet/
 Currently, this should bind the canvas (later it should be the applet) to
 the name “parentapplet” in the interpreter and I should be able to use this
 name as a global variable in my ecmascript, e.g. like alert(parentapplet);
 Correct?  However, an exception is thrown when binding the object:

 ### Document loaded

 ### Binding Object
 test.MySVGCanvas[,0,36,1000x964,alignmentX=0.0,alignmentY=0.0,border=,flags=288,maximumSize=,minimumSize=java.awt.Dimension[width=100,height=100],preferredSize=java.awt.Dimension[width=200,height=200]]
 to interpreter.

 java.lang.RuntimeException: Unknown document

     at
 org.apache.batik.bridge.BridgeContext.getInterpreter(BridgeContext.java:558)
[...]
 Any suggestions what I’m doing wrong here?

I haven't quite understood your document onload mechanism but there
are a few good examples using addSVGLoadEventDispatcherListener and
addEventListener with SVGLoad [1]. You may also try running that
once the document is already executing, using a runnable thread [2].


 Many thanks again,

 Roland

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html#Swing
[2] http://xmlgraphics.apache.org/batik/using/scripting/java.html#Threads

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Batik and XmlHttpRequest / accessing Batik objects from javascript in svg

2010-10-05 Thread Helder Magalhães
Hi Roland,


 Regarding communication, I already use getURL() now. However, there seems to
 be a bug that has already been mentioned here, but was confirmed as fixed.
 Yet it still (or again) seems to exist: I cannot use getURL() inside an
 Applet (works fine in squiggle)  without granting a right to create a
 Classloader via a java.policy file in the user home directory:

 Please have a look here:
 http://old.nabble.com/Batik-Applet-and-getURL-XMLHttpRequest--td18105942.html

Yes, the post leads to revision 677245 [1], where the fix (by Thomas)
was committed.


 Ok, while rereading the above post, I realized that this fix is not included
 in the current release version 1.7 I use. Is that correct?

Right, that commit was made after the 1.7 release.


 The fix is from
 2008 in 1.8Alpha ?! It seems there hasn’t there been any further major
 release since that?

Right again. It's in the current trunk code and (unfortunately) there
was no 1.7.1 release. Currently things are moving on and I hope there
will be a 1.8 release (see bug 50045 [2]) in a not-so-far future. ;-)


 Hmm, that’s sad, because I managed to handle several
 problems now – but the requirement of a java.policy file on the user’s
 computer is a real showstopper. How stable are current SVN-Releases that
 include the fix? Is it possible to use them in a productional environment?

IMHO using the SVN checkout and/or a nightly build [3] is already
better than the 1.7 release as there were a few notable bugs (such as
this one) fixed since the release. But of course that not being
released yet means exactly that. So it is possible to use in
production *but* you are the one which should evaluate and assume the
risk.

Nevertheless, if you are not willing to take the risk, you may simply
download/checkout the 1.7 release code and simply patch your working
copy (taking a look at the modification made by Thomas [1], it should
be quite similar if not exactly the same). ;-)


 Thanks again,

 Roland

Hope this helps,
 Helder


[1] http://svn.apache.org/viewvc?view=revisionrevision=677245
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=50045
[3] 
http://xmlgraphics.apache.org/batik/download.cgi#Current+development+snapshot

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Batik 1.5 - export control request

2010-09-29 Thread Helder Magalhães
Hi Julie,


 Could you please indicate whether the Apache software Batik 1.5 contains
 specific export control requirements and what is the export control
 classification number of this software as I do not find any export provision
 is the copyright license?

I'm not a lawyer so I'm not able to answer your question. Maybe you
are able to find answers in the ASF licenses page [1], in particular
in the FAQ [2]...?

Also, you should be aware that a known script security issue exists in
that particular Batik version [3], so consider upgrading! ;-)


 Thanks for your prompt answer

 Regards,
 Julie NOIROT

Hope this helps,
 Helder


[1] http://www.apache.org/licenses/
[2] http://www.apache.org/foundation/licence-FAQ.html
[3] http://xmlgraphics.apache.org/batik/index.html#download

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Javascript and Batik Applet

2010-08-19 Thread Helder Magalhães
Hi Mark,


 I think you're missing the rhino jar from your classpath.

Apparently not. According to the original message:

 My class path includes
 batik-dom.jar, batik-swing.jar, batik-util.jar, batik-awt-util.jar, 
 batik-bridge.jar, batik-css.jar,
 batik-ext.jar, batik-gvt.jar, batik-parser.jar, batik-script.jar, 
 batik-svg-dom.jar, batik-xml.jar, xml-apis-dom3.jar and js.jar

So all three (js.jar - Rhino, batik-script.jar and batik-bridge.jar)
seem to be as expected. Unless the file is actually not there! :-D

The Jar dependency graph [1], although slightly outdated, usually
helps in determining this sort of things. ;-)


Cheers,
 Helder


[1] http://xmlgraphics.apache.org/batik/install.html#dependencyGraph

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Problem with transcoding svg file that contains reference to animated gif

2010-08-19 Thread Helder Magalhães
Hi Arek,


 I have encountered problem with transcoding svg file that contains reference 
 to animated gif (batik transcoder hangs on 'transcode' method).
 Problem was reported in

 https://issues.apache.org/bugzilla/show_bug.cgi?id=28806

 and occurs in version 1.7.

 Does anyone could help with resolving of this issue?

Maybe you can! :-)  Consider attaching new information to the bug
report, such as how to reproduce the bug, attaching an additional GIF
which reproduces the issue, etc. or maybe even rehearse a patch? Make
sure to CC yourself there in order to receive updates. ;-)

FWIW, if memory isn't playing tricks with me I believe that
unfortunately I was able to reproduce it with the 1.8pre not very long
ago, while running through open bugs in order to check for potential
updates. (I didn't find anything new at the time so no bug status
updated nor any message added usually means nothing new...)


 Regards,
 Arek

Cheers,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Cannot stop default arrow key actions - Solution?

2010-08-17 Thread Helder Magalhães
Hi Joel,


Please reply to previous thread messages (in this case, [1]) in order
to avoid creating multiple thread about the same subject: it eases a
bit searching and browsing through the mailing list, etc.. ;-)


 I seem to have fixed the problem. But I an not sure it is the best way to
 do it...

 I extended the JSVGCanvas and  orverrided the installKeyboardActions()
 method.  In the installKeyboardActions() I commented out the key maps I did
 not what.

 Not sure if this is a good way to do this? I does work. Any suggestions of a
 better way, please tell me.

I believe there's currently no way of doing it differently. I've
reported bug 49762 [2] so that it doesn't get lost. Please comment
and/or add yourself to the CC list if you want to get notified of
changes. As always, patches are welcome so consider contributing one!
;-)


 Below is my code:
[...]
         // I comment out the four key Actions I don't want. (So I my
 Interactor can use them exclusively.)
         /*
         key = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0);
         inputMap.put(key, SCROLL_RIGHT_ACTION);

         key = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0);
         inputMap.put(key, SCROLL_LEFT_ACTION);

         key = KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0);
         inputMap.put(key, SCROLL_UP_ACTION);

         key = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0);
         inputMap.put(key, SCROLL_DOWN_ACTION);
          */

         key = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
 KeyEvent.SHIFT_MASK);
         inputMap.put(key, FAST_SCROLL_RIGHT_ACTION);

         key = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK);
         inputMap.put(key, FAST_SCROLL_LEFT_ACTION);

         key = KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.SHIFT_MASK);
         inputMap.put(key, FAST_SCROLL_UP_ACTION);

         key = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK);
         inputMap.put(key, FAST_SCROLL_DOWN_ACTION);

Maybe you want to disable these as well? (Shift+cursor keys.) ;-)


Cheers,
 Helder


[1] 
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/201008.mbox/%3caanlkti=p=kdcl3vr1sexhrjdxw+ahm4gu1aebamtd...@mail.gmail.com%3e
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=49762

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Javascript and Batik Applet

2010-08-13 Thread Helder Magalhães
Hi Bob,


(Sorry for the delay in answering: this message got lost in my drafts folder.)


 For too many bureaucratic, security and policy reasons I have been tasked to
 create an javascript based SVG viewer for IE.

Cool, it's one of the things I'd like to do myself, but time is my enemy... :-)


 I've been able to get the
 applet demo from the 1.7 distribution to display one of our more complex
 images, but all onclick events trigger the following error:

 java.lang.NoClassDefFoundError: org/mozilla/javascript/WrappedException
        at
 org.apache.batik.script.rhino.RhinoInterpreterFactory.createInterpreter(Unknown
 Source)
[...]

There was at least one related fix (rev. 677245, Thomas) which you
should be aware of. I'm not sure if it was the causer of this but, as
a quick glance into your classpath didn't show any showstopper, I'd
hint you to use the 1.8pre trunk version (that particular fix, and
many more, were done after the 1.7 release). Nightly builds, although
slightly outdated, are available [2], if you just want to make a quick
check. ;-)

If updating the Batik environment doesn't help, please post the
relevant parts of your applet (at least if it's significantly
different from the available applet demo [3]).


 Any guidance, direction or samples would be greatly appreciated.

Hope this helps,
 Helder


[1] http://svn.apache.org/viewvc?view=revisionrevision=677245
[2] http://mcc.id.au/batik-nightly/
[3] http://xmlgraphics.apache.org/batik/demo.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG generated file not opening correctly in Browser

2010-08-12 Thread Helder Magalhães
Hi Chris,


 [...] but when I open the file with a
 browser it doesn't open correctly(have tried
 both Firefox and Opera, just done 'File,Open'). I have attached a
 snapshot of how the file is displayed in Firefox,
 the chart is squashed(exact same in Opera). But when I open it in
 InkScape(SVG graphics editor) it opens perfectly.

I'm not sure what you mean with squashed. Can you elaborate a bit
[1]? Also, you have attached a screenshot of how it displays
unexpectedly but not a screenshot of how you expected it to be. In the
absence of the resulting SVG file, this triggers the guys, guess
what's happening! mode. ;-)

Nevertheless, my quick guess is that no particular squashing is
happening: I can only see text overflowing other graphics content. If
so, then you are simply suffering from a common issue with graphics in
general which is text formatting/alignment. Note that if you don't
specify font and font-size property, the implementation will use a
fallback font family/font size which will then vary and may yield such
unexpected results. As a quick fix attempt, set a default font
behavior by setting the font-family (remember to include a generic
font family [2]) and font-size attributes in the root svg element,
as in:

svg [...] font-family=Helvetica, Arial, Tahoma, sans-serif font-size=11
  [remaining graphics]
/svg


 Any info appreciated.

Hope this helps,
 Helder


[1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
[2] http://www.w3.org/TR/CSS2/fonts.html#generic-font-families

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: JSVGCanvas Problems - Rendering and Writing

2010-08-10 Thread Helder Magalhães
Hi Eric,


 First, if we use DOMUtilities to write out the Document from our
 canvas, we get a duplicate xmlns attribute in the resulting SVG file,
 causing every viewer I've tried to refuse to render it. This is only a
 minor inconvenience, but seems like a real bug. I've only observed the
 problem under Windows 7 64-bit, but I haven't checked under other
 operating systems yet. We're using the Batik 1.7 libraries.

Weird. When you mean duplicate, to which one are you referring, the
one for the SVG namespace? Please paste a short snippet containing the
duplicate attribute. Are you able to check if this still reproduces
using Batik 1.8pre? There are (slightly outdated) nightly builds [1],
handy when no build environment is available.


 Second, and much more severe for our purposes: JSVGCanvas seems to
 differ from our intentions (and both Firefox and Chrome) in rendering
 multiple tspan's inside a text element with the
 text-anchor=middle property. When we use either our own Canvas or
 Squiggle, all but the last tspan render their content as if they had
 text-anchor=start - the last one renders 'correctly', with text
 anchored at its middle.

I confirm that it appears to be buggy behavior and have reported bug
 [2]. Playing with the issue I found a workaround: you seem to
have trailing space in all but the last tspan elements (within the
several available text elements). If you trim that whitespace, the
issue no longer reproduces. ;-)

Note that Firebug also has a related bug [3] while dealing with
text-anchor=end which may also become handy if you are making
further experiments with this. :-)


 This behavior repeats on both Windows XP
 32-bit and Windows 7 64-bit. Strangely enough, this gets different
 behavior on Linux... On Linux (Ubuntu 10.04, to be specific), all
 tspan's in such a situation render correctly.

Again, weird. I've marked the bug as Windows-only, and I'm holding
that someone can confirm this for MacOS as well.


 Here's a sample SVG file where you can see the difference in
 rendering. The only edit I've made to it is to remove the duplicate
 xmlns attribute, so it can render successfully.

I'm attaching the modified test case which no longer reproduces the
issue. The only modification I made was replacing  /tspan with
/tspan (which effectively trims all the trailing spaces found in
tspan elements).


 Thanks,
 - Eric Astor

Hope this helps,
 Helder


[1] http://mcc.id.au/batik-nightly/
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=49736
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=503075
attachment: lastCharmTree-TrailingWhitespaceTrimmed.svg
-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Re: Unable to read more than 1MB file

2010-04-23 Thread Helder Magalhães
Hi Prashanth,


 I am using batik1.7 to view the svg files, but the thing is i am not able to
 open the more than 1MB of file. Can you please help me out in this matter.

One megabyte of SVG can take quite a bit of memory, depending on
content (filters, animation, etc.). :-)

Note that the default memory partition for java is ridiculously
small [1] and you should increase it for this kind of documents. Try
something like:

java -Xmx1024m -jar batik-squiggle.jar

More information available in the already stated link [1].


 Please reply me as soon as possible.

 Thanks and Regards:
 Prashanth H S

Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=43369#c3

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Line element does not render with gradient stroke

2010-04-09 Thread Helder Magalhães
Hi Teck Hua Lee,


Thanks for investigating and reporting this. :-)


 When using the PNGTranscoder (1.7 and trunk), I noticed that lines with
 gradient strokes will not render.
[...]
 Is this a known issue or should I file a bug?

Apparently it is correct as-is: a good explanation is available in a
similar test [1] for the SVG 1.1 Second Edition (both test suite and
specification are currently draft). You'll notice Batik matches the
reference rendering (I've checked with Squiggle trunk using the direct
SVG link [2]). Note that Opera 10.51 also matches the expected
rendering, while Firefox 3.7a and Chrome 5.0dev only partially pass
the test. ;-)


Cheers,
 Helder


[1] 
http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/pservers-grad-17-b.html
[2] http://dev.w3.org/SVG/profiles/1.1F2/test/svg/pservers-grad-17-b.svg

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: prob affinetransformation and bound

2010-04-05 Thread Helder Magalhães
Hi heran,


 i have a svg picture which is rendering in a graphic greater document.
 i get the graphicsnode from my builder
 i do translation and a scale up upon it.
 the i make a bufferizedimage (java) to draw it.
 result :
 i see the svg but partially !
 the svg itself is well resized (now greater) but the bounds (getBounds) is
 always the same so my svg is not completely visible because bounds seems not
 to be resized !
 it is like you consult this picture throw a small invisible window ! or like
 the center of this new svg is just draw !
 can you help me ? teaching me what is wrong or with an example code ?
 i have noticed also : if i use getTransformedBounds() to retrieve x,y for ma
 bufferedimage instead getbounds(), i have a new bounds but when i draw the
 svg, it is deformed and it seems an unknown translation has been
 applicated !

My guess is that there's some kind of unexpected values in the source
graphic regarding either 'width'/'height'/'viewBox' [1] attributes
versus the 'preserveAspectRatio' [2] attribute, all of them applicable
to the 'svg' element. Note that, when I mean unexpected values I
mean that the behavior can be less intuitive, although completely
valid according to the standard! :-)

Also, as Thomas has stated, an example with a simple code snippet
would help better illustrate the situation... ;-)

Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute
[2] http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: How to create a svg animate tag during runtime and animate it?

2010-03-15 Thread Helder Magalhães
Hi Fabian,


 first of all thanks for your reply, but if you create the elements (rect and
 animate) and then create the document and load it, it should be the same if
 you already drawn the elements in a svg file and open it.

Nope. :-p  Actually, there is a key difference between having the
animation elements initially and creating them afterward: the
document's timeline has already begun for the ones initially present
in the document! That's why you need the 'begin' attribute plus
'beginElement()' trickery, which is actually by design (according to
the SVG specification, if I'm not mistaken).  ;-)

I'd suggest trying with the latest available source code [1] (you
didn't state if you were using the trunk source code or a
snapshot/previous release). If you are following the suggestions in
this thread and you can still can't animate things, I'd say attaching
a simple (reduced) test case would help. ;-)


 Kind Regards,
 Fabian

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: How to create a svg animate tag during runtime and animate it?

2010-03-15 Thread Helder Magalhães
Hi Fabian,


 But what do I have to do, if I want to do exactly this during runtime?

 I've tried this:


 SVGOMAnimationElement animate = (SVGOMAnimationElement)
 this.svgDocument.createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI,
 SVG12Constants.SVG_ANIMATE_TAG);
 animate.setAttribute(dur, 1s);
 animate.setAttribute(values, 0; 0; 1; 1);
 animate.setAttribute(keyTimes, 0; 0.5; 0.7; 1.0);
 animate.setAttribute(attributeName, opacity);
 animate.setAttribute(attributeType, CSS);
 animate.setAttribute(repeatCount, indefinite);

 rect.appendChild(animate);

 animate.beginElement();


 but this didn't get animated, [...]

You'll need to provide a begin attribute set to indefinite in
order to be able to trigger animations using script [1]. ;-)

I'd seriously recommend diving into the SVG Primer online book (whole
page contents in [1]) before serious SVG hacking! ;-)


 Any help is very appreciated
 Thanks in advance.

Hope this helps,
 Helder


[1] http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#beginElement

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: How to compress Batik with Proguard ?

2010-03-14 Thread Helder Magalhães
Hi Stefano,


 I'm using batik for a very simple application, and it's a shame that I'm
 forced to use more than 10Mb of libraries for that.

Yup, I guess the large size is negative, specially for web
(applet-based) applications... :-|


 I tried to use Proguard to shrink the libraries, but the process always end
 with tons of warnings about unresolved references !

I guess John Turnbull investigated that a bit. If you crawl through
the mailing list archives for proguard you'll find some nits on
that. ;-)


 I've tried also to recompile the sources inside my project, but it's almost
 impossible to fix all the compiling errors (all related to unresolved
 references).

Those unresolved references sound weird. You are probably missing some
step from the default compile work flow (build.* batch files plus
build.xml)...


 Is someone able to shrink the batik libraries using Proguard, and post here
 an how to ?

I'd defy you and (again) John and whoever has tried/accomplished to do
that to share tips in a dedicated Wiki page, maybe in the How To
section [1]. (I'd vote for that over a mailing list thread but either
way is good, of course.) :-)


 Thanks all
 Stefano

Cheers,
 Helder


[1] http://wiki.apache.org/xmlgraphics-batik/HowTo

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Nightly builds

2010-03-10 Thread Helder Magalhães
Hi Cameron,


 I noticed recently that my Batik nightly builds haven’t been building
 since some time last year.  They should be building again now.  You can
 see a bunch of commits included in the build I kicked off earlier today:

Oops... Actually, I had noticed for a while already, but I thought
they were being built in a semi-automated fashion. Now I know I should
have confirmed it. ;-)

Thanks for putting things up again, Cam! :-)


  http://mcc.id.au/batik-nightly/

As we're at it, did you notice the 1.6 in the splash [1] image? ;-)



 Thanks,

 Cameron

Cheers,
 Helder


[1] http://mcc.id.au/batik-nightly/webstart/squiggle.gif

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Creating an image on the fly from a servlet

2010-02-27 Thread Helder Magalhães
Hi Jan,


 I finally got it. Weird. It isn’t still clear enough to me, but...

 If the image is being saved from a browser (FF  MSIE), the servlet is
 launched AGAIN. In this another request there are MISSING original
 parameters, so in my case it is catched and no output is written into the
 output. I didn’t revealed this behaviour during the previous debugging as
 this file intended to save was taken from a browser cache and the second run
 of my servlet wasn’t invoked.

While this is going somehow off-scope (of Batik), I'd hint towards the
double-download behavior being caused by lack of a cache policy
(provided by HTTP headers [1]). I'm not sure if I understand the
MISSING original parameters part, though. (It would be expected that
the original request would be reproduced when attempting to save the
file. At least, it made sense...)


Hope this helps,
 Helder


[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG Tiny

2010-02-24 Thread Helder Magalhães
Hi Gustavo,


 I would like to generate SVG in the Tiny format
 (http://www.w3.org/TR/SVGMobile/). There are plans to implement this
 functionality?

AFAIK, this is already (mostly, at least) implemented into the
framework. You may be interested in taking a look at the most recent
specification, which is SVG Tiny 1.2 [1]. ;-)


 I generate a chart (using JFreeChart library) and convert it to SVG, using
 Batik. If I  remove some tags like stroke-opacity and text-rendering, I
 can transform it in a valid SVG Tiny (http://validator.w3.org/check), but I
 would like to do this automatically.

Maybe you are not using the proper API to set the document type and/or
properties which trigger the intended behavior. Note that I haven't
tried to recreate the situation, given the somehow lack of information
(test environment, more clear goal, etc. [2]). Can you share a
simple/reduced test case which produces the unexpected attributes? You
may have stumbled across a bug, which is always interesting/important
to track down... :-)


 regards,
 Gustavo Ramos

Cheers,
 Helder


[1] http://www.w3.org/TR/SVGTiny12/
[2] http://catb.org/~esr/faqs/smart-questions.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Creating an image on the fly from a servlet

2010-02-22 Thread Helder Magalhães
Hi Jan,


 Although I can see the result in the target browser, I am unable to save the
 image on a local disk. Actually, in Firefox I can notice an attempt to save
 the file, but in a download manager it is of zero size and it is not really
 present in the target location. MSIE offers me save the PNG file in BMP
 format...

The fact that you can see it and cannot save it very weird. Even
weirder is the described MSIE behavior. If you are working with the
trunk code, maybe your are getting bit by bug 48693 [1]? If you are
working with Batik 1.7, that may be bug 46863 [2].

Could you try to analyze the (supposedly PNG) raw file saved and/or
attach it to a reply?


 Any tip is appreciated.

 Regards,

 Jan

Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=48693
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=46863

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: CleanerThread never terminates, causes leaks in webapp

2010-02-18 Thread Helder Magalhães
Hi everyone,


 GeoTools basically has the identical problem
 [http://jira.codehaus.org/browse/GEOT-2742]. I will investigate how to apply
 a similar approach and submit a patch.

I've just noticed bug 48771 [1] was created. (In general, it's always
good to have a link between mailing list threads and bug reports,
whenever they are tightly related such as in this case.)

Thanks,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=48771

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: CleanerThread never terminates, causes leaks in webapp

2010-02-17 Thread Helder Magalhães
Hi Joel,


 We are using Batik in a webapp context and the thread
 org.apache.batik.util.CleanerThread never terminates. This is a serious
 problem as it prevents the webapp's classloader from being garbage
 collected. Am I doing something wrong?  Is there a way to clean up and
 stop this thread when my webapp exits?

Well, it's hard to guess is something is being done wrong having
provided such little information... ;-)

I'm assuming you are embedding an JSVGCanvas such as demonstrated in
the demo [1] page...? (Source code quickly available there.)

If you can steadily reproduce this, I'd ask you to provide a code
snippet of your application and/or the SVG file(s) which are making
this happen. :-)

Finally, if you are using this within a webapp (I'm assuming a
client-side application, but this somehow applies to server-side as
well), I'm not sure if you'd even want to terminate the environment
many times: that can become a heavy burden. I'd suggest looking into
the possibility of (for example) hiding the canvas whenever not needed
and display it again only with the needed tweaks/newly created
document (somehow a.k.a. object pooling).


 Many thanks

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/demo.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Reload Style Sheet

2010-02-17 Thread Helder Magalhães
Hi vyang,


 I'm wondering if there is another way for JSVGCanvas to reload an external
 style sheet without having to reset the canvas document ie calling
 setSVGDocument().

Probably. ;-)

I'm not into the details as I never needed to do such thing, nor I
properly checked if Batik provides convenience methods for achieving
that but you seem to have several ways [1] of loading a style sheet.
So, while perhaps you *may* be able to rework the XML PI (in theory
it's not part of the document so I'm not sure how can one access it as
it shouldn't be in the DOM -- didn't check/test for this theory,
though), I'm not sure if Batik (and other implementations) will behave
properly when messing with the document this way. I'd recommend
dynamically inserting a link, using the DOM, which changes the
external style sheet definition:

  style type=text/css@import url(svgstyle.css);/style

Note that, when using this approach (also found in the already stated
link [1]), the previous style sheet will still be active, you'll
simply be inserting a new one. This means that one should be careful
to ensure that all declarations, or at least all the ones you which to
reload, are in the several available style sheets (so that they
override previous definitions).


Hope this helps,
 Helder


[1] http://schepers.cc/?p=82

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Batik Transcoder jar size

2010-02-15 Thread Helder Magalhães
Hi Teck Hua Lee,


 From my experiments, I need the following jars for my transcoder to work
 correctly during runtime. This comes up to about 4MB.
 Do you guys have any suggestions on how to reduce the distribution size? Is
 there a Batik tiny distro?

AFAIK, there isn't a Batik tiny distribution . You should be able to
shrink the current one by:
 * Taking a look at the Jar dependency graph [1] (note: outdated!) and
remove the unneeded ones;
 * Use proguard [2] to shrink the Jars. You'll find posts in the
mailing list archives about this and. I'd suggest that, if you take
this path, then you'll share your results afterward. ;-)


 Thanks.

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/install.html#dependencyGraph
[2] http://proguard.sourceforge.net/

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: problem with batik transcoder on a headless system

2010-02-09 Thread Helder Magalhães
Hi everyone,


(Simon)
 but still, any help would be very much appreciated.

You've mentioned you were using Java6 but, probably not being the
cause, I'd suggest giving more detail on the Java version (and
implementor... Sun? OpenJDK? GCJ?) and also surrounding things
(operating system/distribution version for example).


(Jonathan)
 As always.  The test.svg file would probably help in resolution

Yup, a simple test case will likely help much more [1] than trying to
explain. ;-)


(Jonathan)
 Hope this helps a bit and please share anything you find!

I subscribe to this as well. :-)


Cheers,
 Helder


[1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html#showmehow

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Rendering precision

2010-02-07 Thread Helder Magalhães
Hi Johan,


 I had the same problem and couldn't find any quality settings. I did find a
 protected method of transcoders: createRenderer(), which returns an
 ImageRenderer. You can set Java2D rendering hints on this class. By creating
 a simple subclass you can tell the ImageRenderer to use the highest possible
 quality:
[code snippet]

Thanks for sharing! :-)

I'd say you should be able to achieve a similar similar result by
tweaking the content to use the intended rendering properties [1]
configured for quality. ;-)

Nevertheless, it sounds interesting to be able to set a rendering hint
in order to force different quality settings:
 * highest (for printing/perfection);
 * lowest (for performance/reduce memory consumption) .
I'd say this was interesting to see in the framework. (Unless I'm
missing something and this is possibly already covered...) Could you
raise a request for enhancement for the SVG Rasterizer in the bug
tracker? Please include a link to this mailing list thread. This
bookmark [2] should help if you have any difficulties! ;-)

The provided code snippet is pretty similar to what's already being
done in the transcoder classes, so I'd even invite you to rehearse a
patch! :-)


 Regards,

 Johan

Cheers,
 Helder


[1] http://www.w3.org/TR/SVG/painting.html#RenderingProperties
[2] 
https://issues.apache.org/bugzilla/enter_bug.cgi?bug_file_loc=http%3A%2F%2Fold.nabble.com%2FRendering-precision-td27459379.htmlbug_severity=enhancementcomponent=SVG%20Rasterizerform_name=enter_bugop_sys=Allpriority=P4product=Batikrep_platform=PCtarget_milestone=---version=1.8

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: problem with batik transcoder on a headless system

2010-02-06 Thread Helder Magalhães
Hi simon,


 i have developed a yanel resource-type which is using the batik transcoder
 to create png and jpg from svg. on my local computer everything works like a
 charm. after i deployed it on a haedless server i run into a problem. i
 tried Djava.awt.headless=true and xvfb. and a real simple svg worked fine
 but for most cases i get an exception (see below). after this exception was
 thrown even the simple svg which worked before throws the exception.

Maybe you got caught by bug 42408 [1]? Could you try downloading the
source [2] and apply the available patch [1] locally and see if it
helps? Please reply back (or comment on the bug report) if so. ;-)


 Caused by: java.lang.IllegalArgumentException: Color parameter outside of 
 expected range: Alpha Red
  at java.awt.Color.testColorValueRange(Color.java:298)
[...]
The exception is somehow weird so I'd ask you to attach a simple test
case [3] which reproduces the issue in a reply, so one can see if
that's really what's happening. Thanks! :-)


 any hint would be very much appreciated.

Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=42408
[2] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository
[3] http://webkit.org/quality/reduction.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Transcoder TileCache

2010-01-28 Thread Helder Magalhães
Hi nithril,


 In fact I call the LRUCache.setsize at init of my webapp.
 It flushed the LRUCache.used list and set the LRUCache.maxsize variable to 0.
The LRUCache.free list remains at 50 (which it initizialed by TileCache) which 
is in my opinion not logic.

I noticed you have reported issue 48634 [1]. I'd suggest replying to a
mailing list thread with a link to the bug report whenever this
happens so people can be aware of the link between the (mailing list)
thread and the issue report. ;-)

Cheers,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=48634

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Accessing the current SVG's Script Global Object

2010-01-23 Thread Helder Magalhães
Hi Christian,


 Okay I thought I'd cracked it using the getInterpreter method on the
 JSVGCanvas

 But the method doesn't seem to be available 
[...]
 Any ideas !

Yep, crawling through the mailing list... ;-D

Just teasing you, but actually there are already a few interesting
threads and how-to's. I've just made a few searches to find a couple
relevant:
 * One [1] probably very targeted to what you intend;
 * Another [2] about something you should take into consideration
regarding changes in the glue which allows Applet--HTML
communication.

If you are able to figure it out, specially if following the
recommendations from the second item [2], then please consider sharing
them back so other can benefit from it. ;-)


 Thanks

Hope this helps,
 Helder


[1] http://old.nabble.com/Applet%2C-Batik%2C-ECMAscript-and-HTML-td8471652.html
[2] 
http://old.nabble.com/Firefox-.next%3A-LiveConnect-feature-removal-td24567283.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: My canvas does not display some changes

2010-01-17 Thread Helder Magalhães
Hi Dao,


 I take the same code and insteed of setting the visibility on/off, I want a
 smoother rendering.
 I decide to add an animate element on the opacity attribute.

FWIW, I've done experiments with this in the past but ended up using
plain blinking (toggle the display property) due to the high
resource consumption (CPU) noticed while doing smooth fade in/out and
also due to lack of interoperability across SVG implementations.
Although regarding the high CPU consumption, Batik Squiggle has a
neat, configurable [1] way to avoid that. :-)


 I do this:
[...]
 anim.setAttributeNS(null,attributeType,CSS);

Nit: I recall that, in my tests, using CSS opacity was less performant
than straight (XML) opacity. I'm not sure if it matters in Batik,
though... ;-)


 @Override
 public void run() {
 anim.setAttribute(from, 0.5);
 anim.setAttribute(to, 0);
 anim.beginElement();
 mask.setAttribute(opacity, 0);

 With this, I can't the opacity switches directly without the fade away I
 want. When I put the visible.svg and hidden.svg files in squiggle, I have
 the animation running as I want. what's wrong?

I guess what's happening is that you are mixing two things which you
probably didn't intend: CSS and SVG (XML) opacity. Although apparently
the same, they have differences such as the override rules (which
seems to be the cause). Just switch to XML attributes and you probably
are in the good path again. ;-)


 In squiggle, it seems that for example, if I want the opacity from 0 to 0.5,
 it blinks like 0.5, then 0 then smoothly 0.5. How can I do to avoid this?

I'd suggest getting more familiar with SMIL animation [2] [3] before
diving more into this. ;-)


Cheers,
 Helder


[1] In Squiggle, this is available in
Edit/Preferences/General/Animation rate limiting
[2] http://www.w3.org/TR/SVG/animate.html
[3] http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#SMIL_animations

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: My canvas does not display some changes

2010-01-15 Thread Helder Magalhães
Hi Dao,


 Sorry about the confusion. It is not a mask in SVG terms. The mask for me is
 just a business term.

Oops... ;-)


 Technically, it is just an element, like an other which is in a g appended
 before the first rendering. It is appended directly to the SVG root element

Yeah, when Thomas recalled about the referenced content (mask, in this
case) not being updated live it seemed like the best hint. If you
state it's just a usual element and that it's already in the document
tree when the first rendering is done, then it's weird... :-|

Can you create and attach a reduced test case which reproduces this
symptom? (Apparently it would need to be Java application code, as
you've stated that it opens in Squiggle as expected -- else I'd
suggest only attaching the SVG source.) Although probably not part of
the cause, please state your environment as well (Java version, OS,
Batik version or revision, ...).


Cheers,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Export or rasterize SVG with embedded SVG's

2010-01-10 Thread Helder Magalhães
Hi Andries,


 Dear batik users,
 this could be the wrong place but here I go :

This is the right place [1] for this sort of questions. :-)

You can/should also take a look at the Apache FOP [2] project, given
it's level of specialty for typography/printing-related operations
(PDF support and more).


 Goal
 I'm trying to have a rasterized file (Jpg, tiff, ...)  from an SVG with
 embedded SVG's (xlink).
 These files should be print ready so we are talking about 300 dpi, or 5000
 x 5000 px in 72 dpi.

Note that this sort of images *will* have large memory requirements.
So, in this case, just for the image buffer we will need 5000 * 5000 *
4 = 1, which is 100MB. The 4 multiplier stands for 4 bytes, as
each pixel has 32 bit information (RGB + transparency). Take a look at
a post by Jeremias [3] explaining the calculations in more detail.


 This generation should be done dummie proof if possible with an .exe

Creating a single executable can become tricky, given the need of a
JVM and Batik. But an installer for installing the prerequisites that
and a batch script for the task (I'm assuming Windows given .exe)
would be fairly easy. You may be interested in taking a look at the
Installing Batik on Windows Systems tutorial (link in the Batik wiki
[4]).


 Problem
 The only program that correctly displays this kind of files is
 batik/squiggle. (even Inkscape doesn't support this)

Note that, regarding TIFF and other image formats support, Inkscape
(and other SVG viewers) are not required to support them: only JPEG
and PNG are mandatory [5].


 I can't use the Squiggle rasterizer because it asks to much memory to
 generate my files for a print ready file. (tested with 2 Gig)

Humm... This sounds like it *could* be root cause the problem. You are
testing with 2GB of heap space or in a machine with 2GB of RAM? This
is quite different (and probably you already know it, but confirming
is always good). Taken from a bug comment [6], I'd suggest increasing
the memory provided to Batik using something like:

java -Xmx1024m -jar batik-rasterizer.jar ...

In order to possibly reduce memory consumption, you may also take a
look at the bg option [7], which allows removing the transparency
from the output (if it's not a requirement). I haven't tested if Batik
internally optimizes that (i.e., if it actually will lead to memory
savings) but it may worth testing. ;-)


 Question
 What would be the right way to do this? (PDFrasterizer, etc..)

I guess you now have plenty information available... ;-)

Nevertheless, if you end up concluding that FOP and/or Batik don't
suit your needs, I'd suggest also taking a look at ImageMagick [8],
which also seems to be worth a try given its scripting abilities and
such. ;-)


 I am struggling for 1 month now, so many thanks!

 Andries

Don't struggle for so long before asking! I confess I also tend to do
that (struggle a lot before asking) but, if one crawled through the
Web/mailing lists/available documentation and found nothing
appropriate, then posing a smart question at that point is generally a
good idea IMO. (It doesn't mean to stop struggling, just inviting
others to be part of the process.) ;-)

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/mailing-lists.html#batik-users
[2] http://xmlgraphics.apache.org/#fop
[3] 
http://old.nabble.com/PDFTranscoder-Text-Opacity---Transcoding-Hints-td22874236.html#a22985225
[4] http://wiki.apache.org/xmlgraphics-batik/
[5] http://www.w3.org/TR/SVG/conform.html#ConformingSVGViewers
[6] https://issues.apache.org/bugzilla/show_bug.cgi?id=43369#c3
[7] http://xmlgraphics.apache.org/batik/tools/rasterizer.html#using-binary
[8] http://www.imagemagick.org/

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Batik show null error popup

2010-01-09 Thread Helder Magalhães
Hi Rana30,


Response inline...


 I will get the a pop up, which is showing the null  when I try to change the
 view box properties. Please find the error detail in the attachment.

 Code:

 SVGOMElement svgRoot = (SVGOMElement) doc.getRootElement();
 svgRoot.setAttribute( viewBox, 0 0 600 700 );

 http://old.nabble.com/file/p27026855/Null%2BError.jpg

By taking a quick look at your error screenshot and code, I'd say you
are trying to do this (manipulating the DOM) without creating a
Runnable thread, which is unsafe [1]. I'd take this opportunity to
invite you to take a look at the Scripting with Java [2] and FAQ
[3]. ;-)

If my quick guess is wrong, please add more information to the
explanation, possibly through a code snippet with more context.


 Thank you in advance

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html#Threads
[2] http://xmlgraphics.apache.org/batik/using/scripting/java.html
[3] http://xmlgraphics.apache.org/batik/faq.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: contribution advice?

2010-01-08 Thread Helder Magalhães
Hi jonathan,


I'd suggest taking this sort of discussions in batik-dev. That mailing
list is not only for Batik committers, it's meant for developers
working on or wanting to work on Batik itself [1]. ;-)


Response inline...


 Happy New Year Batikeers,

Thanks! I hope it will be a great year for Batik and SVG in general. :-)


     I have a few enhancements I'd like to add to batik [...]

Cool! B-)


 I find it usually helps me if I have a goal.
 Perhaps someone familiar with the current state of batik's bug list
 (Helder???) could point me toward some validated, higher priority bugs so
 that I might attempt to resolve?

I already shared my TODO list recently [2] and I must confess I don't
have any insights about Batik internals needing some love but, as
Thomas already hinted a few, I don't think it will be much necessary.
:-)

I'd only add that helping out triaging hanging bugs (without patches
[4]) or testing existing patches [5] might help while entering the
project (at least, from my experience). Nevertheless, given that your
Java skills seem to be above average, I'd say working in the code base
itself (following Thomas ideas) would bring more value to the project.
Just my 2 cents... :-)


   My Apache ICLA has been submitted and I do understand that I will be
 limited to submitting patches that may or may not be applied by an
 individual with commit access.

Yes, I just noticed it was already received and processed (Jonathan
Shaw Wood became part of the list [5]). :-)


   Thanks,
     jonathan

Cheers,
 Helder


[1] http://xmlgraphics.apache.org/batik/mailing-lists.html#batik-dev
[2] 
http://old.nabble.com/Welcome-to-Helder-Magalh%C3%A3es-as-a-committer-td26962973.html#a26981465
[3] 
https://issues.apache.org/bugzilla/buglist.cgi?query_format=specificproduct=Batikbug_status=__open__short_desc=\[PATCH\]short_desc_type=notregexp
[4] 
https://issues.apache.org/bugzilla/buglist.cgi?query_format=specificproduct=Batikbug_status=__open__short_desc=\[PATCH\]short_desc_type=regexp
[5] http://people.apache.org/~jim/committers.html#unlistedclas

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Text and lines not rendering

2010-01-02 Thread Helder Magalhães
Hi Matthew,


Response inline...


 Thanks for the swift response. This has sorted out both issues.

Great! :-)


 I am amazed, however, that Inkscape, Firefox and Safari all ignored
 the typo in the CSS declaration!

Batik generally is a bit strict regarding error processing [1]. In
this case, I've quickly created a test case to understand what was
happening: apparently, the issue was due to the CSS parsing being
aborted (due to the invalid content) before reaching the
stroke-related declarations. I'm not sure if the CSS parsing abort
behavior is conformant but, if I recall correctly, Batik doesn't
implement The document shall be rendered up to, but not including,
the first element which has an error [1].

I'm attaching the test case for posterity... ;-)  In my tests, Batik
(Squiggle) 1.8pre and Inkscape (Inkview) 0.47 don't display the middle
red line; Firefox 3.5, IE 8 + ASV 6pre and Chrome 4.0dev seem to
ignore the invalid declaration and display the line. I'm not arguing
who's right here. :-)

As for Firefox/Chrome/ASV, the CSS parser is probably very tolerant
given it's a Web browser/plug-in (and the Web has plenty of invalid
content). I really don't know Inkscape regarding error handling.


Cheers,
 Helder


[1] http://www.w3.org/TR/SVG/implnote.html#ErrorProcessing
attachment: InvalidCSSParsing-Testcase.svg
-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Re: create a JSVGCanvas from an inputstream

2010-01-01 Thread Helder Magalhães
Hi dao,


Response inline...


 Added in [2]. not sure of how to reference the thread

Great! :-)  I noticed an entry added to the how-to, but the actual
page [1] doesn't exist yet...?

To reference a thread, just copy a link from the archives [2]. While
using the official archives, the trick seems to be selecting the
desired thread or particular message and clicking on the Message
view link in order to get the desired thread/message hyperlink. In
this particular case, it would be [3].

As we're at it, given than navigation/search features are not very
user friendly in the official archives IMHO, I frequently use the
Nabble archive [4], specially for searches... ;-)


Hope this helps,
 Helder


[1] http://wiki.apache.org/xmlgraphics-batik/InputStreamInitialisation
[2] http://mail-archives.apache.org/mod_mbox/
[3] 
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c272595f40912300947w60080f76ibdc29c7a1a702...@mail.gmail.com%3e
[4] http://old.nabble.com/Batik-f308.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: xlink namespace missing in href attribute

2010-01-01 Thread Helder Magalhães
Hi Gerrit,


Response inline...


 Hi Helder, thanks a lot for your tips.

Glad to know it helped! :-)


 I used your line taken from [1], and it worked. Apparently, you have to
 pass a qualified attribute name which includes the prefix. This is even
 specified in the org.w3c.dom.Element interface.

Humm... AFAIK, the prefix is not required to handle things internally.
A document serialization, though, will need to add the proper
prefixes. I recall doing things like
setAttributeNS(http://www.w3.org/1999/xlink;, href, somelink) in
Firefox, just as proof-of-concept. Although the DOM will not look as
intuitive as when including the prefix, everything should work as
expected. :-)


 I also browsed the SVN repository, and it seems that XLinkSupport is
 still omitting the prefix.
[...]
 Same goes for all other attribute getters and setters in XLinkSupport.
 Should I maybe file a bug somewhere or are these functions intended to
 work in another way?

I guess you have bumped at bug 45520 [1], which was actually a bug in
the serializer. It was fixed after the 1.7 release so I'd suggest
confirming that the current trunk code [2] does no longer reproduce
the problem you were experiencing. Please report back if you are able
to! ;-)


 Regards,
 Gerrit

Cheers,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=45520
[2] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Text and lines not rendering

2010-01-01 Thread Helder Magalhães
Hi Matthew,


Response inline...


 I have some SVG that contains text and lines and only parts of it render
 with Squiggle or Batik, and even then there are differences between what
 renders.

I guess I'm missing something here... What are the rendering
differences between Squiggle and Batik?


 I using Batik 1.7 on a MacBook Pro running Mac OS 10.5.8 and Java
 1.5.0_20.
[...]
 With Squiggle, no text is shown nor the large horizontal line.

MacOS and no text? Seems like you've bumped at issue 47917 [1]... The
simplest way to check (and workaround) it would be adding
-Dapple.awt.graphics.UseQuartz=false to the Java command line. Try
it and report back! ;-)


 Producing a PDF using batik-rasterizer renders the text but the large
 horizontal line is still omitted.

 What is going wrong?

The large horizontal line issue was starting to feel *really* weird
until I noticed it was just due to a parsing error: note that the line
(id=1-1-cl) has an invalid CSS declaration (fill-rule;evenodd;,
note the semicolon separator instead of colon). That is causing the
line to be excluded from the rendering. :-)


        Cheers,

        Matthew

Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=47917

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: create a JSVGCanvas from an inputstream

2009-12-30 Thread Helder Magalhães
Hi everyone,


Response inline...


(jonathan wood)
 Here are a couple of load routines I use frequently ..  Hope they help you
 narrow your problem.

(dao)
 Thank you, it works fine! I will keep those routine somewhere

In the wiki [1], perhaps...? ;-)

The how-to section [2] seemed appropriate, but for shorter, useful
code snippets, a dedicated page (UsefulSnippets?) would also be
great! :-)

BTW: if one decides to go with it, including a taken from
[link_to_mailing_list_thread here] would be great so that one can
crawl for background information if is curious enough.


Cheers,
 Helder


[1] http://wiki.apache.org/xmlgraphics-batik/
[2] http://wiki.apache.org/xmlgraphics-batik/HowTo

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: background for text

2009-12-30 Thread Helder Magalhães
Hi Dao,


Response inline...


 interesting, I never think filter oriented... but if I want to highlight a
 filled shape, the yellow never appears, isn't it?

FWIW, I never saw a way to highlight shapes which works well in all
situations. For example, popular ways to highlight objects are:
 1. Use a particular stroke/fill color. How will you highlight a shape
which by coincidence is in that particular color?
 2. Revert colors (a.k.a. XOR mode). How will you highlight a shape
which is mid-tone gray?
 3. Use the shape's bounding box. If the shape is very large and you
are zooming in, for example, you won't have a clue that the shape is
selected. Also, this is not quite a highlight...

I'd advise you to take a look at existing vector graphics editors,
such as Inkscape (which seems to use approach 3) and Sketsa (which
seems to use approach 1; as a matter of curiosity, it's based in
Batik), in order to figure out general approaches to the problem.
Also, Batik Squiggle also has a shape highlighting feature (which
seems to use approach 2): checkout Tools/DOM Viewer.../Click to
enable highlight of selected node. Note that the shape highlight
doesn't seem to be working well with complex SVG files, but you may
use a very simple SVG [1] just to have a feeling: I've just reported
bug 48468 to track it down... ;-)


Hope this helps,
 Helder


[1] 
http://heldermagalhaes.com/stuff/svg/demos/SVGObject-HTMLCanvasInteractors/sample.svg
[2] https://issues.apache.org/bugzilla/show_bug.cgi?id=48468

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: jsvgcanvas serialization

2009-12-28 Thread Helder Magalhães
Hi Dao,


Response inline...


 Considering the different messages I find, the JSVGCanvas is not
 serializable. So, why does it implements serializable?

I didn't check the code for sure, but it might have been
(serializable) in the past and afterward, during some feature
implementation, broken by accident (technically a regression). One
will probably need to crawl the SVN log and/or the source code itself
for sure... :-)


Pasting or attaching the messages you found might help, as well as a
reduced testcase. ;-)


Hope this helps,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Rendering part of svg document at specified position in JGVTComponent

2009-12-20 Thread Helder Magalhães
Hi Tomasz,


 My previous post with same topic has some error, so I'm sending it again.

Weird... In fact I received the previous message properly (i.e., in my
email) but it doesn't display well in the official mailing list
archive [1]. An unofficial archive displays it as expected [2],
though...

I'd suggest that, when creating a new thread, you didn't forward from
another thread (apparently this was the case) nor reply to a previous
thread and change subject (also a common mistake), as this may confuse
the mailing lists: as a reply/forward messages have embedded metadata
about the original message, the new thread may not appear as desired
(typically, for replies it is displayed out of order).


Regards,
 Helder


[1] 
http://old.nabble.com/Fwd%3A-Rendering-part-of-svg-document-at-specified-position-in--JGVTComponent-td26856784.html
[2] 
http://mail-archives.apache.org/mod_mbox/xmlgraphics-batik-users/200912.mbox/%3c8ce4d09b0912190910o1f33a741o90b080b1cc724...@mail.gmail.com%3e

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: xlink namespace missing in href attribute

2009-12-19 Thread Helder Magalhães
Hi Gerrit,


Response inline...


 Running the above code with Batik 1.6 or 1.7 produces the following
 output:
[output]


 Not only is the xlink namespace added a second time (it was already
 present in the root element), but the namespace prefix is missing in the
 href attribute. Since attributes, unlike elements, have no default
 namespace, the attribute is not a valid xlink:href attribute any more.

True, the output does seem broken.


[...]
 I therefore suspect that some error occurs during serialization.

 Am I maybe missing something? What would be the correct way to add an
 xlink:href reference, or a use element with default attributes? What
 method is used to create the other xlink attributes that are lined up so
 nicely?

I have a couple of suggestions:

// XLinkSupport.setXLinkHref( useElement, somefile.svg#someid );
// use DOM2 instead. a tightly related sample is in the FAQ [1]
// (more related information is available in the website [2] and in
the mailing list archives [3])
useElement.setAttributeNS(http://www.w3.org/1999/xlink;,
xlink:href, somefile.svg#someid);

// I'd suggest appending to the document only after completely setting it up
// (this may hold performance benefits in some situations)
doc.getDocumentElement().appendChild(useElement);


If the above doesn't help, I'd also suggest attempting with the
current trunk version [4]: I recall a couple of namespace-related
fixes post the 1.7 release. ;-)


 Thanks for any insights.

 Regards,
 Gerrit

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/faq.html#changes-are-not-rendered
[2] http://xmlgraphics.apache.org/batik/using/dom-api.html#buildsvgdoc
[3] http://www.nabble.com/Batik-f308.html
[4] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG update performances over X11 export display

2009-12-01 Thread Helder Magalhães
Hi Olivier,


 I have very bad performances using batik to display and update a SVG over a 
 X11 export display.

I don't know about the internals of X11 export display, but I can
imagine that would be close to Remote Desktop and/or VNC, possibly
more efficient. But given that Java ultimately deals with buffered
images(bitmaps) I guess the X11 export's potential efficiency,
regarding vector operations, is kinda chopped down (please correct me
if I'm wrong!)... It might be possible to implement Batik rendering
directly using X11 primitive operations, which would then take
advantage of the X11 export display, but that would probably be a
crazy project (in terms of the amount of work and required Batik
refactoring)! :-D


 Is there any documentation to understand the policy of batik to do the 
 repaint?

You may take a look at the Batik architecture [1], but that's only a
starting point. The repaint internals are likely within the GVT
module, but I'm not sure if, else than the Javadoc (and the source
code itself, naturally), more documentation is available...


 When I do a setAttribute style, for example, does batik repaints only the 
 necessary
 part of the display (the rectangle surrounding the element)?

That should be the case.


 If I have several layers, does batik repaints each one?

I guess not. As far as I know, the repaint is made by areas so, if you
update the several layers in a single operation -- or using a batch
operation with the already stated (un)suspendRedraw -- than a single
repaint would be expected.


Thomas is the GVT expert [2] so he may be able to shed some light
here; as for me, this is hitting the limit of my current Batik
internals knowledge, so I really doubt I can provide much more useful
information.


As a side note, why not place some debug output in the repaint classes
and check what Batik is doing for yourself...? ;-)


Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/architecture.html
[2] http://xmlgraphics.apache.org/batik/contributors.html#expertise

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG update performances over X11 export display

2009-11-30 Thread Helder Magalhães
Hi Olivier,


 I modify the
 document in the thread

 getUpdateManager().getUpdateRunnableQueue().invokeLater

Good, this is the recommended way [1] for doing it. :-)


 but I have several elements to change, and for the moment, I do a lot of
 invokeLater. In my local machine, it runs very well. I try an export display
 (linux, rhel) and the performances are completely degraded.

 Is there a best practice to have good performances with X11 export display?

 Of course, I’ll first try to make 1 big invokeLater, unless somebody says it
 is pointless...

I haven't tried to profile myself but making a big document updates is
intuitively quicker: it will cause less document repaints. This
performance benefits is expected independently of hardware/platform,
but naturally it will be noticed whenever there's a bottleneck (in
this case, apparently the display export).

I'm convinced you'll find related posts within the mailing list archives. ;-)


Regards,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG update performances over X11 export display

2009-11-30 Thread Helder Magalhães
Hi Olivier,


 Is there a way to do this with the batik framework:

 beginBatchModifications()
 thread1 - getUpdateRunnableQueue().invokeLater(runnable1)
 thread2 - getUpdateRunnableQueue().invokeLater(runnable2)
 thread3 - getUpdateRunnableQueue().invokeLater(runnable3)
 thread2 - getUpdateRunnableQueue().invokeLater(runnable4)
 thread1 - getUpdateRunnableQueue().invokeLater(runnable5)
 endBatch()


 so that I will not have to manage my synchronized queue of runnable and 
 ensure the repaint is performed by the endBatch?

Well, SVG has the (un)suspendRedraw [1] methods, which Batik
implements [2]. ;-)


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/struct.html#DOMInterfaces
[2] 
http://xmlgraphics.apache.org/batik/javadoc/org/apache/batik/dom/svg/SVGSVGContext.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Mouse Interaction behavior

2009-11-21 Thread Helder Magalhães
Hi everyone,


    BTW this discussion should really take place on batik-users since it
 doesn't involve
 development of Batik.

True, note that I'm now only replying to batik-users.


 If not, any clues about where the geometrical processing is really
 done are welcomed!

     What you might consider doing (at the cost of memory) would be
 to 'duplicate' your lines with a wider stroke (probably using a 'use'
 element).  You can make the duplicate invisible (fill=none stroke=none)
 but still sensitive to mouse events (pointer-events=all).

For this, SVG Tiny 1.2's non-scaling stroke (see vector-effect [1])
would be *really* useful. :-)

I've already though of a possible implementation based in a recent
thread about invariant text which ended up in a Wiki contribution [2];
unfortunately, I see no time frame to put my hands on this in the
short/medium term... Should a bug be created in order to start
gathering ideas? Any adepts/volunteers to help with this?


Cheers,
 Helder


[1] http://www.w3.org/TR/SVGTiny12/painting.html#VectorEffectProperty
[2] http://wiki.apache.org/xmlgraphics-batik/CanvasTextSize

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: recursive use tag doesn´t work in batik - in Fi refox 3.5 it´s ok

2009-10-22 Thread Helder Magalhães
Hi Olaf,


 i have an svg file which looks very similar like the one at the end of this
 message.
 when i load this with Firefox 3.5 everything looks like expected.

It's awkward to me that it works in Firefox, as far as I know the use
element [1] should be empty and therefore no child content is
expected... :-|


 But Batik only displays the file in the first use tag. The use tags inside
 the first
 one are ignored. Can anyone help me out of this ?

Just remove the nesting from your use elements. Basically, change those

use
  use
use/
  /use
/use

To something like:

use/
use/
use/


Hope this helps,
 Helder


[1] http://www.w3.org/TR/SVG/struct.html#UseElement

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: recursive use tag doesn´t work in batik - in Fi refox 3.5 it´s ok

2009-10-22 Thread Helder Magalhães
Hi Olaf,


 i modified my code and then it works - thanks.

Glad to know. :-)


 i guess FF is a little bit more tolerant than batik - or incorrect, i don´t
 know.

It's not a matter of tolerance, it's a matter of conformance to the
specification. ;-)

I created a reduced test case and was about to file an issue in the
Mozilla bug tracker when I noticed this fixed post Firefox 3.5 (tested
with 3.6b1pre and 3.7a1pre nightly builds), so just wait until the
next release or get a nightly build! :-)

I'm attaching the reduced test case anyway, in case anyone wants to
take a look or bumps into the same issue again.

Regards,
 Helder
attachment: Firefox-GraphicalElementsInsideUseElementsAreAllowedAndRendered.svg
-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Re: Help tracing a rendering problem in JSVGCanvas

2009-10-01 Thread Helder Magalhães
Hi Aurora,


 My svg files are quite big (85 KBs), created with CorelDraw. They are
 static, just some boxes and text.

Yet, creating a very simple example which shows that would be valuable.


 The yellow boxes are not in the svg; they are JTextFields added to the same
 JSVGCanvas (and they are correctly resized).

I'm not sure if this can be the source of the problem: mixing Swing
widgets to a JSVGCanvas. The screen-shot batik+error.GIF suggests
that there are being scroll synchronization problems for the Swing
widgets, the SVG itself seems fine...? But my knowledge on that matter
is pretty rookie...


 I have over 3000 users with no problems, and 6 which suffer this bad
 rendering, but 4 of them have arised in the last two weeks, so I'm afraid
 the number will increase in the future.

Gathering more information about the users with troubles would help:
 * Operating system;
 * Java version;
 * Batik version (I can imagine it will be the same for all users but...);
 * Other information you may find relevant.
Even if it turns out not to be relevant for the problem, sharing the
specific environment which triggers the symptoms can be useful for
other users which may also suffer from similar issues. ;-)


 Thanks for your help.
 Hope this helps,

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Help tracing a rendering problem in JSVGCanvas

2009-09-30 Thread Helder Magalhães
Hi ahhahh,


 No exception is thrown, but the lowest part of my svg is badly rendered. I
 have some images to show you the problem. Can I attach them?

Yes, attaching them would be valuable, specially if images refer to
reduced SVG test cases [1] (and not to actual screen-shots of the
unexpected rendering). Nevertheless, attaching at least one screenshot
with the broken rendering is also recommended in order to compare with
other environment results. ;-)


 [...] the only solution is going back to JRE
 1.6.0_07. I know they made a lot of changes in java2d since 6u10.

Yes, I recall something about rendering changes around those Java updates.


 Thanks in advance.

Hope this helps,
 Helder


[1] http://webkit.org/quality/reduction.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Update problem (partial update on JSVGCanvas)

2009-09-28 Thread Helder Magalhães
Hi Claire,


 All removals are performed in update manager thread, I test my application
 under Debug mode.

You seem to be doing things properly, so I'd invite you to share a
simple test case and/or provide more details such as operating system,
Java version, etc.


 Actually I made a
 svgCanvas().setRenderingTransform(svgCanvas().getRenderingTransform());,
 it works but it is not very clean..

It's not clear to me why would that workaround the problem. As far as
I know this will, at most, force a full canvas redraw, so my current
guess goes to a display driver/Java 2D bug...?


 Thanks.

Hope this helps,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Question on Zoom

2009-09-10 Thread Helder Magalhães
Hi Bharat,


 Can someone give me sample code on how to control zoom in and zoom out. I
 have added svg file on applet and now with the help of two buttons I want to
 control the zooming feature.

If you want to customize the zoom interactors behavior, a good place
to start is:
http://wiki.apache.org/xmlgraphics-batik/CanvasInteractors

If you want HTML buttons to interact with the applet, then the demo
can be used for inspiration:
http://xmlgraphics.apache.org/batik/demo.html


Hope this helps,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Different behaviour of SVGGraphics2D with same program on similar machines

2009-09-09 Thread Helder Magalhães
Hi oroadfc,


 But try the same program, same batik version, same java version (1.6) on my
 home machine (standard win xp box again) and it outputs one big bitmap blob
 to the svg file...

You don't state which Batik version this occurred in! Also without at
least a screenshot of the problem it's really hard to guess on what's
happening... Right? ;-)

Also, you haven't stated if this is reproducible every time or
sometimes, attach a test case, etc

Please consider reading a bit on how to better report issues [1]. :-)


 What could cause this?

A shoot in the dark makes me suggest you double check versions:
 * Batik's;
 * Java (1.6 for itself is not enough, the full output of 'java
-version' can be useful; mine is 1.6.0_16, for example);
 * Graphics adapter driver (can be checked in Control Panel,
System option, Hardware tab, Device Manager button and crawling
to the Display adapters sub-tree, right click on the graphics
adapter and choose Properties, Driver tab);


Hope this helps,
  Helder


[1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Unknown language: text/ecmascript [Precisions inside: problem with DOMUtilities]

2009-09-03 Thread Helder Magalhães
Hi Mathieu,


 I'll try to write you a little script in order to show precisely the problem
 (whithout any assuptions).

Great. Being able to easily reproduce always helps a lot.


 But, waiting for it, can you help me, please,
 whith the DOMUtilities.parseXML method? I'm not very comfortable using this
 method (and the correct parameters to feed it), and the Batik Javadoc
 doesn't help me very much.

Maybe the ECMAScript version documentation [1] will help...?

Have you tried crawling through the Batik source code [2] and/or Web
for sample usages of the method? ;-)


 Thanks a lot!

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/status.html#ecmascript
[2] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Help to migration from ASV to BSV

2009-08-31 Thread Helder Magalhães
Hi Nilesh,


 Currently i dont have images for example.Atcually in BSV blur image getting
 display compare to ASV.

Not providing any examples [1] makes it pretty hard to provide any
help or valuable feedback...


  I have doubts in ASV images get display over HTML
 frame and BSV that images getting display over swing canvas. so w.r.t that
 some doubts bellow.
 1) will it effect on display quality of image?

It's not clear to me [2] what's it in this scope... Is it the HTML
frame vs. swing canvas? If so, then no -- I don't thing this is the
cause: both ActiveX extensions (ASV) and Java-based (Batik) have
anti-aliasing (hardware or software based) capabilities.


 2) Is there any way i can intensify image display quality(should not
 be blurred display) over canvas by code.

I don't have any pointers handy on how to force this by code, but I'd
suggest you got more familiar with SVG's rendering properties,
specially shape-rendering and text-rendering, which allow you to
hint the implementation into providing crisp shapes. I guess I've seen
a couple of threads in the mailing list about how to disable
anti-aliasing (usually the guilty for the blurry effect, often a
helper to avoid pixelization).


 3) How batik api uses to draw image over canvas(so that i can find cause of
 blurred image display over canvas)

There is some documentation [4] spread over the Batik site and several
(mailing list) threads explaining several details. Nevertheless, the
code is available [5] so you can see for yourself! :-)


 3) Does anyone facing such problem?(blur image display over canvas in batik
 viewer)

This usually depends on content being displayed. In my case, no, I
don't see much of a difference compared to IE+ASV. In fact, I find
Batik's rendering a bit more crispy than ASV, specially for scaled
down content.


 Thanks

Hope this helps,
 Helder


[1] http://www.chiark.greenend.org.uk/~sgtatham/bugs.html#showmehow
[2] http://www.catb.org/~esr/faqs/smart-questions.html#writewell
[3] http://www.w3.org/TR/SVG/painting.html#RenderingProperties
[4] http://xmlgraphics.apache.org/batik/using/architecture.html
[5] http://xmlgraphics.apache.org/batik/download.html#Subversion+repository

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: clip-path and onmouseover (or click, onmouseout, etc.) events!

2009-08-26 Thread Helder Magalhães
Hi Mathieu,


 The problem is that i don't know how to deal with the sources of batik: I
 donwloaded these (and the patch) but i don't know how i can apply this patch
 and re-create the jars of the library (Do i need to use a specific ide?).

Naturally, you'll need a JDK [1] or equivalent for building the
sources. To build Batik, one only needs to invoke the build command
line utility (build.bat for Windows, build.sh for Linux/Mac). Note
that you need to define the JAVA_HOME system variable (pointing out
to your JDK directory).

You probably want to use the target jars to build the jars (as in
build jars or ./build.sh jars) and/or squiggle to help testing
the patch in test files, if there are any.


 I already downloaded Eclipse, but when I try to open the batik sources, many
 unresolved import errors are reported.

I've see reports of users using Eclipse, but I don't know about any
formal procedure to setup things.


 I searched the batik website for any explanation (as i read in the REDME
 file) but i found nothing about compiling this sources (and applying
 pathches).

Applying patches is way out of Batik's scope, so it's expected that
you find no information regarding this. Crawling a bit on the subject
will probably lead to multiple on-line guides. If you are on Windows
and are fond of GUIs, you may for example use TortoiseMerge [2] to
help you on the task (but there are a lot more freely available
patch/merge tools). ;-)

It's weird that no information is found in the README file, although
related information can be found in contrib/rasterizertask/README.
I'd suggest that a bit of the build related information was ported
to the main README file. :-)


 Thanks a lot!

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/install.html#distributions
[2] http://tortoisesvn.tigris.org/TortoiseMerge.html#patch

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Unknown language: text/ecmascript

2009-08-26 Thread Helder Magalhães
Hi Mathieu,


 java.lang.Exception: Unknown language: text/ecmascript

If you mix several equivalent language types ('text/ecmascript' and
'text/javascript', for example), be aware that Cameron recently
committed a fix for unexpected behavior in these cases [1]. This is
only available in nightly builds and/or by compiling the trunk source
code yourself.

Also, this issue is commonly caused for not having 'js.jar' (and many
other jars) included in the classpath. Note that, if you don't
properly setup the classpath, potentially many other weird errors
such as this one will occur. ;-)  But this is already stated in
related mailing list threads...


 Thanks a lot!

Hope this helps,
  Helder


[1] http://svn.apache.org/viewvc?view=revrevision=801512

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: clip-path and onmouseover (or click, onmouseout, etc.) events!

2009-08-20 Thread Helder Magalhães
Hi Mathieu,


 I created a clip-path element: A filled circle masked (more
 precisely clip-pathed) by a filled rectangle. On the circle element of
 the svg document, i put a onmouseover and a onmuseout attributes, wich
 calls a javascript method which changes the color of my shape.

 The problem is that, when I try this document in batik, the color of
 the shape changes even when the cursor is over the non-apparent part
 of the circle: The cursor is outside the rectangle, but would be on
 the circle if it wasn't clip-pathed, and the part of the circle
 inside the rectangle changes its color.

I guess the specification isn't clear enough regarding this. See bug
46289 [1], which contains a patch by Thomas to fix it and also links
to relevant discussions in the www-svg mailing list. :-)


 With, firefox, i don't have this problem (the color changes only if my
 mouse is on the part of the circle inside the rectangle).

Unclear or underspecified stuff usually leads to this sort of
unexpected incoherences among implementations... :-|


 So I would like to know if it's a bug of batik? Will it be fixed?

I'm not sure if the patch will be integrated. I'd vote for so, but I
remember the discussion somehow hit a dead end: there was no clear
consensus at the time... :-(  Maybe this is addressed in the second
edition of the SVG 1.1 specification. :-)


 Can I try to fix it? I tried to search the Javadoc API for the class
 responsibles for this interpretation, but i've no idea! If there are
 some batik developpers on this mailing, can they shox me the
 incriminated classes

As stated, in order to fix it you may locally apply the patch
already referred. ;-)

As stated within the www-svg debate, another way of working around
this (in an inter-operable way?) would be adjusting the
pointer-events property [2] to visible.


 Thanks a lot!

Hope this helps,
 Helder


[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=46289
[2] http://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: direct access to tree to modify a shown SVG-Document?

2009-08-15 Thread Helder Magalhães
Hi Sven,


 Hello all. [...]

It might been some mess up made my your mailing list interface
(Nabble), but I've noticed the whole message was sent in a single
line...? Please separate sentences (using paragraphs, for example) in
order to separate ideas and ease the reply process. ;-)


 Now I'm
 trying to modify the content of the tree e.g. by adding nodes or grouping
 nodes together... (later this should happen on user-iteraction, but for now
 I want to do it hard-coded just to see how it works)

I'd say using the DOM is the proper way of accomplishing that.


 I had some success by
 adding Nodes to the root-element of the SVGDocument itself
 (JSVGCanvas.getSVGDocument().getRootElement().appendChild(xxx) )but these
 changes are not shown in the canvas until the GVTTree is rebuilt [...]

I'm not very familiar with the Batik GVT internals but I'd say that
setting the document state to dynamic [1] should take care of handling
those changes in an efficient way. :-)


 [...] which I
 would like to leave out...

Why would you like to leave the GVTTree rebuild out? Describing your
intention [2] might help... If you are following the recommended way
to manipulate the document [3], then you probably won't need to bother
with the underlying lower level internals. :-)


 I guess it would do what I would like to get when
 I modify the SVGDocument-Object and then calling the
 JSVGCanvas.setSVGDocument(xxx)-Function but I assume this would rebuild the
 whole tree which would not be as interactive as I would like it to be... So
 is there a way to directly access and modify the tree that is finally
 rendered into the canvas?

Yup, see above.


 So now the questions... 1. Which is the tree-structure that
 is accessed by the Renderer and is there any way to modify it directly, so
 that the changes are visible without explicitly rebuilding the complete
 tree?

As stated, you may use the DOM or the GVT trees.


 2. Is there any way to save these changes back to a SVG-file? This
 works perfectly when I modify the SVGDocument-Object, but if the rendering
 tree is modifyied I guess this will not be as easy, although it would be
 really nice if I'm wrong here ^^

Well, if you use the DOM this is straightforward: you only need to
serialize it whenever desired (see the SVG generator [4], for
example). I'm not sure if that's also true when using the GVT tree...


 So I hope somebody can help me here. Best Regards, Sven

Hope this helps,
 Helder


[1] 
http://xmlgraphics.apache.org/batik/faq.html#dom-modifications-do-not-display
[2] http://catb.org/~esr/faqs/smart-questions.html#goal
[3] http://xmlgraphics.apache.org/batik/using/scripting/java.html
[4] http://xmlgraphics.apache.org/batik/using/svg-generator.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: direct access to tree to modify a shown SVG-Document?

2009-08-14 Thread Helder Magalhães
Hi Sven,

This is a duplicate thread (of another one created one minute
before)... I'd suggest replying to the original thread only.

Regards,
 Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: direct access to tree to modify a shown SVG-Document?

2009-08-14 Thread Helder Magalhães
Hi Sven,

 This is a duplicate thread (of another one created one minute
 before)... I'd suggest replying to the original thread only.

Correction: the previous thread was deleted (on the Nabble interface),
although the mailing list has triggered the messages (I've received
two messages). I'd rewrite my suggestion to use this thread instead...

Helder

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Calling Javascript From Inside An Applet

2009-08-10 Thread Helder Magalhães
Hi gary,


 svg contentScriptType=text/javascript width=200 height=200
 version=1.1 xmlns=http://www.w3.org/2000/svg;
[...]
 1. Inline the show_alert() method inside the SVG itself or point the SVG
 to an external script (e.g. script type=text/ecmascript
 xlink:href=functions.js/).

Note that the code snippet uses text/javascript whereas the external
script uses text/ecmascript. Although one could/would expect them to
be the same, apparently up until now they weren't. I'm not sure if it
was intended or just a coincidence, but Cameron has recently committed
a change (revision 801512 [1]) which should help avoiding this somehow
unexpected behavior. You may test it by updating the source code [2]
or use a nightly build [3]. ;-)


 I don't really want to use any of those, though - I'd like to be able to
 access my function in the HTML document. Is there any way of doing this
 using Batik?

This may prove to be a bit unrelated with the previous subject because
applet--browser communication can sometimes be challenging.
Nevertheless, Batik has a great demonstration [4] which almost fits
this use-case like a glove: HTML to SVG communication is performed
when you want the reverse, should be fairly easy to adapt. :-)


Somehow related, I've recently created a thread on medium term changes
to applet--HTML communication changes [5], at least in Firefox,
which you may want to take a look at. If you find anything of
interest, please follow up on the other thread. ;-)


Hope this helps,
 Helder


[1] http://svn.apache.org/viewvc?view=revrevision=801512
[2] http://xmlgraphics.apache.org/batik/download.cgi#Subversion+repository
[3] http://mcc.id.au/batik-nightly/
[4] http://xmlgraphics.apache.org/batik/demo.html
[5] 
http://www.nabble.com/Firefox-.next%3A-LiveConnect-feature-removal-ts24567283.html#a24567283

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: SVG viewer

2009-07-28 Thread Helder Magalhães
Hi Joel,


First of all, you originally sent the message for the *subscription
address* of the Batik developers list [1]. That doesn't make sense,
and I'm wondering if that can even cause some trouble... Please be
careful. :-|


 we want to use SVG viewer to view files ,before installing SVG viewer we
 want to know following detailsfor SVG viewer:

Have you tried crawling the Batik site before asking [2]? I'd say all
questions are already answered there and, even the ones which aren't,
can probably be found at the mailing list archive (I personally prefer
the Nabble interface [3], specially for searches).

Said that, I'm providing a set of quick answers, which reflect my opinion only.


 1)Is the viewer compatible with XP and Vista.

Yes. It's Java-based and there are runtimes available for those
operating systems.


 2)Is the software available on the site ,free to download and use?

Yes [4]. Note that Batik is licensed according to the Apache License,
Version 2.0 [5].


 3)Is batik team providing the support to this product.

Support seems to be provided by the community *only*. As far as I know
there is no assured (paid) support plans, but I mighty be wrong
(maybe there are, but from third parties).


 4)we have multiple systems,let us know what minimum configuration is needed
 to install this viewer.

That mostly depends on your use cases. First of all there are the Java
requirements but then comes the complexity of the content to be
viewed, which seems to have a stronger weight dictating the minimum
requirements (as usual)...

In most cases 128 MB memory seems to be enough, though I've seen cases
where 320~512 MB were required to view a single image (!). The only
difference was the content being viewed. I'd say at least 1GHz CPU
will be required for a minimum smooth operation and not-too-long image
load times (but, again, that is tightly dependent on content and to
the expected usage pattern).


 5)does the product (SVG viewer) supports 32-bit or 64 bit machines.

This is somehow related to question 1. Java runtimes are available for
most known platforms. I'd suggest you checked that out in the Java
download site [6] (but remember that Sun isn't the only Java runtime
provider...).


 Thanks and Regards,

Again [2], please consider crawling for answers before asking... ;-)

Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/mailing-lists.html#batik-dev
[2] http://www.catb.org/~esr/faqs/smart-questions.html#before
[3] http://www.nabble.com/Batik-f308.html
[4] http://xmlgraphics.apache.org/batik/download.html
[5] http://xmlgraphics.apache.org/batik/license.html
[6] http://www.java.com/en/download/manual.jsp

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Manipulating SVG images

2009-07-24 Thread Helder Magalhães
Hi Habib,


(from a previous message)
  For example, for an svg image which contains a
  circle, I should be able to trigger an even by clicking the circle. Is it
  possible with Batik?

Yes, this is possible. Mark directed towards a JavaScript (actually,
ECMAScript) solution for simplicity. But Batik supports both
Java-based [1] and ECMAScript-based [2] scripting. :-)


 The svg image should be displayed in a java application, and some of its
 component (like the nodes in the example) are clickable, and even draggable
 (which implies dynamic svg, although it is not a crucial requirement, I'm
 more interested in  the clickable feature).

Yes, the SVG DOM has several interesting events [3] such as onclick,
onmousedown, onmouseup, etc., which can be used to implement such
behavior. Remember that Batik is aims to be a complete SVG
specification, so understanding at least basic SVG concepts will be
very important while trying to use Batik in a programming way.


 I don't see how I can
 integrate javascript with java.

Batik uses Rhino for this, but there seem to be other ways of doing it...


Remember that the mailing lists [4] are a great way of crawling for
answers (most things asked were already addressed previously).
Personally, I prefer the Nabble's interface [5] for searches, but the
official interface works as well. ;-)


Hope this helps,
 Helder


[1] http://xmlgraphics.apache.org/batik/using/scripting/java.html
[2] http://xmlgraphics.apache.org/batik/using/scripting/ecmascript.html
[3] http://www.w3.org/TR/SVG/interact.html#SVGEvents
[4] http://xmlgraphics.apache.org/batik/mailing-lists.html
[5] http://www.nabble.com/Batik-f308.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Help: SVG Font Converter cannot extract from TTF

2009-07-21 Thread Helder Magalhães
Hi creatxr,


 I've tried several non-ascii TTF fonts, it shows the same message.
 It means that SVG Font Converter don't support non-ascii TTF.

As Thomas has stated and myself (even without testing) find it hard to
believe, the font converted should support Unicode fonts properly...


 I've tried FontForge .
 But it can't find cygX11-6.dll.
 I downloaded cygwin and installed, it still can't run.
 I don't know how to do.

Although this isn't the right place for FontForge support, I do
remember it had a few particular library dependencies so you'll need
to run the CygWin setup and install them. Please refer to the CygWin
install instructions [1] and, if you still can't make it work, please
create a thread of the FontForge mailing list. ;-)


Hope this helps,
 Helder


[1] http://fontforge.sourceforge.net/ms-install.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Text Not Displaying

2009-07-19 Thread Helder Magalhães
Hi Doug,


 For some reason, text is no longer displaying for me in Batik 1.7 on MacOS
 X.  The text is there, because the cursor changes when I mouse over it, and
 I can select it and even copy it.  It simply doesn't display, no matter what
 attribute values I use.

Wow, that *is* weird... :-|


 The only think I can think of is that a recent Java upgrade which was pushed
 out on Mac may have introduced a bug:
[...]
 java version 1.5.0_19
[...]

That might be, although I've crawled the Java 1.5 release notes [1]
(with focus on the most recent updates) and haven't found anything
which might cause this. Do you recall which was the previous (before
the upgrade) Java version being used? Could you try again using a
Batik nightly build [2]? (To check for the possibility of an issue in
Batik which has been solved in the meantime.)


 Can anyone confirm this on Mac or any other platforms?

I can confirm that everything is running as expected using Java 1.6
[3] on Windows Vista SP1. I've tried both Batik 1.7 release and
current trunk version (1.8pre). I've used a couple of Batik text
samples [4] for the test.


Please, someone with a Mac perform a few more tests and share their results! :-)


Hope this helps,
  Helder


[1] http://java.sun.com/j2se/1.5.0/ReleaseNotes.html
[2] http://mcc.id.au/batik-nightly/
[3] My Java environment details:
  java version 1.6.0_13
  Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
  Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
[4] Batik ships with a samples/tests/spec/text directory where
several text samples can be found

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Help: SVG Font Converter cannot extract from TTF

2009-07-19 Thread Helder Magalhães
Hi Creatxr,


 java -jar batik-ttf2svg.jar ./bnucdp.ttf -o ./output/bnucdp.svg

My knowledge about the SVG Font Converter [1] is close to none, but
I'd suggest playing with the -l and -h switches, as the font may
have several missing characters... Also, you may try using the
-ascii switch to see if it helps.


 Cannot find a suitable cmap table

I'm not enough familiar with the TTF format, but this may be likely
caused by an incomplete/invalid font, data corruption or even missing
character glyphs. I'd suggest FontForge [2] (a pretty complete font
toolkit) for researching these and other potential issues. :-)

By the way: FontForge also allows converting TTF to SVG fonts,
although I never have compared the conversion with Batik (in terms of
features, quality, etc.): if you try it, remember to post your
findings! ;-)


Hope this helps,
  Helder


[1] http://xmlgraphics.apache.org/batik/tools/font-converter.html
[2] http://fontforge.sourceforge.net/

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: problem on converting TTF to SVG: it doesn't support non ascii TTF like chinese?

2009-07-19 Thread Helder Magalhães
Hi Creatxr,


Please don't create (similar) multiple threads before holding a few
days for a response on a previous one...


 java -jar batik-ttf2svg.jar c:/windows/Fonts/bnucdp.ttf -autorange -o 
 e:/a/bnucdp.svg -testcard    ---fail
[...]
 java -jar batik-ttf2svg.jar c:/windows/Fonts/cour.ttf -autorange -o 
 e:/a/cour.svg -testcard --success

Is autorange a valid switch? The documentation has nothing on it...
(Of course, this may be a documentation caveat, something which
can/should be addressed.)

As stated, probably the problem is within that particular font. Your
test seems to support that theory. See more detailed comments in the
reply to your previous thread.


Regards,
 Helder


[1] http://xmlgraphics.apache.org/batik/tools/font-converter.html

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: size of a svg document!

2009-06-19 Thread Helder Magalhães
Hi Paul,

 there is a nice getBBox() method for SVGLocatable, which works quite well
 (at least with Batik 1.8), although it is tricky and not really documented.

Well, I wouldn't say tricky: that method is part of the SVG DOM and
therefore it's better documented within the specification [1].
Nevertheless, you have example(s) [2] within the Batik documentation
and a recent explanation [3] in the mailing list why the Javadoc isn't
available for those few interfaces... ;-)

Hope this helps,
 Helder

[1] http://www.w3.org/TR/SVG/types.html#InterfaceSVGLocatable
[2] http://xmlgraphics.apache.org/batik/using/scripting/java.html#SVGDOM
[3] 
http://www.nabble.com/javadoc-links-to-w3.org-broken--td22811749.html#a22818793

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



Re: Zoom Out Limit

2009-06-10 Thread Helder Magalhães
Hi mistercaste,


 To limit the zoom-out function:
[code snippet]
 ...hope this helps. Cheers :-)

Thanks for sharing. :-)  I'd suggest that interesting/potentially
useful code snippets would be placed in the Batik Wiki [1] to avoid
getting lost within the mailing list. The UserContributions section,
which already has a related CanvasInteractors page, seemed
appropriate. ;-)

Also, for future contributions that may involve changing the Batik
source code (not this one, apparently), you may also consider
providing a patch and/or create an issue (which can be of type
request for enhancement) within the bug tracker. ;-)


Regards,
 Helder


[1] http://wiki.apache.org/xmlgraphics-batik/

-
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org



  1   2   3   4   >