Problems setting fonts in text reports (linux)

Hello - 9 yr gramps user here, but I have not yet tried to make printable reports in all that time. I would ultimately like to make a printable book, but for now I will settle for a well formatted text report of any type.

My problem is that I am trying to set the fonts to serif (Roman) in, for example, an ahnentafel report, but in spite of creating my own style, it seems to be ignored and sans serif fonts stubbornly persist. (True for any text report I have tried, not just for ahnentafel.) Sans is fine for on-screen, but terrible in print.

I don’t see any relevant errors or warnings on the command line, so I’m not sure what to poke at. A cursory glance through the relevant code hasn’t enlightened me since it seems to do what I would expect, but it seems like my style file is at best being ignored, but hacking the ancestorreport.py file hasn’t changed the fonts either. A quick lsof shows that NotoSans and several arial fonts (from the webcore package) are in use by gramps, but nothing else. Any hints?

I’m on linux (openSUSE) with a self-compiled gramps-5.1.2 with a minor patch to correct some grammar on the narrative web page output.

I don’t have that Linux distro handy, so these are generic comments. Normally, Gtk is using the fontconfig tool to manage the various font chores. The tool should be set up with configuration files that try to map a ‘Serif’ or a ‘Times’ font to a font that you actually have installed.
I think that the “fc-match --verbose Roman” will report what fontconfig will use when a font named “Roman” is specified. If this is not as desired, you will either have to install other fonts with names that match better, or modify the fontconfig configuration files to get it to select a font you have installed.

Ah, spot on! Running the fc-match command shows that the family is Arial and is calling the arial.ttf file from the webcore package, not a roman file of any sort like it is supposed to. Perhaps since I’m running gramps under KDE, something is not being set properly in my environment. At least I now know where to start looking. Thank you.

Okay, almost. After learning far too much about how modern linux systems pull in fonts, the proper test for fc-match is “serif”, not “Roman”. Unfortunately, this means that gramps will pull in the screen system fonts to generate it’s reports, not a print-quality set of fonts. I suppose that is the price of convenience, but it does mean the generated reports don’t look very nice. Fortunately, the LaTeX outputs are easily hacked, so I can use the PDFs for generating quick drafts, then switch over to LaTeX when I’m getting ready for the final copy. Thanks for getting me pointed in the right direction.

6 posts were split to a new topic: LaTeX limitations in Gramps

It helps if you identify the preferred output format(s) for the book you ultimately want to produce.

Gramps text reports output in open document format (odt) can be very easily reformatted (changing some or all fonts, indents, spacings or whatever you want to control), style by style – simply by importing a standard (pre-prepared) template which can include headers, footers, standard text as well as paragraph styles etc. After applying your template and checking the structure, flow and pagination, with or without embedding chart pages or objects, you can export to e.g. pdf, epub or other formats.

There is some initial work setting up a template (and working out the relevant Gramps report schema in that process), but once done the first time, you can quickly format every subsequent draft or final report using your preferences to a degree of fine formatting resolution simply unavailable in the Gramps style editor. Be aware that you need to repeat the template process for each gramps report type, but the initial investment of time and effort is repaid in great control over the format of the reports you produce.

Using a template to reformat Gramps text output means it simply does not matter whether the report is generated in sans or serif, you can change nearly anything about the formatting of the text, either selectively or globally.

LaTex may be an option, but I do not think it is the only option.