Devilutionx: CharisSILB.ttf called as ./CharisSILB.ttf ?

Created on 7 Oct 2019  Â·  7Comments  Â·  Source: diasurgical/devilutionX

Hi, i have problem with error message font. If is the file CharisSILB.ttf in same directory as ./devilutionx binary everything is OK.
But what to do if i want have this font in /usr/share/fonts ?

Is best solution patch source code fonts.cpp:61 before packaging for linux like this? :

font = TTF_OpenFont("/usr/share/fonts/truetype/CharisSILB.ttf", 17);

Be sure without it i get:

TTF_OpenFont: Couldn't open CharisSILB.ttf

obrazek

Is there any way how to request font by name but not by filename ?

Any adivises how to do best ?

Thank for any help

I want it for Debian & Fedora packaging to be nice done without nasty symlinks or any other ugly hacks.

help wanted

All 7 comments

Unfortunately I haven't been able to find any (especially not cross-platform) way of requesting a font, the only solution I could find was to request it the way you see here. Especially on Mac this is a bit odd since the file is actually located in ../resources but that is the current folder when running a program from a bundle.

So yes, if you want to also install it as a system font then I think a patch is your only solution. I'm not sure I would recommend that you install it though since it's not the full font set, and if a user decides to uninstall it then the application won't run.

How do applications normally handle their resources being scattered all over the file system? It's something that has always been less than ideal IMO on Linux distributions (I understand it helps with sharing files between applications that have the same dependencies, but in cases like this it feels like it has been taken to the extream, also I run Linux as my operating system so no hate :P).

Ok. I'l fix it in debian/redhat package building.
Thank you for your point of view.

P.s. Here you can find my RPMs: https://build.opensuse.org/package/show/home:vitexus/devilutionX

obrazek

p.s.s. Font problem not fixed yet. Please wait for next builds.

Cool thanks for doing this, ps if you can find a good name for it maybe we can add the path as an ifdef.

Is this solution acceptable for you ?:

debian/rules:
export DEB_CFLAGS_MAINT_APPEND = -Wno-error -DMSG_FONT=/usr/share/fonts/truetype/CharisSILB.ttf

fonts.cpp:
obrazek

Or second solution way:

obrazek

Oh looks like we will need that anyway for translation support, feel free to send a patch that allows it to open system fonts :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spitfire picture spitfire  Â·  22Comments

Chance4us picture Chance4us  Â·  15Comments

AJenbo picture AJenbo  Â·  19Comments

rsn8887 picture rsn8887  Â·  14Comments

mgpat-gm picture mgpat-gm  Â·  21Comments