Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0005819Dwarf FortressDwarf Mode -- Interface, Textpublic2012-04-19 11:532021-11-04 22:26
MNICY 
Baughn 
normalcrashalways
confirmedopen 
LinuxUbuntu 11.10
0.34.07 
 
0005819: Build menu causes crash when zoomed with TrueType
If I am zoomed all the way in and press the b key, the game crashes. If I run it from a terminal, it gives this error:
Dwarf_Fortress: src/g_src/ttf_manager.cpp:139: ttf_details ttf_managerst::get_handle(const std::list<ttf_id>&, justification): Assertion `pixel_width >= ttf_width' failed.
Aborted
1. embark
2. zoom all the way in
3. press b
If I don't zoom all the way in it works.. but then I have trouble seeing the text on the screen because it is so small.
No tags attached.
related to 0005813assigned Baughn TrueType crash when zooming 
has duplicate 0004972resolved Footkerchief Crash when constructing building with TrueType enabled. 
has duplicate 0006713resolved Footkerchief Game crash when bringing up build menu. 
has duplicate 0007671resolved Footkerchief Game crashes when trying to access build menu 
has duplicate 0006867resolved Footkerchief Game crash after zoom/font boldness changed 
has duplicate 0009993resolved lethosor Crash on pixel_width >= ttf_width assertion 
has duplicate 0010325resolved Loci Instability on high zoom levels?? 
has duplicate 0010406resolved Loci Crash while resizing font 
has duplicate 0011400resolved Loci Crash at manager screen with a given font size with assertion failed 
has duplicate 0011553resolved lethosor Crash when entering build mode and zoomed in 
related to 0006096new  After opening saved game, crashes on build menu 
Issue History
2012-04-19 11:53MNICYNew Issue
2012-04-19 13:36Logical2uNote Added: 0022313
2012-04-19 18:36Logical2uTag Attached: AWAITING UPDATE
2012-04-21 17:00FootkerchiefStatusnew => assigned
2012-04-21 17:00FootkerchiefAssigned To => Baughn
2012-04-21 17:00FootkerchiefRelationship addedrelated to 0005813
2012-04-21 17:01FootkerchiefNote Added: 0022329
2012-04-26 13:25zenerbufenNote Added: 0022382
2012-04-26 13:26zenerbufenNote Edited: 0022382bug_revision_view_page.php?bugnote_id=0022382#r8341
2012-07-05 17:34scribermanNote Added: 0023166
2014-07-20 17:30panandoNote Added: 0027083
2014-07-22 10:53FootkerchiefSummaryBuild menu causes crash when zoomed => Build menu causes crash when zoomed with TrueType
2014-07-22 10:53FootkerchiefRelationship addedhas duplicate 0004972
2014-07-22 10:54FootkerchiefRelationship addedhas duplicate 0006713
2014-07-29 07:10FootkerchiefRelationship addedhas duplicate 0007671
2014-07-29 07:12FootkerchiefRelationship addedrelated to 0006096
2014-07-29 14:23Hello71Issue Monitored: Hello71
2014-07-29 14:25Hello71Note Added: 0027900
2014-07-29 14:38FootkerchiefRelationship addedhas duplicate 0006867
2014-08-04 15:01FootkerchiefTag Detached: AWAITING UPDATE
2014-12-04 18:13lethosorStatusassigned => confirmed
2017-03-22 11:09lethosorRelationship addedhas duplicate 0009993
2017-11-14 15:59LociRelationship addedhas duplicate 0010325
2017-11-14 15:59LociIssue Monitored: Drako365
2017-12-02 12:55LociRelationship addedhas duplicate 0010406
2020-02-20 12:14LociRelationship addedhas duplicate 0011400
2020-06-18 22:34lethosorRelationship addedhas duplicate 0011553
2021-11-04 22:26tonrenNote Added: 0041170
2021-11-04 22:29tonrenNote Edited: 0041170bug_revision_view_page.php?bugnote_id=0041170#r16757

Notes
(0022313)
Logical2u   
2012-04-19 13:36   
Does it still crash if you turn TrueType off?
(0022329)
Footkerchief   
2012-04-21 17:01   
Reminder sent to: Baughn

"Assertion `pixel_width >= ttf_width' failed"
(0022382)
zenerbufen   
2012-04-26 13:25   
(edited on: 2012-04-26 13:26)
Me and another user are experiencing the exact same problem, but under OS X, and at the default zoom level. Turning off truetype or zooming out will work around the problem. This problem is easily produced with the following steps:

download fresh 34.07 for os x
generate world
embark
press F12
press b
crash


src/g_src/ttf_manager.cpp:139: failed assertion `pixel_width >= ttf_width'
shows in the console

(0023166)
scriberman   
2012-07-05 17:34   
Debian Squeeze 6.0.5, DF 0.34.07, Ironhand 0.73, dual video 2048x1155=4096x1155

I got this 'b' crash while zoomed out (which makes everything smaller), not zoomed in (which makes everything larger), and the workaround to zoom back in (not out) works for me. Zooming out 5 times at the default ZOOM_SPEED of 10: 'b' causes crash; zooming out 4 times: 'b' does not cause crash. Here is my error output from zooming 4 times, 'b', zooming once more, 'b':
-----
Resizing font to 15x15
Resizing font to 13x13
Resizing font to 12x12
Resizing font to 11x11
Resizing font to 10x10
Dwarf_Fortress: src/g_src/ttf_manager.cpp:139: ttf_details ttf_managerst::get_handle(const std::list<ttf_id>&, justification): Assertion `pixel_width >= ttf_width' failed.
Aborted
-----

Fresh install, fresh world, and fresh embark. I started getting the 'b' crash only after I edited my init.txt file, though I haven't tested thoroughly in that direction. I had changed several options in init.txt, including [ZOOM_SPEED:10] to 50 (I only focused my suspicion there after finding this original bug report page). I am now doubting that this is the source of my problem, but it is really the only thing I can think of that I did differently; I was up all night with the fresh install, zooming in and out all over the place.

OK, so now the weird part. I tested toggling TrueType on and off as a workaround, and now I can not get the thing to crash anymore!! If it happens again, I will report back here. Let me know if you need more info or want me to test anything else.
(0027083)
panando   
2014-07-20 17:30   
This crash is still at large, with truetype set to YES, then reproducing the crash is basically as simple as zooming out.
---
New window size: 777x300
Font size: 18x18
Resizing grid to 80x25
Resizing font to 9x9

Resizing font to 9x9
Resizing font to 9x9
Resizing font to 7x7
Dwarf_Fortress: src/g_src/ttf_manager.cpp:139: ttf_details ttf_managerst::get_handle(const std::list<ttf_id>&, justification): Assertion `pixel_width >= ttf_width' failed.
Aborted.
---


Again, and doing nothing other than immediately zooming out all the way:
---
Resetting textures
Resizing font to 12x12
Resizing font to 10x10
Resizing font to 8x8
Resizing font to 6x6
Resizing font to 6x6
Resizing font to 5x5
Resizing font to 4x4
Resizing font to 4x4
Resizing font to 3x3
Resizing font to 3x3
Resizing font to 3x3
Resizing font to 3x3
Resizing font to 2x2
Dwarf_Fortress: src/g_src/ttf_manager.cpp:139: ttf_details ttf_managerst::get_handle(const std::list<ttf_id>&, justification): Assertion `pixel_width >= ttf_width' failed.
Aborted
---

Using Ubuntu 14.04

DF version .40.4
(0027900)
Hello71   
2014-07-29 14:25   
assertion fails without even resizing here, but this is with recompiled libgraphics.so.

disabling the assertion causes misrendered text -- DF miscalculates the size of text input e.g. when trading, and sometimes cuts off text.

what font are you using?
(0041170)
tonren   
2021-11-04 22:26   
(edited on: 2021-11-04 22:29)
Just got this error on Pop!_OS 21.04 when I pressed "Start playing" after worldgen. Completely vanilla installation with no other worlds, saves, customizations etc.

Of note is that I had zoomed in to the point where the font changed from serif to sans serif.

Resizing font to 13x19
Resizing font to 14x21
Resizing font to 16x24
Resizing font to 17x25
Resizing font to 19x28
Resizing font to 17x25
Resizing font to 16x24
Dwarf_Fortress: src/g_src/ttf_manager.cpp:139: ttf_details ttf_managerst::get_handle(const std::list<ttf_id>&, justification): Assertion `pixel_width >= ttf_width' failed.
Aborted (core dumped)

I had to do some unusual stuff to get DF running in the first place. Here's a condensed summary of what I ran:

sudo apt install libsdl1.2debian libsdl-image1.2 libsdl-ttf2.0-0 libopenal1
cd df_linux && rm libs/libstdc++.so.6

Some relevant lib information for posterity:

$ apt-cache show libsdl1.2debian
Package: libsdl1.2debian
Architecture: amd64
Version: 1.2.15+dfsg2-6
Multi-Arch: same
Priority: optional
Section: universe/libs
Source: libsdl1.2
Origin: Ubuntu

$ apt-cache show libsdl-ttf2.0-0
Package: libsdl-ttf2.0-0
Architecture: amd64
Version: 2.0.11-6
Multi-Arch: same
Priority: optional
Section: universe/libs
Source: sdl-ttf2.0
Origin: Ubuntu