Opened 5 years ago

Closed 5 years ago

#2870 closed defect (fixed)

d.fontlist crashes on Windows

Reported by: annakrat Owned by: martinl
Priority: blocker Milestone: 7.0.3
Component: Display Version: svn-releasebranch70
Keywords: d.fontlist, font, wingrass Cc: grass-dev@…
CPU: Unspecified Platform: MSWindows 8

Description

When changing default font for display commands in GUI settings, the underlying command d.fontlist crashes. This is what I get when running d.fontlist from terminal (with d.mon wx0):

D1/5: G_set_program_name(): d.fontlist
D2/5: G_file_name(): path = C:\Users\akratoc\grassdata/nc_spm_08_grass7/user1
D1/5: D_open_driver():
D1/5: cairo: GRASS_RENDER_TRANSPARENT=FALSE
D1/5: cairo: GRASS_RENDER_ANTIALIAS=FALSE
D1/5: cairo: GRASS_RENDER_FILE=map.png
D1/5: cairo: file type=3
D1/5: cairo: GRASS_RENDER_FILE_MAPPED=0
D1/5: cairo: GRASS_RENDER_FILE_READ=0
D1/5: init_cairo
D1/5: Cairo_Erase
D1/5: Cairo_Set_window: 0.000000 480.000000 0.000000 640.000000
Fontconfig error: Cannot load default config file
Fontconfig error: Cannot load default config file

Happens with cairo and png driver. tested on several computers with Windows 8 and 10. This works in 7.0.2.

Change History (19)

comment:1 Changed 5 years ago by martinl

Keywords: wingrass added

comment:2 Changed 5 years ago by martinl

Confirmed on my Windows 7 machine.

comment:3 Changed 5 years ago by neteler

See also #2448

comment:4 in reply to:  2 Changed 5 years ago by hellik

Replying to martinl:

Confirmed on my Windows 7 machine.

here also in OSGeo4W-g7

System Info                                                                     
GRASS version: 7.0.3RC1                                                         
GRASS SVN Revision: 67443                                                       
Build Date: 2015-12-31                                                          
Build Platform: x86_64-w64-mingw32                                              
GDAL/OGR: 1.11.3                                                                
PROJ.4: 4.9.2                                                                   
GEOS: 3.5.0                                                                     
SQLite: 3.7.17                                                                  
Python: 2.7.5                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)   

comment:5 Changed 5 years ago by annakrat

Could it be related to any changes done for #2448?

comment:6 in reply to:  5 Changed 5 years ago by hellik

Replying to annakrat:

Could it be related to any changes done for #2448?

I can't see this connex, as it also fails in OSGeo4W-g7 (see above); changes done for #2448 doesn't do anything in OSGeo4W-g7.

Fontconfig error: Cannot load default config file

any idea in the code where this default config file is searched

comment:7 in reply to:  5 ; Changed 5 years ago by hellik

Replying to annakrat:

Could it be related to any changes done for #2448?

trying here:

g.mkfontcap -s                                                                  
cyrilc|Cyrillic|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\cyrilc.hmp|0|utf-8|
gothgbt|Gothic Great Britain triplex|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\gothgbt.hmp|0|utf-8|
gothgrt|Gothic German triplex|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\gothgrt.hmp|0|utf-8|
gothitt|Gothic Italian triplex|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\gothitt.hmp|0|utf-8|
[...]

so correctly updated fontcap file is found here by g.mkfontcap.

the question is if the fontcap file is the same as the default config file?

comment:8 in reply to:  7 Changed 5 years ago by hellik

Replying to hellik:

Replying to annakrat:

Could it be related to any changes done for #2448?

trying here:

g.mkfontcap -s                                                                  
cyrilc|Cyrillic|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\cyrilc.hmp|0|utf-8|
gothgbt|Gothic Great Britain triplex|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\gothgbt.hmp|0|utf-8|
gothgrt|Gothic German triplex|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\gothgrt.hmp|0|utf-8|
gothitt|Gothic Italian triplex|0|C:\OSGEO4~1\apps\grass\grass-7.0.3RC1\fonts\gothitt.hmp|0|utf-8|
[...]

so correctly updated fontcap file is found here by g.mkfontcap.

the question is if the fontcap file is the same as the default config file?

tested with font types listes by g.mkfontcap -s, all vector labels are displayed correctly; e.g.:

d.vect map=firestations@PERMANENT width=1 attribute_column=CITY font=georgiab
d.vect map=firestations@PERMANENT width=1 attribute_column=CITY font=FRADMCN

comment:9 Changed 5 years ago by martinl

The programs crashes at source:grass/trunk/lib/driver/font.c#L151

Any idea?

Last edited 5 years ago by martinl (previous) (diff)

comment:10 Changed 5 years ago by martinl

Hopefully fixed in r67630. Will check next build.

comment:11 Changed 5 years ago by martinl

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Priority: majorblocker
Status: newassigned

comment:12 in reply to:  10 ; Changed 5 years ago by hellik

Replying to martinl:

Hopefully fixed in r67630. Will check next build.

tested here locally by copying

C:\OSGeo4W\etc\fonts\fonts.conf

to

C:\OSGeo4W64\apps\grass\grass-7.0.3RC1\etc

and by adding

set FONTCONFIG_FILE=%GISBASE%\etc\fonts.conf

in the winGRASS windows console.

C:\>d.fontlist -l
Unable to update the static FcBlanks: 0x0600
Unable to update the static FcBlanks: 0x0601
Unable to update the static FcBlanks: 0x0602
Unable to update the static FcBlanks: 0x0603
Unable to update the static FcBlanks: 0x06dd
Unable to update the static FcBlanks: 0x070f
Unable to update the static FcBlanks: 0x2028
Unable to update the static FcBlanks: 0x2029
Unable to update the static FcBlanks: 0xfff9
Unable to update the static FcBlanks: 0xfffa
Unable to update the static FcBlanks: 0xfffb
cyrilc
gothgbt
gothgrt
gothitt
greekc
greekcs
greekp
greeks
italicc
italiccs
italict
romanc
romancs
romand
romans
romant
scriptc
scripts
AGENCYB
[...]

basically it seems to work, though some error messages.

so let's test next build.

comment:13 in reply to:  12 ; Changed 5 years ago by martinl

Replying to hellik:

basically it seems to work, though some error messages.

so let's test next build.

Please try the last build (no.53 64bit or no.216 32bit). Do you still see error messages?

Last edited 5 years ago by martinl (previous) (diff)

comment:14 in reply to:  13 ; Changed 5 years ago by hellik

Replying to martinl:

Replying to hellik:

basically it seems to work, though some error messages.

so let's test next build.

Please try the last build (no.53 64bit or no.216 32bit). Do you still see error messages?

tested with

System Info                                                                     
GRASS version: 7.1.svn                                                          
GRASS SVN revision: 67634                                                       
Build date: 2016-01-23                                                          
Build platform: x86_64-w64-mingw32                                              
GDAL: 1.11.3                                                                    
PROJ.4: 4.9.2                                                                   
GEOS: 3.5.0                                                                     
SQLite: 3.7.17                                                                  
Python: 2.7.5                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)   
C:\>d.fontlist -l
cyrilc
gothgbt
gothgrt
gothitt
greekc
greekcs
greekp
greeks
italicc
italiccs
italict
romanc
romancs
romand
romans
romant
scriptc
scripts
AGENCYB
AGENCYR
ahronbd
[...]

d.fontlist and change preferences within wxGUI works now. ready for backporting.

comment:15 in reply to:  14 ; Changed 5 years ago by martinl

Replying to hellik:

d.fontlist and change preferences within wxGUI works now. ready for backporting.

good, done in r67642. Let's test the next grass70 build.

comment:16 Changed 5 years ago by annakrat

Thanks for working on this. Do we have an idea how did this bug happen? If yes, it would be good to have it documented here.

comment:17 Changed 5 years ago by martinl

GRASS OSGeo4W package since 7.0.3 doesn't depend on msys package. WinGRASS is built using completely fresh environment based on msys2 which is not shipped in osgeo4w framework. So the fontconfing file was just missing.

comment:18 in reply to:  17 Changed 5 years ago by annakrat

Replying to martinl:

GRASS OSGeo4W package since 7.0.3 doesn't depend on msys package. WinGRASS is built using completely fresh environment based on msys2 which is not shipped in osgeo4w framework. So the fontconfing file was just missing.

Thanks for clarifying!

comment:19 in reply to:  15 Changed 5 years ago by martinl

Resolution: fixed
Status: assignedclosed

Replying to martinl:

Replying to hellik:

d.fontlist and change preferences within wxGUI works now. ready for backporting.

good, done in r67642. Let's test the next grass70 build.

Tested, seems to work. Closing the ticket.

Note: See TracTickets for help on using tickets.