photopea / Typr.js

Typr.js - process fonts in Javascript
MIT License
914 stars 73 forks source link

Applying different colors to a single line of text. #52

Closed xmejsieoke closed 2 months ago

xmejsieoke commented 2 months ago

I want to change the first three characters to white and the last three characters to red, but all characters are ending up with the final color. image image

photopea commented 2 months ago

try to call ctx.beginPath() before calling stringToContext()

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/beginPath

BTW. the latest Typr.js does not have stringToContext. I recommend switching to the latest Typr.js

xmejsieoke commented 2 months ago

Cool!