Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-940

Opening a drawing using fonts with blanks in name causes errors

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • 1.7
    • None
    • SVG Viewer
    • None
    • Operating System: Windows XP
      Platform: PC

    Description

      I am using fonts with blanks in their names when creating drawings, for instance the font "Frutiger LT 45 Light" (I am using Inkscape to create my drawings). Opening such a document with Squiggle or another tool using the library causes a svg error.

      Attachments

        1. Konsistenz.svg
          10 kB
          axel.brinkop

        Issue Links

          Activity

            axel.brinkop@gmx.de axel.brinkop added a comment -

            Attachment Konsistenz.svg has been added with description: Example drawing to reproduce the error

            axel.brinkop@gmx.de axel.brinkop added a comment - Attachment Konsistenz.svg has been added with description: Example drawing to reproduce the error

            The actual displayed error is:
            The "font-family" property does not support integer values.
            This hints towards Batik trying to parse each of the tokens which constitute the font name independently, instead of taking the whole expression. :-|

            According to my tests (from a while ago), having multi-word font names without any delimiters should be the proper way of declaring multiple word fonts (or, at least, handled gracefully) due to a few reasons:

            • An example [1] hints towards not surrounding names with delimiters;
            • ASV (Adobe SVG Viewer) doesn't support apostrophe (');
            • Opera complains if quote (") is used.

            Note that BATIK-922 already exists to track issues with vendor-specific properties (such as "-inkscape-font-specification", which are also embedded in the file), which is also somehow related. By surrounding the font family with apostrophes, nothing unexpected happened, though (i.e., the file is parsed without any errors)...

            For now, I'm only slightly decreasing importance as this can be somehow easily worked around.

            Thanks for the report!

            [1] http://www.w3.org/Style/Examples/007/fonts#font-family

            helder.magalhaes@gmail.com Helder Magalhães added a comment - The actual displayed error is: The "font-family" property does not support integer values. This hints towards Batik trying to parse each of the tokens which constitute the font name independently, instead of taking the whole expression. :-| According to my tests (from a while ago), having multi-word font names without any delimiters should be the proper way of declaring multiple word fonts (or, at least, handled gracefully) due to a few reasons: An example [1] hints towards not surrounding names with delimiters; ASV (Adobe SVG Viewer) doesn't support apostrophe ('); Opera complains if quote (") is used. Note that BATIK-922 already exists to track issues with vendor-specific properties (such as "-inkscape-font-specification", which are also embedded in the file), which is also somehow related. By surrounding the font family with apostrophes, nothing unexpected happened, though (i.e., the file is parsed without any errors)... For now, I'm only slightly decreasing importance as this can be somehow easily worked around. Thanks for the report! [1] http://www.w3.org/Style/Examples/007/fonts#font-family

            CSS 2.1 http://www.w3.org/TR/CSS21/fonts.html#font-family-prop doesn't provide an exact grammar to be used for parsing font-family values, but I think unquoted numbers should be accepted. At least, that's what I think the description in the above URL implies.

            To fix this I think the org.apache.batik.css.engine.value.css2.FontFamilyManager.createValue() method needs to be changed to allow more than just SAC_STRING_VALUE and SAC_IDENT in the loop. (Basically, it would parse anything excep a comma, semicolon, parenthesis or brace.)

            cam Cameron McCormack added a comment - CSS 2.1 http://www.w3.org/TR/CSS21/fonts.html#font-family-prop doesn't provide an exact grammar to be used for parsing font-family values, but I think unquoted numbers should be accepted. At least, that's what I think the description in the above URL implies. To fix this I think the org.apache.batik.css.engine.value.css2.FontFamilyManager.createValue() method needs to be changed to allow more than just SAC_STRING_VALUE and SAC_IDENT in the loop. (Basically, it would parse anything excep a comma, semicolon, parenthesis or brace.)

            Following the resolution given to BATIK-825 this is being marked as "duplicate" of BATIK-960. Again, this maybe should depend on that issue but this is being mostly done for consistency with the previous action.

            helder.magalhaes@gmail.com Helder Magalhães added a comment - Following the resolution given to BATIK-825 this is being marked as "duplicate" of BATIK-960 . Again, this maybe should depend on that issue but this is being mostly done for consistency with the previous action.

            People

              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              axel.brinkop@gmx.de axel.brinkop
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: