syntra / gatsby-remark-social-cards

Gatsby remark plugin for generating social card graphics
MIT License
95 stars 17 forks source link

Change font folder structure #2

Open AriTheElk opened 6 years ago

AriTheElk commented 6 years ago

The fonts/ directory was created on a whim before there was much direction in this project (this plugin started as a simple proof-of-concept). Because of that, the folder structure of the fonts will become increasingly difficult to manage if it's maintained as-in. So we need to take steps to improve the structure of that.

The Problem

Currently the folder structure looks something like this:

fonts/
    DejaVuSansCondensed_black_bold_16.fnt
    DejaVuSansCondensed_black_bold_16.png
    DejaVuSansCondensed_black_bold_24.fnt
    DejaVuSansCondensed_black_bold_24.png
    ...

This will become a mess when adding new fonts.

The Solution

Ideally, I think a structure like this would improve manageability of adding many fonts in the future

fonts/
    DejaVuSansCondensed/
        black/
            bold_16.fnt
            italic_16.fnt
            normal_16.fnt

I'm totally open to suggestions on this, it's not set in stone. I realize that there are many different ways to handle the structure. Instead of having black/, maybe it's better to group by size. So it would be DejaVuSansCondensed/16/bold_black.fnt. Maybe go even deeper and do DejaVuSansCondensed/16/black/bold.fnt

Notes

It might be better to wait until #1 is addressed since the color portion of the path is likely to be removed once we have dynamic colors.