Giter Site home page Giter Site logo

Comments (14)

punchcutter avatar punchcutter commented on June 20, 2024 1

Ah, but that's the same exact error, just a different backend. At the point drawPaintSolid is called the path is None in both cases. cairo tries to replay the path, skia tries to access path.path.

from fontgoggles.

punchcutter avatar punchcutter commented on June 20, 2024

I get the same with my totally different implementation of blackrenderer using cairo. Other glyphs are fine, but when I view this one and lots of others I get flashing or nothing.

Traceback (most recent call last):
File "/Users/somebody/glyph_viewer.py", line 530, in OnPaint
self.brFont.drawGlyph(self.currentGlyphName, cairoCanvas,
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 166, in drawGlyph
self._drawGlyphCOLRv1(glyph, canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 191, in _drawGlyphCOLRv1
self._drawPaint(glyph.Paint, canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 211, in _drawPaint
drawHandler(paint, canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 219, in _drawPaintColrLayers
self._drawPaint(self.colrLayersV1.Paint[i], canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 211, in _drawPaint
drawHandler(paint, canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 353, in _drawPaintComposite
self._drawPaint(paint.BackdropPaint, canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 211, in _drawPaint
drawHandler(paint, canvas)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/font.py", line 223, in _drawPaintSolid
canvas.drawPathSolid(self.currentPath, color)
File "/Users/somebody/somevenv/lib/python3.10/site-packages/blackrenderer/backends/cairo.py", line 105, in drawPathSolid
path.replay(self._pen)
AttributeError: 'NoneType' object has no attribute 'replay'

from fontgoggles.

justvanrossum avatar justvanrossum commented on June 20, 2024

That may be the same error, I'll have a look.

from fontgoggles.

justvanrossum avatar justvanrossum commented on June 20, 2024

Definitely a bug in blackrenderer, though I get yet another error:

Traceback (most recent call last):
  File "/Users/just/code/git/BlackFoundry/black-renderer/venv/bin/blackrenderer", line 33, in <module>
    sys.exit(load_entry_point('blackrenderer', 'console_scripts', 'blackrenderer')())
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/__main__.py", line 43, in main
    renderText(
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/render.py", line 78, in renderText
    font.drawGlyph(glyph.name, canvas, palette=palette)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 166, in drawGlyph
    self._drawGlyphCOLRv1(glyph, canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 191, in _drawGlyphCOLRv1
    self._drawPaint(glyph.Paint, canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 211, in _drawPaint
    drawHandler(paint, canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 219, in _drawPaintColrLayers
    self._drawPaint(self.colrLayersV1.Paint[i], canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 211, in _drawPaint
    drawHandler(paint, canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 353, in _drawPaintComposite
    self._drawPaint(paint.BackdropPaint, canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 211, in _drawPaint
    drawHandler(paint, canvas)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/font.py", line 223, in _drawPaintSolid
    canvas.drawPathSolid(self.currentPath, color)
  File "/Users/just/code/git/BlackFoundry/black-renderer/Lib/blackrenderer/backends/skia.py", line 104, in drawPathSolid
    self.canvas.drawPath(path.path, paint)
AttributeError: 'NoneType' object has no attribute 'path'

from fontgoggles.

justvanrossum avatar justvanrossum commented on June 20, 2024

But FontGoggles should also not crash like that when it encounters a blackrenderer bug.

from fontgoggles.

punchcutter avatar punchcutter commented on June 20, 2024

I don't know what non-BMP has to do with it. 🎛 🎟 🎫 all fail for me, but everything else seems fine from what I can tell so far.

from fontgoggles.

yarmola avatar yarmola commented on June 20, 2024

Probably it is this particular glyph. It is built using the COLRv1 composition operator COMPOSITE_SRC_IN, but "backend" is empty. It does not look good (font-side) and I am investigating it (and will open issue in Noto Color Emoji if I find something), but I don't think renderer should crash.

from fontgoggles.

justvanrossum avatar justvanrossum commented on June 20, 2024

@yarmola, there'a already more discussion and analysis over at BlackFoundryCom/black-renderer#116. The font is fine, but blackrenderer doesn't implement this case correctly.

from fontgoggles.

anthrotype avatar anthrotype commented on June 20, 2024

hey Yuri, the backround is not empy, it's simply unbounded, which is valid and spec'ed here: https://learn.microsoft.com/en-us/typography/opentype/spec/colr#metrics-and-boundedness-of-color-glyphs-using-version-1-formats

from fontgoggles.

yarmola avatar yarmola commented on June 20, 2024

Right, thanks!

Funny that in the sample above in the spec

They have unbounded gradient fill in "source" part of the composite operator while in the real font it is in the "backdrop" part (and it makes more sense).

I checked SVG origin of this glyph and it has "group" of objects with assigned transparency.
Anyway, I think I should move to the black renderer repo with this, I believe the issue related to FontGoggles is clear :)

from fontgoggles.

anthrotype avatar anthrotype commented on June 20, 2024

They have unbounded gradient fill in "source" part of the composite operator while in the real font it is in the "backdrop" part (and it makes more sense).

good point, we should fix that actually. Mind filing an issue for this on the https://github.com/googlefonts/colr-gradients-spec repo?

from fontgoggles.

justvanrossum avatar justvanrossum commented on June 20, 2024

This should be fixed in FontGoggle 1.7.0: https://github.com/justvanrossum/fontgoggles/releases

from fontgoggles.

PeterConstable avatar PeterConstable commented on June 20, 2024

They have unbounded gradient fill in "source" part of the composite operator while in the real font it is in the "backdrop" part (and it makes more sense).

good point, we should fix that actually. Mind filing an issue for this on the https://github.com/googlefonts/colr-gradients-spec repo?

No, please open an issue on the COLR page of the OT spec. (For the figure in the spec, an SVG with feComposite was used to create the example, it in that SVG the rectangle with the alpha gradient is the destination (in2 attribute), not the source (in attribute).) If source and destination are reversed (as currently in the spec's figure), then the result would be the black alpha-gradient rectangle clipped to the circle.

from fontgoggles.

PeterConstable avatar PeterConstable commented on June 20, 2024

For COMPOSITE_SRC_IN, the PaintComposite is bounded if either the source or destination is bounded. That's implicit in the definition in the CSS spec. If some library is failing because the source graphic is unbounded even though the destination graphic is bounded, then that would seem to be either a bug in that library or a limitation of that library that implementations using it need to work around.

from fontgoggles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.