blf.dimensions reports different text sizes with Region Overlap enabled, 3D View shown, and panels set #50372
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#50372
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?
We have found that
blf.dimensions
returns different text sizes (by ~10%) if Region Overlap is enabled and the 3D View is particularly configured.To replicate:
Enable Region Overlap in User Prefs > System
Set main window to have 3D View and Python Console (other areas seem not to matter)
3D View: Tool Shelf closed, Properties Panel closed
In Python Console:
>>> import blf
>>> blf.dimensions(0, "test")
(19.3125, 7.875)
3D View: open Tool Shelf
In Python Console
>>> blf.dimensions(0, "test")
(21.703125, 8.59375)
Anything but Region Overlap enabled + Tool Shelf opened + Properties Panel closed, and
blf.dimensions(0, "test")
reports(19.3125, 7.875)
. Strangely, in Retopoflow, we found that the issue shows up when Region Overlap is enabled and Properties Panel is opened (Tool Shelf does not matter). (see https://github.com/CGCookie/retopoflow/issues/88 for results) Also, the issue does not appear if 3D View is not shown (switch to Text Editor, for ex).Tested in fresh install of Blender 2.78a on OSX and Linux, but it seems that we've had this issue since Jan 2015.
Changed status to: 'Open'
Added subscriber: @gfxcoder
Added subscriber: @JonathanWilliamson
Added subscriber: @mont29
Changed status from 'Open' to: 'Archived'
There is no bug here actually, this is just a matter of font size.
When Properties of 3DView is shown, last size used during text drawing for default font is
11
, while it’s12
when props are hidden.Note that you cannot do much about this in python console, since redraw happens between each line of code, but in a 'real' script you shall call
blf.size(0, 11, 72)
(size 11, dpi 72) or whatever size/dpi value you need prior to computing size of the text.Anyway, no bug here really.
Thanks, @mont29! That solved the problem!
Seems we were calling
blf.size()
, but only after callingblf.dimensions()
and before drawing the text, so the text drew correctly.