petrvanblokland / TYPETR-Bitcount

Bitcount VF
SIL Open Font License 1.1
3 stars 1 forks source link

Blend Modes? #2

Closed davelab6 closed 4 months ago

davelab6 commented 1 year ago

Since COLRv1 supports blending modes (overlay, multiply etc) I wonder if you can use them in Bitcount to make some nice pattern effects :) GF will not otherwise have any showcasing for this. You may be interested to chat with @simoncozens about it

davelab6 commented 1 year ago

Rod mentioned,

COLRv1 supports https://www.w3.org/TR/compositing-1/. In time we'll need an update for new modes, https://github.com/googlefonts/colr-gradients-spec/issues/364.

simoncozens commented 1 year ago

To use composite blending, change the lines:

    for x, y in pixelPositions:
        layers.append(PaintTranslate(x, y, PaintGlyph(pixelGlyphName, layer1)))
        layers.append(PaintTranslate(x, y, PaintGlyph(pixelGlyphName, layer2)))

to

        layers.append(PaintTranslate(x, y, PaintComposite(
            "multiply",
            PaintGlyph(pixelGlyphName, layer1),
            PaintGlyph(pixelGlyphName, layer2),
        )))
Screenshot 2023-06-07 at 15 39 04
davelab6 commented 4 months ago

@petrvanblokland was this used?

davelab6 commented 4 months ago

No :) Its just a mask on the colours