# Built-in editor is very tiny

**URL:** <https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607>\
**Category:** Help!\
**Created:** [July 19, 2024, 11:12am UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607 "2024-07-19T11:12:27Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [August 25, 2024, 6:35pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/21 "2024-08-25T18:35:27Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 26, 2024, 7:13am UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/22 "2024-08-26T07:13:03Z")

</div>

> [@peter.ludemann](#):
>
> 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?

`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 ☹

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 26, 2024, 4:11pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/23 "2024-08-26T16:11:50Z")

</div>

> [@jan](#):
>
> There is a search facility, but I see it crashes on a BUS signal on Asahi Linux

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

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [August 26, 2024, 6:02pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/24 "2024-08-26T18:02:18Z")

</div>

> [@jan](#):
>
> `font.scale` should apply to all fonts

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.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 26, 2024, 7:37pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/25 "2024-08-26T19:37:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [August 26, 2024, 11:11pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/26 "2024-08-26T23:11:15Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 27, 2024, 7:11am UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/27 "2024-08-27T07:11:53Z")

</div>

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

```prolog
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`.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [August 27, 2024, 10:40am UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/28 "2024-08-27T10:40:11Z")

</div>

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`:

```prolog
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”)

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/0/0e470157141d86dd24ccf06baf7d1f771236706c.png)

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 27, 2024, 11:09am UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/29 "2024-08-27T11:09:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [August 27, 2024, 8:02pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/30 "2024-08-27T20:02:53Z")

</div>

> [@jan](#):
>
> to find things from the interface, run `?- manpce.`, use _Tools/Visual hierarchy_

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
prolog_bindings_view.font: font(courier,bold,13)

```

---

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [August 28, 2024, 8:19pm UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/31 "2024-08-28T20:19:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 29, 2024, 6:32am UTC](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607/32 "2024-08-29T06:32:14Z")

</div>

> [@peter.ludemann](#):
>
> 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 …)

[Previous page](https://swi-prolog.discourse.group/t/built-in-editor-is-very-tiny/7607.md?page=1)
