![]() |
#21 | |
Swordsman
Join Date: May 2016
Posts: 336
![]() |
Quote:
Code:
if (find_font_info(name) == NULL) { /* TODO maybe its not really an error? the font file was * probably just deleted and now the ui wont event start... */ return PARSE_ERROR_INVALID_VALUE; } |
|
![]() |
![]() |
![]() |
#22 |
Swordsman
Join Date: May 2016
Posts: 336
![]() |
As an aside, fc-list :spacing=100 (in a shell) displays a list of monospace fonts installed on my machine (Debian Bookworm). This can perhaps be used for populating ANGBAND_DIR_FONTS?
edit: or even populating g_font_info[] directly? (#ifdef USE_FONTCONFIG, for example) Last edited by t4nk; October 16, 2023 at 01:36. |
![]() |
![]() |
![]() |
#23 | |
Swordsman
Join Date: May 2016
Posts: 336
![]() |
Quote:
The incantation to the command-line utility is something like fc-list :spacing=mono:scalable=true:style=regular -f '%{file}\n' However, it probably makes more sense to use Fontconfig as a library. The documentation of it I found rather difficult to understand, but the source of fc-list provides an example: https://gitlab.freedesktop.org/fontc...ref_type=heads Last edited by t4nk; October 16, 2023 at 03:43. |
|
![]() |
![]() |
![]() |
#24 | |
Swordsman
Join Date: Aug 2019
Posts: 434
![]() |
Quote:
|
|
![]() |
![]() |
![]() |
#25 | |
Swordsman
Join Date: May 2016
Posts: 336
![]() |
Quote:
Code:
static void load_subwindow(struct window *window, struct subwindow *subwindow) { assert(window->loaded); assert(!subwindow->loaded); if (subwindow->font == NULL) { if (subwindow->config != NULL) { subwindow->font = make_font(window, subwindow->config->font_name, subwindow->config->font_size); } else { subwindow->font = make_font(window, DEFAULT_FONT, 0); } assert(subwindow->font != NULL); } Code:
if (find_font_info(name) == NULL) { /* Looks like the old file was deleted, use the default one instead */ subwindow->config->font_name = string_make(DEFAULT_FONT); subwindow->config->font_size = 0; return PARSE_ERROR_NONE; } ![]() Anyway, I'll need to reread all this stuff... and setup a Github account, because I don't remember the password for the old one... In the meantime, you might as well fix this one ![]() Last edited by t4nk; October 16, 2023 at 05:03. |
|
![]() |
![]() |
![]() |
#26 |
Angband Devteam member
|
That sounds great - I'm very happy to collaborate (though I know nothing about font management). The Debian packaging repo is at https://salsa.debian.org/games-team/angband in case you're interested in my hackish workarounds, but if we can get the fontconfig functionality into 4.2.6 I can dispense with all that!
__________________
"Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles |
![]() |
![]() |
![]() |
#27 |
Angband Devteam member
|
I'm pleased to say that Debian have accepted the revised version of the package which uses other fonts and does not depend on the .fon files. This gives us huge flexibility to use a wider range of fonts.
__________________
"Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
why does angband still use .fon files ? | shirish | Development | 14 | October 14, 2018 11:18 |
Spoiler Files? | Will94 | Vanilla | 4 | December 2, 2013 23:13 |
RST help files | fph | Development | 13 | September 6, 2011 20:08 |
Pref files | relic | Vanilla | 11 | August 9, 2011 20:40 |
Z+Angband export(decode) .raw files? | PaulBlay | Variants | 2 | February 7, 2009 01:06 |