Jump to content
The Dark Mod Forums

Darkradiant: fixing font problems and crashes on Linux


rand0m

Recommended Posts

Hi guys,

the recent version of darkradiant (1.7) is unable to display the grid numbers in the ortho view due to use of the deprecated "gdk::gl::font::use_pango_font" function. When switching between editor layouts, crashes can occur.

I rewrote the broken code with the use of the ftgl-library, freetype and fontconfig. If you are interested in the code, pm me. Unfortunately I don't have permission to upload diff-files.

The only problem with my "solution" is that fontconfig is only available on *nix systems. I use it to get the path to the appropriate font files. A similar mechanism for Windows is missing since I'm not familiar with the internals of the windows font support.

Link to comment
Share on other sites

Feel free to send the patch to the maintainer email address in the debian/changelog, and I will have a look at it.

 

If there are complications with trying to load a system font on different platforms, would it make more sense to include our own font file and load that one specifically using FTGL? It would be a known quantity in that case, and ought to work the same way on all systems.

Link to comment
Share on other sites

Is this only an issue with Ubuntu or Debian? I have no problems with grid numbers displaying in Mageia 2alpha 64-bit, or any release of Mageia or Mandriva since 2010.0 (when I started using DR).

pango1 libraries version 1.29.5-1mga2

pangomm2.4 libraries version 2.28.4-1mga2

gdk libraries version 2.25.0-1mga2

 

I do get an occasional rare crash when pressing a key (can be any key) command in DR. Sometimes when pressing 'S' to bring up the surface inspector... most frustrating when pressing 'Esc' to de-select an object or 'Back space' to delete an object.

Edited by PranQster

System: Mageia Linux Cauldron, aka Mageia 8

Link to comment
Share on other sites

Feel free to send the patch to the maintainer email address in the debian/changelog, and I will have a look at it.

 

If there are complications with trying to load a system font on different platforms, would it make more sense to include our own font file and load that one specifically using FTGL? It would be a known quantity in that case, and ought to work the same way on all systems.

 

I'll look out for that email address. Including the fonts with the sources would of course solve the issue. But that would be a decision for the maintainers. I'll send the diff file for review and you guys can decide.

 

PranQster:

The problem is that the aforementioned function uses a deprecated gdk-backend. The gdkmm version on my system is 2.4 respectively 3.0. My guess is that most updated systems will have troubles. Personally, I'm working on Xubuntu 11.10.

If you google "gdk_gl_font_use_pango_font" you can find discussions on the topic.

As far as the crashes go: after my code changes DR ran crashfree.

Edited by rand0m
Link to comment
Share on other sites

Thanks for bringing that to our attention and thanks for working on a patch, too. I'll see what I can do.

 

As for the Windows platform, we do have fontconfig available in the Win32/Win64 builds.

 

edit: I don't seem to see the use_pango_font being deprecated in the docs? There isn't a newer version of gtgklext(mm) than 1.2.0 available, is there?

Link to comment
Share on other sites

I checked out your fix and got it working by building the most recent FTGL library from source (FTGL 2.1.3 RC5). It seems to work but I noticed a few things:

 

- The grid font is rendered (even with anti-aliasing), but it's very small and hard to read. I guess that can be fixed.

- The numbering of the clip points is missing, I haven't investigated why this is yet.

- The first startup of DarkRadiant takes ages. I first thought it was caught in an infinite loop, but it was just fontconfig building its font cache, obviously.

- Fontconfig is writing its cache to C:\Temp (which didn't exist on my system, so it cluttered my root folder with that one). That one can possibly be fixed by hacking the Fontconfig library we're using for DarkRadiant, something that would need to be re-hacked everytime we upgrade the fontconfig package. It would be nicer if Fontconfig wrote to the user folder or something.

 

The only major problem I have with that situation is the long UI disruption on the first startup. Maybe this is only on first startup and maybe only in debug builds, I'll have to check that out.

Link to comment
Share on other sites

I worked around the application hang by packaging two fonts with DarkRadiant, as OrbWeaver suggested. I already changed the code in the Windows implementation to pick up these two fonts instead of looking through patterns and replacements by means of fontconfig. The make/install scripts have not been adjusted yet, maybe OrbWeaver has a few minutes to spare on that to get them installed? Once that's done, the Linux implementation of GLFont can use these TTF fonts too.

 

There is still the issue of the disappearing clip point numbers to be fixed though. (edit: found it, this is fixed now.)

Link to comment
Share on other sites

The use_pango_font-function itself is not marked as deprecated. But the backend it uses is. The documentation is a little behind on that. The discussion about that took place in a mailing list. Unfortunately the link to the original discussion doesn't seem to work atm. Here is link to a related mailing list conversation concerning GtkRadiant:

http://icculus.org/pipermail/gtkradiant/2010-November/011336.html

 

Since I never had a correctly working version of darkradiant, I wasn't aware that there were clip point numbers. But it seems like you guys got that worked out.

 

 

Glad I could help at least a little.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...