Font preview malfuction in Blender 2.8 #67620
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#67620
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As show below, in Blender 2.79b or previous versions, we can use translated and compiled
zh_CN.mo
to preview Chinese fonts with Chinese charactor in file browser.But this doesn't work work for Blender 2.80.
I think it's an common issue for non-english users, and hope this to be fixed.
Added subscriber: @nge
Added subscriber: @xuekepei
Added subscriber: @Harley
Those strings are all meant to be translated. I see them marked as such:
But I'm not seeing the font previews using translated strings when I test any languages that are marked as complete.
The function that actually does the preview (BLF_thumb_preview() in blf_thumbs.c) has a comment that it is "called from a thread, so it bypasses the normal BLF_* api (which isn't thread-safe)"
But the function calls BLT_translate_do() to do the translation but that function does not do that if the result of BLT_translate() is false. And one the checks of BLT_translate() (in blt_translation.c) is if BLI_thread_is_main(). So therefore (I think) the translation of the strings is not attempted. As far as I can tell anyway.
So, this was an an unintentional positive outcome?
But it has been and will be a handy feature for us users. It will be great for us to have it back.
Would it be possible to find it back?
And to follow up, I definitely don't get a translated font preview for the Japanese language currently:
But I do if I remove that BLI_thread_is_main().
I seem to remember a complaint that the font preview generation could error out times, so possibly this thread check was put in to fix that, but unintentionally removed this translation behavior.
Will it be possible to find a balanced way to deal with these two needs?
Yes, there definitely will. I'm just not the best person to say exactly how or when. I do see your error and I understand why it is happening. But I am not familiar with the issues around this "thread safety" issue regarding our font library.
Mostly likely someone with more knowledge of this area will chime in fairly soon with more answers. But everyone is quite busy with the current release so it might not be immediate.
Just checked this with 2.80RC3, but has the same problem, never showing translated preview font text.
Note that this issue is unrelated to the bug addressed here: https://developer.blender.org/rB52fb8b1e80ec1e76e0e3b82329042cd37be29d1e
Added subscriber: @mont29
Translation was disabled from non-main threads at some point last year iirc, because on some systems (think it was mainly OSX), that could lead to crashes…
Will check the code, should be possible to refactor it to make the translations in main thread before launching preview worker ones.
Ah, that makes sense. I was unable to actually find a place outside of the thread where that would be done. LOL. I'm sure to learn something from the eventual solution.
@mont29 Thank you. Can I test this change in today's daily build?
@nge it's not yet committed, you'd need to apply the patch and build yourself.
This issue was referenced by
3b6c75dc31
Changed status from 'Open' to: 'Resolved'