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

support for COLR CPAL #237

Open
typemytype opened this Issue Nov 3, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@typemytype
Copy link
Owner

commented Nov 3, 2018

extract path and color into a bezierPaths somehow

I dont know what the current support is from the OS, how does COLR CPAL tables behave in TextEdit.app

Also dont know what the api should be for supporting this.

see http://forum.drawbot.com/topic/89/color-fonts-create-outlines-changing-palettes/3

@djrrb

This comment has been minimized.

Copy link

commented Nov 4, 2018

I dont know what the current support is from the OS, how does COLR CPAL tables behave in TextEdit.app

At least as of High Sierra, COLR/CPAL is supported in TextEdit.app.

screen shot 2018-11-03 at 7 55 48 pm

Also dont know what the api should be for supporting this.

In case my suggestion is useful, I guess I see two parts:

  1. Set or get your own color palette and keep it as “text”
  2. Convert to multiple BezierPaths

For 1, I suppose FormattedString could have a colorPalette argument that accepts an index from the CPAL table or a list of custom-defined colors.

But this might need to rely upon OS support, and as far as I know there isn’t a way via MacOS typography to access the alternate color palettes stored in CPAL, or to set your own colors. (See Rob’s solution in the Forum using font tools)

For 2, Could FormattedString have a .getBezierPaths() method or something that would return either a single or multiple bezier paths for the text? I realize this is a little circular with BezierPath already having a text() method, but maybe that’s a nice feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.