{"action":"created","issue":{"url":"https://api.github.com/repos/vega/vega/issues/1315","repository_url":"https://api.github.com/repos/vega/vega","labels_url":"https://api.github.com/repos/vega/vega/issues/1315/labels{/name}","comments_url":"https://api.github.com/repos/vega/vega/issues/1315/comments","events_url":"https://api.github.com/repos/vega/vega/issues/1315/events","html_url":"https://github.com/vega/vega/issues/1315","id":330938402,"node_id":"MDU6SXNzdWUzMzA5Mzg0MDI=","number":1315,"title":"Don't use shorthand font property in SVG output","user":{"login":"davidanthoff","id":1036561,"node_id":"MDQ6VXNlcjEwMzY1NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1036561?v=4","gravatar_id":"","url":"https://api.github.com/users/davidanthoff","html_url":"https://github.com/davidanthoff","followers_url":"https://api.github.com/users/davidanthoff/followers","following_url":"https://api.github.com/users/davidanthoff/following{/other_user}","gists_url":"https://api.github.com/users/davidanthoff/gists{/gist_id}","starred_url":"https://api.github.com/users/davidanthoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidanthoff/subscriptions","organizations_url":"https://api.github.com/users/davidanthoff/orgs","repos_url":"https://api.github.com/users/davidanthoff/repos","events_url":"https://api.github.com/users/davidanthoff/events{/privacy}","received_events_url":"https://api.github.com/users/davidanthoff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-10T04:02:52Z","updated_at":"2018-06-11T00:44:26Z","closed_at":null,"author_association":"NONE","body":"Currently the SVG output of vega uses the [shorthand font property](https://www.w3.org/TR/CSS2/fonts.html#font-shorthand). This is a feature that librsvg [doesn't support](https://gitlab.gnome.org/GNOME/librsvg/issues/34) at this point (and in fact there is a discussion in that issue that kind of seems to suggest that it might not be spec compliant, although I'm not sure about that). librsvg seems by far the best option right now to convert a SVG image into PNG, PDF, PS etc., and it seems really widely used in all sorts of software. There also doesn't seem to be any real alternative open source solution that one could use instead, so I think it would be great if vega just outputed SVG files that librsvg then can convert successfully.\r\n\r\nThe only change that would be required is really that instead of using the ``font`` property in the CSS ``style`` attribute, vega would output individual properties like ``font-style``, ``font-family`` etc.\r\n\r\nThis is currently a pretty big problem for the julia wrapper for [VegaLite.jl](https://github.com/fredo-dedup/VegaLite.jl). We use librsvg for all our output handling (saving to PNG, PDF, PS, viewing things in clients that don't support vega-lite nativly etc.), and this essentially means that right now any non-standard font configuration doesn't show properly.\r\n\r\nCC @domoritz and @kanitw because it affects a Vega-Lite frontend."},"comment":{"url":"https://api.github.com/repos/vega/vega/issues/comments/396095345","html_url":"https://github.com/vega/vega/issues/1315#issuecomment-396095345","issue_url":"https://api.github.com/repos/vega/vega/issues/1315","id":396095345,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjA5NTM0NQ==","user":{"login":"davidanthoff","id":1036561,"node_id":"MDQ6VXNlcjEwMzY1NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1036561?v=4","gravatar_id":"","url":"https://api.github.com/users/davidanthoff","html_url":"https://github.com/davidanthoff","followers_url":"https://api.github.com/users/davidanthoff/followers","following_url":"https://api.github.com/users/davidanthoff/following{/other_user}","gists_url":"https://api.github.com/users/davidanthoff/gists{/gist_id}","starred_url":"https://api.github.com/users/davidanthoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidanthoff/subscriptions","organizations_url":"https://api.github.com/users/davidanthoff/orgs","repos_url":"https://api.github.com/users/davidanthoff/repos","events_url":"https://api.github.com/users/davidanthoff/events{/privacy}","received_events_url":"https://api.github.com/users/davidanthoff/received_events","type":"User","site_admin":false},"created_at":"2018-06-11T00:44:26Z","updated_at":"2018-06-11T00:44:26Z","author_association":"NONE","body":"> So what would prevent librsvg's developers to support this feature?\r\n\r\nI guess in theory nothing, but the following all makes it unlikely in my opinion that this would be a strategy that solves this anytime soon: a) that issue has been open on their repo for 3 years, b) they seem to be in the middle of a major rewrite to port everything to rust and c) it would take a long time for any new rsvg version to be adopted in the various distributions/apps that use it.\r\n\r\nFor the julia wrapper more specifically, it was a major feat to pull of all the cross-compile of the current rsvg and make it available to all packages easily on all packages (not by me, others did that). Realistically I just don't see anyone redoing all of that with some potential future rust version anytime soon. So I think I'll just have to work with the currently shipping version of librsvg for the julia wrapper for Vega-Lite.\r\n\r\nSo yes, this is clearly asking the Vega folks to work around a bug upstream. But I think in this case that might be a good strategy because it would make the vega output work on a lot more downstream software, plus the change doesn't seem associated with any major drawbacks: yes, the SVG files would get slightly larger, but it only applies to text elements, which I would typically imagine isn't that big of a deal."}}
{"actor":{"display_login":"davidanthoff"}}