opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

Opentype.js can only draw black text.

Open ILOVEPIE opened this issue 8 months ago • 3 comments

Expected Behavior

There should be a way to specify the color of the text being drawn.

Current Behavior

opentype.js is the Henry Ford of font rendering "Any [user] can have [their text] any color that [they want] so long as it is black."

Possible Solution

Allow a color to be selected in the draw call for Font and Glyph objects.

Context

My library has to manually draw the path to work around this, granted I have to do this anyways as I need to stroke the text too, but my point stands.

ILOVEPIE avatar Oct 20 '23 00:10 ILOVEPIE

My take on this is, maybe opentype.js shouldn't draw at all. Why duplicate API? Have opentype.js just make the path on the canvas an the caller can fill and stroke it.

axkibe avatar Jan 27 '24 07:01 axkibe

My take on this is, maybe opentype.js shouldn't draw at all. Why duplicate API? Have opentype.js just make the path on the canvas an the caller can fill and stroke it.

We could do it either way.

ILOVEPIE avatar Jan 27 '24 09:01 ILOVEPIE