Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005976 [DCSS] Bug Report crash always 2012-07-25 17:23 2012-07-28 02:55
Reporter heftig View Status public  
Assigned To KiloByte
Priority normal Resolution done  
Status resolved   Product Branch 0.16 ancient branch
Summary 0005976: Segfault with non-default font-settings
Description I'm trying to use the following font settings:

tile_font_crt_file = /usr/share/fonts/windows/consola.ttf
tile_font_stat_file = /usr/share/fonts/windows/consola.ttf
tile_font_msg_file = /usr/share/fonts/windows/consola.ttf
tile_font_tip_file = /usr/share/fonts/windows/consola.ttf
tile_font_lbl_file = /usr/share/fonts/windows/segoeui.ttf
tile_font_ft_light = true

consola.ttf and segoeui.ttf are Windows Vista/7 standard fonts.

This setup causes a segfault on startup (debug backtrace attached).

tile_font_ft_light alone (with default fonts) also causes a crash, but on shutdown, not on startup.

crawl -version:

Crawl version 0.11-a0-2984-gcff2ec2
Save file version 33.15
Compiled with GCC 4.7.1 20120721 (prerelease) on Jul 25 2012 at 17:07:20
Build platform: x86_64-unknown-linux-gnu
Platform: x86_64-unknown-linux-gnu
CFLAGS: -O0 -ggdb -pipe -Wall -Wformat-security -DUSE_TILE -DUSE_TILE_LOCAL -DUSE_SDL -DUSE_GL -DUSE_FT -D_GNU_SOURCE=1 -D_REENTRANT -Wundef -Wno-array-bounds -Wno-parentheses -Wno-unused-parameter -Wwrite-strings -Wshadow -Icontrib/install/x86_64-unknown-linux-gnu/include -Iutil -I. -I/usr/include -Irltiles -I/usr/include/freetype2 -I/usr/include/SDL -I/usr/include/ncursesw -DFULLDEBUG -DDEBUG -DWIZARD -DASSERTS -DPROPORTIONAL_FONT="/usr/share/fonts/TTF/DejaVuSans.ttf" -DMONOSPACED_FONT="/usr/share/fonts/TTF/DejaVuSansMono.ttf" -D_GNU_SOURCE=1 -D_REENTRANT -DCLUA_BINDINGS -DSAVE_DIR_PATH="~/.crawl/" -DDATA_DIR_PATH="/usr/share/stone-soup/data/"
LDFLAGS: -rdynamic -O0
Additional Information
Tags No tags attached.
Attached Files ? file icon debug [^] (3,833 bytes) 2012-07-25 17:23
? file icon broken.patch [^] (6,535 bytes) 2012-07-25 19:27 [Show Content]
? file icon 0001-fixed-font-rendering-for-non-default-fonts.patch [^] (7,370 bytes) 2012-07-28 01:59 [Show Content]

- Relationships

-  Notes
(0019253)
neil (administrator)
2012-07-25 17:46

This line of code is suspect:
int vert_offset = ascender - face->glyph->bitmap_top;

What happens when this glyph is taller than the font's normal ascender height?
(0019254)
heftig (reporter)
2012-07-25 19:28

Played around a bit with the fontwrapper. Now it seems to render fine BUT all text is one line too low.

I'm pretty sure I didn't know what I was doing, but I attached the broken patch anyway.
(0019271)
frogbotherer (developer)
2012-07-28 02:07

I've had a go at fixing this and there's a format-patch formatted patch with a fix in it attached. This is a diff from the Android branch of Crawl and might not apply cleanly against trunk - get me on e-mail or IRC or something if it needs attention. This *definitely* works on x86 for heftig's ClearType fonts and the default fonts shipped with Crawl.

The code now works by drawing each glyph at the top of the pixel array, not in the middle, and only applying the offset when it actually blits the character to the screen. This means we should be a lot more tolerant of oddly-shaped letters, because there's no potential to write pixel data outside of array bounds any more (oops).
(0019275)
KiloByte (manager)
2012-07-28 02:55

frogbotherer's fix appears to work well, applied. Thanks!

- Issue History
Date Modified Username Field Change
2012-07-25 17:23 heftig New Issue
2012-07-25 17:23 heftig File Added: debug
2012-07-25 17:46 neil Note Added: 0019253
2012-07-25 19:27 heftig File Added: broken.patch
2012-07-25 19:28 heftig Note Added: 0019254
2012-07-25 23:45 frogbotherer Issue Monitored: frogbotherer
2012-07-28 01:59 frogbotherer File Added: 0001-fixed-font-rendering-for-non-default-fonts.patch
2012-07-28 02:07 frogbotherer Note Added: 0019271
2012-07-28 02:55 KiloByte Note Added: 0019275
2012-07-28 02:55 KiloByte Status new => resolved
2012-07-28 02:55 KiloByte Fixed in Branch => 0.11 development branch
2012-07-28 02:55 KiloByte Resolution open => done
2012-07-28 02:55 KiloByte Assigned To => KiloByte


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker