Skip to content

Make glyph-only layers more workable#4078

Draft
ctrlcctrlv wants to merge 3 commits intofontforge:masterfrom
ctrlcctrlv:COLR_CPAL_WIP
Draft

Make glyph-only layers more workable#4078
ctrlcctrlv wants to merge 3 commits intofontforge:masterfrom
ctrlcctrlv:COLR_CPAL_WIP

Conversation

@ctrlcctrlv
Copy link
Copy Markdown
Member

@ctrlcctrlv ctrlcctrlv commented Dec 23, 2019

This is not yet ready for merge!

I'm opening this to get comment, hopefully.

I'll at least need this, or something like this, to get COLR/CPAL working...

This fixes a crash if you add font-level layers when a glyph has its own layers. It correctly moves the glyph-level layers, and their data, after the font-level layers.

I also need to make it so that "multi-layer" (that is to say, fonts where glyphs can have their own number of "extra" layers) fonts can have qudaratic layers, so as you can see, I'm removing a lot of the rules, and I added a "Q/C" marker to the UI for type 3 fonts. More UI work certainly needs to be done.

I'm opening this now and early because if we can't even agree to do this simple stuff COLR/CPAL support will never get approved.

An example file

Compare to master, especially when adding glyph-only layers in the CharView, and font-level layers in «Font Info→Layers».

COLR_CLAP_WIP.sfd

@ctrlcctrlv
Copy link
Copy Markdown
Member Author

Still working on the UI. Trying to colorize it, it's proving to be hard; probably going to take me longer than a few days.

FontForge generates a BDFFont when drawing the FontView and the MetricsView (e.g. see MVResize), the clut of which can only contain grays.

SplineFontPieceMeal ends up generating those gray glyphs, through e.g. FillChar (splinefill.c).

All of this code is expecting greys. Hacking full RGBA in is going to take time, and I'm not even sure the best way to do it. Should I lean more heavily on FreeType? Should I work it into George's rasterizer?

IDK...lots of unanswered questions.

@ctrlcctrlv
Copy link
Copy Markdown
Member Author

I've changed my mind. The fastest way to get color into the FontView and MetricsView is likely through the functions in freetype.c. Still investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant