Skip to content

[Feature Request]: [ThumbRenderer]: PlainText Unicode Fonts #1285

Open

Description

@mm12

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

Description

the _text_thumb method renders the thumbnail for text files. Unfortunately, it does not specify a font. Because of this, a large number of characters show up as placeholder boxes, which isn't ideal:

Image

Solution

For thumbnails, the only thing needed to fix this is to use font(s) with wide Unicode support. System fonts (such as Meiryo on Windows) tend to have great support. Another good option, if available, is using Google's Noto family of fonts.
For the preview pane, I certainly think that using a rich preview of the text (ie, actually render the text) instead of the thumbnail would be ideal.

I tested it, and indeed this fixes the problem (minimal version):

+ font = None
+ meiryo_path = Path("C:/Windows/Fonts/meiryo.ttc")
+ try:
+     font = ImageFont.truetype(str(meiryo_path), size=16)
+ except OSError:
+     font = ImageFont.load_default() 
+ draw.text((16, 16), text, fill=fg_color, font=font)
- draw.text((16, 16), text, fill=fg_color)

And indeed, the thumbnail now renders the text.

Alternatives

I find rich text highly desirable - text in images will always be flawed.

Activity

  1. mm12 commented on Jan 18, 2026

    @mm12
    Author

    Side note: The temp fix does fail sometimes. I have tracked this down the the library we use for determining the encoding returning an incorrect result. As a quickfix to this, a UnicodeDecodeError can fall back to UTF-8 before bailing out completely.

  2. TrigamDev commented on Mar 1, 2026

    @TrigamDev
    Collaborator

    This would be closed by #1226, since it replaces text files previews with a text box, rather than a rendered image

  3. added
    Type: BugSomething isn't working as intended
    and removed on Mar 1, 2026
  4. added theissue type on Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TagStudio: Thumbs/PreviewsFile thumbnails or previewsType: BugSomething isn't working as intendedType: SuggestionA suggestion for how a feature could be implemented

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions