TheRenegadeCoder / image-titler

An image title generator using The Renegade Coder style
https://therenegadecoder.com
GNU General Public License v3.0
17 stars 6 forks source link

Custom Fonts Don't All Show Up in GUI #66

Closed jrg94 closed 4 years ago

jrg94 commented 4 years ago

I just realized that the following expression actually removes multiple versions of a font from the same family:

FONTS = {f.name: f.fname for f in font_manager.fontManager.ttflist}

Also, the way this generates fonts, it makes it difficult to map them back when using the CLI. Perhaps that issue will be solved if I can find a way to get all fonts listed.

jrg94 commented 4 years ago

So, I'm toying with this right now:

len(font_manager.fontManager.ttflist)
376
FONTS = {
...     f"{f.name} ({f.weight})": f.fname
...     for f in font_manager.fontManager.ttflist
... }
len(FONTS)
280

Looks like I may have to list all variables.

jrg94 commented 4 years ago

Even when listing all types, I wasn't able to get the total number. I'm wondering if their are duplicates:

FONTS = {
...     f"{f.name} ({f.weight}, {f.style}, {f.stretch}, {f.size}, {f.variant})": f.fname
...     for f in font_manager.fontManager.ttflist
... }
len(FONTS)
365
len(font_manager.fontManager.ttflist)
376
jrg94 commented 4 years ago

Ended up fixing this late last night, but I think I’ll need to make additional drop down settings for the various variables available. I’m not sure how this will work yet of course.