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

Batik does not support the "local" keyword in @font-face

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7
    • None
    • CSS
    • None
    • OS X Yosemite

    Description

      I have a CSS stylesheet containing markup of the form,

      @font-face {
        font-family: "body";
        src: local("DejaVu Sans"),
          url("data:application/x-font-otf;base64,datadatadatadatadatadata");
      }
      

      When I open this in Batik Squiggle (version 1.7), I get the following error message:

      SVG Error:

      The following stylesheet represents an invalid
      CSS document.
      @font-face { ... }

      Original message:
      The "src" property does not support function values.

      If I remove the local("DejaVu Sans"), Batik behaves and renders the font from the data URI. Support for the local keyword is required by the CSS spec:

      The notation for a <font-face-name> is the full font name, which must be quoted since it may contain any character, including spaces and punctuation, and also must be enclosed in "local(" and ")".

      This bug prevents Batik from being able to render most modern @font-family declaration blocks. Font distributors like Google and FontSquirrel both have a local included by default.

      There are a number of issues around the internet with other people running into this problem, like this one.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sffc Shane
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: