You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2008/11/19 07:14:00 UTC

DO NOT REPLY [Bug 46238] New: @font-face causes null pointer exception

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

           Summary: @font-face causes null pointer exception
           Product: Batik
           Version: 1.7
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bridge
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: tonys@turnkey.com.au


The following causes a null pointer exception in FontFace.createFontFace:

  <defs>
    <style type="text/css"><![CDATA[
      @font-face { font-family:Arial}
      .fnt {font-weight:normal;font-size:42;font-family:Arial}
    ]]></style>
  </defs>

I'm not sure what the intention is, or if this is valid CSS.

The following patch allows the SVG to be displayed, but I'm not claiming that
it's a proper fix:

    protected FontFace(String familyName) {
        super(familyName);
        srcs = new ArrayList();  // added
    }


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 46238] @font-face causes null pointer exception

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46238





--- Comment #1 from Tony Stevens <to...@turnkey.com.au>  2008-11-18 22:18:57 PST ---
Make that new LinkedList() instead of ArrayList();


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 46238] @font-face causes null pointer exception

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46238





--- Comment #3 from Tony Stevens <to...@turnkey.com.au>  2008-11-19 12:00:19 PST ---
Where I come from no one would dare suggest that throwing an NPE does not
indicate a bug :-)

As I said, I'm not suggesting a particular fix. Perhaps I should have been
clearer that by ignoring the @font-face the document is rendered correctly. In
general, the philosophy of CSS is to ignore anything invalid and continue (see
http://www.w3.org/TR/CSS2/syndata.html#parsing-errors for example), but I agree
that throwing a meaningful exception may be more appropriate.

Just for the record, it's not my SVG, so I can't make the change you suggest to
"make the NPE go away".


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 46238] @font-face causes null pointer exception

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46238





--- Comment #2 from Helder Magalhães <he...@gmail.com>  2008-11-19 07:13:47 PST ---
(In reply to comment #0)
The mailing list seems more appropriate for general troubleshooting of things
which are not certain to be bugs... ;-)



>       @font-face { font-family:Arial}
[...]
> I'm not sure what the intention is, or if this is valid CSS.

By reading the applicable specification [1], it sounds like (it's not clear to
me) that font face should always need a "src" attribute. So for your sample, as
it seems that you are intending a locally available font, a "local" URL seemed
reasonable. This should make the NPE go away, although I haven't tested for
sure.



> The following patch allows the SVG to be displayed, but I'm not claiming that
> it's a proper fix:

I'm not sure if the developers want to proceed with the fix: while I believe
that Batik shouldn't break with invalid content, it seems that Batik is
standards compliant so it should avoid rendering invalid content - maybe
throwing an exception would be more coherent?



[1] http://www.w3.org/TR/CSS2/fonts.html#font-descriptions


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org