Edit:
Well, I typed TTF as TFF. Typo would be a big reason why I couldn’t get it to work
How can I show previews/thumbnails of fonts? Something like this works for images ,but I can’t figure out if fonts is possible. I know when you load fonts and switch view to thumbnails it shows.
def generate_previews():
pcoll = preview_collections["thumbnail_previews"]
image_location = pcoll.images_location
VALID_EXTENSIONS = ('.png', '.jpg', '.jpeg')
enum_items = []
# Generate the thumbnails
for i, image in enumerate(os.listdir(image_location)):
if image.endswith(VALID_EXTENSIONS):
filepath = os.path.join(image_location, image)
thumb = pcoll.load(filepath, filepath, 'IMAGE')
enum_items.append((image, image, "", thumb.icon_id, i))
return enum_items
I tried changing
thumb = pcoll.load(filepath, filepath, 'IMAGE')
to
thumb = pcoll.load(filepath, filepath, 'FONT')
for valid extensions I tried
VALID_EXTENSIONS = ('.tff', '.fon')