Built-in editor is very tiny

The font.scale seems to only apply to displaying the program source – when I use the graphic debugger, the menus, the bindings, and call stack are all much smaller text (also, when using manpce, the text is small) … what setting(s) should I change in xpce/Defaults to change the sizes of the non-source stuff?

Is there documentation for all the settings? (manpce doesn’t seem have a “search” capability and I don’t know where its source is and the various packages/xpce/man/reference/*.doc files seem to be generated files.) I’m guessing that this is all “obvious” for someone who’s used to X11 programming; but I haven’t don’t that in ~20 years. :slight_smile:

font.scale should apply to all fonts. Surely does for me. Possibly you are missing a dependency? You need Xft and fontconfig to allow scalable Unicode fonts in xpce. If these are missing it falls back to very old non-scalable X11 bitmap fonts.

There is a search facility, but I see it crashes on a BUS signal on Asahi Linux :frowning:

So, start ?- manpce., select Browsers → Search and then search. This is a full text search. It now also works on Asahi Linux :slight_smile:

The problem is that I want a different font scale for the menus, bindings, etc. – I have a fairly small font for the text and that makes the menus/bindings/etc too small.

I don’t understand. The dominant fonts are fixed and normal, where the first is used for the editor text and the latter is used for menus and pretty much all proportional fonts. Without any scaling, fixed is 13px and normal 12px, and all should look pretty much the same size. With fonts.scale they should both scale and remain the same size.

If you want different sizes, modify display.system_fonts, which maps symbolic names to concrete fonts, i.e., pretty much as LaTeX does font handling.

Part of the problem seems to be that the apparent size (“x height”) of Helvetica and Screen fonts are different from their font heights. Also, I have to guess which font is being used where. I tried looking through the sources, but got lost … is there a section of code that tells me which system fonts are used for the menu, bindings, call stack (and possibly other panes on the gtrace window)?
(I would rather not learn all about XPCE and X11 just so that I can adjust the gtrace window to my liking.)

I’m wondering why these fonts are so different. It suggests there is something wrong with the installed fonts or with xpce’s dependencies that make it revert to older font management. It you run

grep PKG_FONTCONFIG_LDFLAGS CMakeCache.txt

This gives me

PKG_FONTCONFIG_LDFLAGS:INTERNAL=-L/usr/lib64;-lfontconfig;-lfreetype

Telling me it both has fontconfig and the freetype libraries. Both are required for proper font handling.

As for the font handling, most classes have a resource .font and a font method. Normally, we specify the symbolic name of the font as e.g., normal, referring to the default proportional font. These are mapped by the previously mentioned mapping table to fonts specified as a triple (family, style, size) which are mapped to fontconfig properties. FontConfig uses these to find the best matching font based on a user configuration file and system default rules.

If we do git grep font in the trace directory, we see it uses the normal font for almost anything. The source view itself comes from PceEmacs, which uses fixed.

The actual size and apparent size of fonts are more complex than just the “size” parameter (if you wish, I can write a few paragraphs on the various choices that font designers have and how programmers have done things wrong; some years ago, I worked with graphics designers and it was “interesting”).

I get this from in CMakeCache.txt:

PKG_FONTCONFIG_LDFLAGS:INTERNAL=-L/usr/lib/x86_64-linux-gnu;-lfontconfig;-lfreetype

Here are side-by-side images with the default Default, except the one on the right has fixed changed from screen changed to courier.
(BTW, the “Bindings” seems to use a different font from the “Call Stack”)

Looks more or less as I’d expect. The binding view and stack use the same normal font as far as I can tell. You can change normal by editing display.system_fonts or you can change the font for the bindings using this, where <font> is either a symbolic font name or a font(…) term.

prolog_bindings_view.font: <font>

The stack view seems hard coded as normal. Of course, that can be changed by adding a font class variable to prolog_stack_view and ask for that in the code. I doubt that is the right direction though as normal is supposed to be a pleasantly readable proportional font. Some people may prefer a fixed font here. I used proportional as it typically uses less space and, unlike with source, there is no need to get things vertically aligned using spaces or tabs.

P.s. And yes, font size is a difficult topic. All the things xpce talks to talk about font sizes though, though in different ways.

P.s. to find things from the interface, run ?- manpce., use Tools/Visual hierarchy, click the point button and then the object you want to know things about. That shows the hierarchy of displayable objects. Walk around and use the context menu to inspect sources or object details.

That didn’t do quite what I wanted; but if I did (from the graphical debugger window):
Help → XPCE manual
and then did Tools/Visual hierarchy from the manual’s window, I could see all the pieces of debugger GUI.

Also, all the parts can be seen in initialise/3 in packages/xpce/prolog/lib/trace/gui.pl, so I can now deal with the individual items, e.g.:

prolog_bindings_view.font: font(courier,bold,13)

Is there a way to force re-processing of the Default file? Or do I have to stop/start swipl for each change to the Default file?

Yes. Right now that is the only option (and at least I have no plan to change that …)