# Weird characters in Xman.



## Dendros (Jul 9, 2021)

I have installed the x11/xman package to have a GUI for man pages because it's easier to search and read the man pages in this way. 

But there are some weird characters when Xman displays a page. They look like some kind of control codes or something like that. Is there a way to get rid of them?

Screenshot with those characters:


----------



## drhowarddrfine (Jul 9, 2021)

Missing fonts


----------



## covacat (Jul 9, 2021)

looks like terminal control sequences


----------



## Vull (Jul 9, 2021)

Yes. "1m" is xterm terminal control sequence for bold, "0m" = all character attributes off.


----------



## grahamperrin@ (Jul 10, 2021)

I see <https://www.freebsd.org/cgi/man.cgi...+13.0-RELEASE+and+Ports#APPLICATION_RESOURCES> and <https://www.freebsd.org/cgi/man.cgi...&manpath=FreeBSD+13.0-RELEASE+and+Ports#FILES> but I don't understand. 

How can I prefer better fonts?


----------



## Dendros (Jul 10, 2021)

grahamperrin: there is a configuration file for Xman, localized at /usr/local/share/X11/app-defaults/Xman. In my screenshot, I already have changed the font from the default one (which was too large and ugly) to the Sudo monospace font. 
A sample of what I have changed in that file (in parentheses: the name of the chosen font to replace the defaults with - in my case Sudo):


```
*manualFontBold:        -*-courier(Sudo)-bold-r-*-*-*-120-*-*-*-*-*-*
*manualFontItalic:        -*-courier(Sudo)-medium-o-*-*-*-120-*-*-*-*-*-*
*manualFontNormal:        -*-courier(Sudo)-medium-r-*-*-*-120-*-*-*-*-*-*
*manualFontSymbol:        -*-symbol(Sudo)-*-*-*-*-*-120-*-*-*-*-*-*
!*directoryFontNormal:        -*-courier(Sudo)-medium-r-*-*-*-120-*-*-*-*-*-*
*directoryFontNormal:        -*-helvetica(Sudo)-medium-r-*-*-*-120-*-*-*-*-*-*
!*directoryFontNormal:        -*-lucida(Sudo)-bold-r-*-*-*-120-*-*-*-*-*-*
```

I'm not sure if that is the correct way to change fonts in Xman but it seems to work, except for those weird characters and I have not managed to find a setting that allows to get rid of those - assuming that there is one. 

And those codes appear even with the default font so I don't think that this is because of missing fonts.

Interestingly, in Linux Xman does display pages better - there are still some of those codes but far fewer and the text is more readable.

If it's possible to reduce the number of those codes in Linux then this should be possible in FreeBSD too - I just don't know how, that is why I'm asking on forum. Perhaps someone knows the answer.


----------



## grahamperrin@ (Jul 10, 2021)

Dendros said:


> … /usr/local/share/X11/app-defaults/Xman …



Thanks, I wondered whether it might read a file from somewhere under ~/.config, evidently not. 

Not much joy, I'll pass …


```
% xman
Warning: Cannot convert string "-*-Monospace-medium-r-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-Steps-Mono [UKWN]-bold-r-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-Monospace-medium-o-*-*-*-120-*-*-*-*-*-*" to type FontStruct
Warning: Cannot convert string "-*-Ubuntu-*-*-*-*-*-120-*-*-*-*-*-*" to type FontStruct
%
```


----------



## Dendros (Jul 10, 2021)

I think you can use a .Xresources file that is a dotfile in your home directory (create it if it does not exist). Put in it something like that:


```
xman*manualFontBold:          your font
xman*manualFontItalic:        your font
xman*manualFontNormal:        your font
xman*manualFontSymbol:        your font
xman*directoryFontNormal:     your font
```

Then issue this command: `xrdb --merge ~/.Xresources`

I don't know if this will work but from what I have read, it should.

You can even change the background and foreground colors of Xman in the same file:


```
xman*background:    black (or what you want)
xman*foreground:    lightblue (as above)
```


All of those examples were taken from this file and all credit goes to the author.

Edit: sorry, it's `xrdb -merge ~/.Xresources`


----------

