Skip to content

Commit b9ccd9c

Browse files
TMHSDigitalclaude
andcommitted
fix(examples): text-version-stamp falls back to DejaVuSansMono on 4.x
4.5 LTS builds Inter's variable-font outlines with broken counters (the 4 in 4.5.11 fills its hole). The render path now loads DejaVuSansMono on bpy.app.version < (5, 0, 0) and keeps Inter on 5.x, so the 5.2 hero is unchanged. Verified on .scratch/blender-4.5.11-windows-x64/blender.exe (Blender 4.5.11 LTS): --output exits 0, framing_ok, and the 4.5.11 LTS numerals render clean. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent b7068f4 commit b9ccd9c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎examples/text-version-stamp/text_version_stamp.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ def render_still(obj, path, engine):
149149
txt.space_character = 1.05
150150
# Render only (the check above asserts the built-in Bfont): Bfont's "1"
151151
# is a bare stem that reads as a capital I ("5.2.I LTS"). Inter, shipped
152-
# with Blender, gives the numeral its flag.
153-
inter = bundled_font("Inter.woff2")
152+
# with Blender, gives the numeral its flag. 4.5 LTS builds Inter's
153+
# variable-font outlines with broken counters (the "4" fills its hole),
154+
# so 4.x falls back to DejaVuSansMono, whose "1" also carries a flag.
155+
font_name = "Inter.woff2" if bpy.app.version >= (5, 0, 0) else "DejaVuSansMono.woff2"
156+
inter = bundled_font(font_name)
154157
if inter is None:
155-
print("ERROR: bundled datafiles/fonts/Inter.woff2 not found", file=sys.stderr)
158+
print(f"ERROR: bundled datafiles/fonts/{font_name} not found", file=sys.stderr)
156159
return 13
157160
txt.font = inter
158161

0 commit comments

Comments
 (0)