Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG viewbox shouldn't be required, default to 2048x2048. #8

Open
13rac1 opened this issue Aug 2, 2016 · 0 comments
Open

SVG viewbox shouldn't be required, default to 2048x2048. #8

13rac1 opened this issue Aug 2, 2016 · 0 comments
Assignees
Labels

Comments

@13rac1
Copy link
Owner

13rac1 commented Aug 2, 2016

Color SVG files shouldn't require a viewbox attribute. Assume 2048x2048 viewbox attribute if missing.

Note: Viewbox is required in B&W SVGs to calculate glyph width for proportional fonts.

Found while working on: 13rac1/emojione-color-font#50

Traceback (most recent call last):
  File "SCFBuild/bin/scfbuild", line 17, in <module>
    sys.exit(main())
  File "/home/example/development/emojione-color-font/SCFBuild/scfbuild/main.py", line 124, in main
    return builder.run()
  File "/home/example/development/emojione-color-font/SCFBuild/scfbuild/builder.py", line 74, in run
    self.add_color_svg()
  File "/home/example/development/emojione-color-font/SCFBuild/scfbuild/builder.py", line 102, in add_color_svg
    svg_transform = self.create_color_transform(filepath)
  File "/home/example/development/emojione-color-font/SCFBuild/scfbuild/builder.py", line 186, in create_color_transform
    svg_height, svg_width = util.get_dimensions(filepath)
  File "/home/example/development/emojione-color-font/SCFBuild/scfbuild/util.py", line 60, in get_dimensions
    dims = root.attrib['viewBox'].split(' ')
KeyError: u'viewBox'
@13rac1 13rac1 added the bug label Aug 2, 2016
@13rac1 13rac1 self-assigned this Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant