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

colr2svg.py broken by refactor #466

Open
narinishi opened this issue Apr 2, 2024 · 3 comments
Open

colr2svg.py broken by refactor #466

narinishi opened this issue Apr 2, 2024 · 3 comments

Comments

@narinishi
Copy link

colr2svg depends on a module called colr_to_svg. This used to reside under the 'tests' directory, however has since been moved to the main source folder, without colr2svg being updated.

After correcting my checked out copy for the above issue, colr2svg was able to begin execution, though failed to process the COLRv1 font I had at hand, so additional changes may be required.

@anthrotype
Copy link
Member

failed to process the COLRv1 font I had at hand, so additional changes may be required.

in what way?

@anthrotype anthrotype reopened this Apr 2, 2024
@anthrotype
Copy link
Member

btw, I fixed the import of colr_to_svg here on main

@narinishi
Copy link
Author

narinishi commented Apr 3, 2024

font used was https://github.com/googlefonts/color-fonts/blob/main/fonts/noto-glyf_colr_1.ttf

Traceback (most recent call last):
  File "tools\colr2svg.py", line 44, in <module>
    for glyph_name, svg in colr_to_svg(
  File "python-3.8.0-embed-amd64\nanoemoji-main\src\nanoemoji\colr_to_svg.py", line 420, in colr_to_svg
    svgs = _colr_v1_to_svgs(view_box_callback, ttfont)
  File "python-3.8.0-embed-amd64\nanoemoji-main\src\nanoemoji\colr_to_svg.py", line 400, in _colr_v1_to_svgs
    return {
  File "python-3.8.0-embed-amd64\nanoemoji-main\src\nanoemoji\colr_to_svg.py", line 403, in <dictcomp>
    _colr_v1_glyph_to_svg(ttfont, glyph_set, view_box_callback, g)
  File "python-3.8.0-embed-amd64\nanoemoji-main\src\nanoemoji\colr_to_svg.py", line 352, in _colr_v1_glyph_to_svg
    view_box, font_to_vbox = _view_box_and_transform(
  File "python-3.8.0-embed-amd64\nanoemoji-main\src\nanoemoji\colr_to_svg.py", line 340, in _view_box_and_transform
    view_box = view_box_callback(glyph_name)
TypeError: 'Rect' object is not callable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants