bugGNUstep - Bugs: bug #34803, building gnustep back with X...

Group
 
 

bug #34803: building gnustep back with X backend and freetype but without XFT results in no fonts being displayed

Submitter:  julian <julian_>
Submitted:  Fri 11 Nov 2011 07:25:46 PM UTC
   
 
Category:  Backend Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 26 Dec 2013 04:12:29 PM UTC, comment #7: 

The workaround has been in NSFont for two years now.

Fred Kiefer <FredKiefer>
Group Member
Thu 24 Nov 2011 09:33:57 AM UTC, comment #6: 

You font list doesn't leave us with too much of a choice, basically there is just "fixed" and that's it.
I will try to add some fallback code to the xlib backend that uses this font if "helvetica" and "courier" are not available.

Fred Kiefer <FredKiefer>
Group Member
Wed 16 Nov 2011 02:34:33 AM UTC, comment #5: 

you are right helvetica or courier aren't installed. i don't know why it is looking for them, AFAIK these are proprietary and never available on linux systems (by default).
xlsfonts output attached. this is a stock ubuntu 10.4 install.

>Perhaps you have a suggestion for possible font names to be used as fallbacks.


my only suggestion is for configure to print out a big fat warning that fonts likely won't work when building the x backend without xft. or better yet succeed only when explicitly passing --disable-xft

(file #24386)

julian <julian_>
Sun 13 Nov 2011 02:08:22 PM UTC, comment #4: 

The font cache file you uploaded looks broken. It definitely doesn't contain a "Version" entry and this means it is an incomplete file. Most likely it was shortened when uploading.

You could write a short program to inspect your cache file locally with the line:
[NSUnarchiver unarchiveObjectWithFile: cacheName];

and printing out the result with an NSLog statement.

You may actually restrict the size of this file by including only fonts useful for you application as described in the DefaultsSummary of back:

  <term>GSFontMask</term>
  <desc>
          <p> [Xlib backend only]
          A string value which defaults to <code>"*"</code>. It defines
          the pattern used to get the installed fonts from the
          X-Server. A value of <code>"*-iso8859-1"</code> would only
          include fonts available with ISO Western encoding. This
          feature might be helpfull if the font_cacher program is having
          problem with the X-Server.
          </p>
  </desc>


I think that your problem is that the default font name as used by GNUstep cannot be found on your system. The simplest way to verify this si to run the command
xlsfonts | grep helvetica

You may change the used system fonts as described in the class documentation of NSFont by setting a few user defaults. But this may not work over different machines with different fonts installed. This is a general problem for GNUstep. The art backend therefor has its own font files coming along in a separate package and the cairo backend used a few fallback names for the default fonts. For the xlib XGFont we don't have anything similar in place. Perhaps you have a suggestion for possible font names to be used as fallbacks.

Fred Kiefer <FredKiefer>
Group Member
Sat 12 Nov 2011 02:04:56 AM UTC, comment #3: 

the title is a bit misleading, the same thing happens if you don't have freetype at all. configure doesn't complain, just the result won't run or won't show any fonts.

the file doesn't contain anything about helvetica, attached.

i think its fine if you require xft for the x backend, its just that configure should say so instead of happily building broken configurations.

(file #24358)

julian <julian_>
Sat 12 Nov 2011 12:44:09 AM UTC, comment #2: 

I think happens here is that configure wont find XFT and just ignores Freetype at all and falls back to the old X font system. Which is why XGFont shows up in the log messages.

This old mechanism uses a font cache, it runs a small program in the back ground to build up that cache by itself. You should be able to find that cache in the directory ~/GNUstep/Library/Fonts/Cache/ the file will be named after your display, most likely :0. Please check there whether a font named Helvetica could be found on your machine. Be careful though, this is a binary file

I must admit that I haven't tested this setup in recent years.

The interesting bit about the printed message is that the "(null)" should be the X font name.

No idea what goes wrong in the 64 bit case.

Fred Kiefer <FredKiefer>
Group Member
Fri 11 Nov 2011 07:30:55 PM UTC, comment #1: 

i've confirmed this on ubuntu 10.4 both 32 and 64 bit. just install no X development packages except libxt6 and what it pulls in to reproduce.

the funny thing is on 32 bit helloworld runs fine, just without fonts, and the mentioned messages printed about 10 times.

on the 64 bit version the messages is printed in an infinite loop and nothing is displayed at all.

julian <julian_>
Fri 11 Nov 2011 07:25:46 PM UTC, original submission:  

building the plain X backend with freetype but without xft results in an installation that does not display any fonts or possibly refuses to run even a simple hello world with these messages:


2011-11-11 12:38:44.630 HelloWorld[24152] The font specified for NSFont, Helvetica, can't be found.
2011-11-11 12:38:44.630 HelloWorld[24152] XGFont: selected font: Helvetica at 12.000000 ((null)) is not available.
2011-11-11 12:38:44.630 HelloWorld[24152] XGFont: selected font: Helvetica at 12.000000 ((null)) is not available.
2011-11-11 12:38:44.630 HelloWorld[24152] XGFont: selected font: Helvetica at 12.000000 ((null)) is not available.
2011-11-11 12:38:44.630 HelloWorld[24152] XGFont: selected font: Courier at 12.000000 ((null)) is not ava[...]


if XFT is necessary in the plain X backend in order to display any fonts, configure should not let you configure this combination without any warning at all. if it isn't necessary there is a bug somewhere ;-)

attached are config.log and config.h of the broken installation

julian <julian_>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #24386:  fonts.txt added by julian_ (34KiB - text/plain)
file #24358:  fontcache added by julian_ (56KiB - application/octet-stream)
file #24354:  config.h added by julian_ (4KiB - application/octet-stream)
file #24355:  config.log added by julian_ (44KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by julian_ (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-12-26 FredKiefer StatusNone Fixed
        Open/ClosedOpen Closed
    2011-11-24 FredKiefer Assigned toNone FredKiefer
    2011-11-16 julian_ Attached File- Added fonts.txt, #24386
    2011-11-12 julian_ Attached File- Added fontcache, #24358
    2011-11-12 FredKiefer CategoryNone Backend
        Item GroupNone Bug
    2011-11-11 julian_ Attached File- Added config.h, #24354
        Attached File- Added config.log, #24355

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code