Skip to content

bug: text-freetype2: toggling Antialiasing blanks characters in "Read from file" text #484

Closed

Description

@chriscoveries

Summary

On a Text (FreeType 2) source that reads from a file, changing the Antialiasing checkbox wipes the glyph atlas but does not rebuild the text. Characters outside the small built-in set (accented letters, non-Latin scripts, : and ;) draw as empty space until the file next changes. Severity: low to medium. It is cosmetic and self-heals when the file is edited, but it hits any file-driven overlay that is not plain ASCII.

Steps / trigger

  1. Add a Text (FreeType 2) source, set "Read from file", and point it at a UTF-8 file containing a character such as é.
  2. Open the source properties and toggle Antialiasing.
  3. The é (and any other non-standard glyph) disappears. The same toggle on a source using inline text keeps the character.

Cause

Line numbers are against current master.

  • plugins/text-freetype2/text-freetype2.c:417-423: on an antialiasing change the atlas buffer is zeroed (:420) and only the standard glyph set is recached (:422, defined in text-functionality.c:196-206). vbuf_needs_update is not set.
  • plugins/text-freetype2/text-freetype2.c:464-467: the file path passes vbuf_needs_update as the force argument of ft2_text_file_watch_set.
  • plugins/text-freetype2/text-file.c:217-218: with an unchanged path and force == false it returns FT2_TEXT_FILE_UNCHANGED.
  • plugins/text-freetype2/text-freetype2.c:481-482: that result jumps to error:, skipping cache_glyphs and set_up_vertex_buffer at :502-504. The existing vertices keep pointing at atlas cells that were just cleared. The inline-text branch always reaches :502-504, which is why only file text breaks.

The plugin is C only, so ON and OFF behave the same.

Proposed fix

Set vbuf_needs_update = true in the antialiasing-changed branch. That forces the file watch to reload, so the file's glyphs are recached and the vertices rebuilt, even when the path and content are unchanged. The regression test drives the registered source callbacks with a small synthetic font and a file containing é, toggles antialiasing in both directions, and checks the glyph stays cached and the vertex buffer is rebuilt. An unchanged-settings control checks the buffer is left alone.

I'd like to work on this; a fix with a regression test is ready.

Activity

  1. zackees commented on Oct 13, 2026

    @zackees
    Member

    @chriscoveries go ahead: please open the PR with the RED test commit first, then the fix (one PR per issue, targeting master). Marking it claimed for you so nobody duplicates it.

  2. added
    claimed
    on Oct 13, 2026
  3. chriscoveries commented on Oct 14, 2026

    @chriscoveries
    ContributorAuthor

    Releasing this one. We're backed up on CI and won't get it landed soon, so anyone who wants it is welcome to take it.

    If it helps, our RED test and fix are on the fork branch fix/text-freetype-aa-file-glyphs. They passed review on our side but haven't been through CI, so reuse them or start fresh, whichever you prefer.

  4. zackees commented on Oct 14, 2026

    @zackees
    Member

    Claiming.

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

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions