WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Font improvements in ~/.Xdefaults  (Read 5451 times)

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Font improvements in ~/.Xdefaults
« on: May 17, 2017, 06:49:45 PM »
I'm no font expert, but wondered if the following additions to my own .Xdefaults has any glaring issues.  This is mainly for the standard TC fltk interface/utils.

It seems to have made a nice difference, but I don't want to fool myself especially after staring at the screen for 6 hours with these tired eyes. :)

Appended to ~/.Xdefaults:

fltk*scheme: gleam   <--my favorite eye candy theme

Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintslight
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

Again, I *think* I have made improvements, but after too many hours, with these tired eyes, I don't want to fool myself.

That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #1 on: December 11, 2017, 09:16:48 PM »
Update:  found a solution with scaled fonts instead.

Even though my go-to quickies of using

aterm -fn 10x20
or
aterm -fn 12x24

got me up and running, I wanted even larger grandpa-sized fonts. :)  Sacrificing just a little bit of size vs scaling jaggies, the font line in .Xdefaults now looks like this:

Code: [Select]
aterm*font:*-*-fixed-medium-r-normal--*-280-*-*-*-*-iso8859-1
This is adjusting the font's via the point size option.  Alternatively one could use the pixel-size specificity order something like this:

Code: [Select]
aterm*font:*-*-fixed-medium-r-normal--42-*-*-*-*-*-iso8859-1
For me, with a default stock install of TC64, using the 280 point size option is pleasant enough to use for me.  Need to eat more carrots. :)

That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #2 on: December 13, 2017, 02:33:13 AM »
Stoked!  Just found out about rxvt / urxvt (didn't want to load up with lxterminal or xfce4 terminal and the like).

Also downloaded a truetype ttf font like DejaVu.   Easily configured just like aterm in ~.Xdefaults.

Some of my relevant ~.Xdefaults lines:

Code: [Select]
urxvt*font:xft:DejaVu Sans Mono: size=14
urxvt*background: black
urxvt*foreground: white
urxvt*scrollBar: false    <----- note the capital "B"!
Xft*antialias: true
Xft*hinting: true
Xft*hintstyle: hintfull

Many more options but I won't go any further.  I didn't want to load up on things like lxterminal or xfce-4 terminal and think I found my home with urxvt.

Sorry to seem like I'm blogging - I was just banging my head against the wall trying to keep things ultra-light yet still looking good for my eyes on a variety of hardware.  TC is now here to stay with me for a loooong time!

« Last Edit: December 13, 2017, 02:41:22 AM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #3 on: December 13, 2017, 06:33:45 AM »
Update:
If you try opening *some* programs with urxvt like I did with a 32 bit install from CorePlus and a subsequent download and install of urxvt / rxvt, you may get the error:

Error opening terminal: rxvt-unicode

If that happens, append this to your ~/.ashrc file:
Code: [Select]
TERM=rxvt
I was trying to open programs like nano, htop, sc etc yet things like busybox and even the bc calculator had no problem.  Modifying the .ashrc file fixed it.

« Last Edit: December 13, 2017, 06:39:56 AM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Font improvements in ~/.Xdefaults
« Reply #4 on: December 13, 2017, 10:52:05 AM »
I prefer rxvt-unicode / urxvt, too, but it has its flaws.
I came up with this addition to .ashrc to fix startup of certain programs
Code: [Select]
case $- in *i*) ### Interactive shell.
        case "$TERM" in
                xterm*|rxvt*)
                        [ "$TERM" == "rxvt-unicode" ] && { export LC_CTYPE="de_DE.UTF-8" ; printf "\33]701;$LC_CTYPE\007" ; }  ### URxvt Stuff
                        PS1='blabla my prompt'
                ;;
                *) ### Any other terminal
                        PS1='blabla my simpler prompt'
                ;;
        esac
        export PS1
;;
esac

Download a copy and keep it handy: Core book ;)

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Font improvements in ~/.Xdefaults
« Reply #5 on: December 15, 2017, 01:47:06 PM »
I'm currently testing some patches to rxvt from ArchLinux for font rendering. Along with an updated DejaVu Mono fonts it looks a lot better than the unifont, and appears to have the same languages supported. Unifont 10 is on the left, DejaVu is on the right. You'll need to look at the image full size to see the difference.


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Font improvements in ~/.Xdefaults
« Reply #6 on: December 15, 2017, 03:04:27 PM »
X fonts fall back (in the more advanced APIs), if the current font does not have a glyph then other fonts are searched.
The only barriers that can stop you are the ones you create yourself.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #7 on: January 22, 2018, 04:36:51 AM »
Although it is still a bitmapped font, have you tried xos4 / Terminus with either rxvt or aterm using the iso-10646 sets?

I just compiled the latest Terminus fontset for X11, and got it up and running nicely in my RPi's running piCore with Aterm.  WOW, what a difference.

Although not a scaleable font, Terminus is rocking my world as a lightweight precursor to going all out with TTF font environments or rxvt - at least for my terminal needs for now.  Maybe later I'll try the console fonts, but for X11 with terminals, Terminus shines.

That's a UNIX book! - cool  -- Garth

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Font improvements in ~/.Xdefaults
« Reply #8 on: January 22, 2018, 11:33:34 AM »
i tried a lot and my favorite look is still strongly hinted windows fonts. fine both with or without subpixels to me (depends on the specific font and it's shape/size/boldness which one I prefer)

Since the freetype autohinter on linux has a reputation of destroying all the goodness in these quality fonts i wasted a lot of time during the last 10 years or so, regularly recompiling freetype manually to get the bytecode hinter enabled, that used to be disabled by default. and of course it still never worked 100% correctly - i think the freetype people didn't understand how you have to adjust gamma for the subpixels. it depends on color perception.

Recently they stopped trying to badly copy windows and switched to imitating mac os, making everything anti-aliased, normally resulting in horrible quality on normal low-dpi displays even when using high quality hinted fonts. This helps a lot with...

...BAD quality fonts. Any added randomness actually makes them look less themselves, and thus better. Some people use only strongly antialiased fonts with such bad quality hinting that the autohinter and strong antialiasing is the only good way of dealing with them.
One common example: most webfonts, normally selected by aspiring web designers at 72 point, then scaled down by another guy to make it readable (losing all the "beauty"), and scaled up again by the font artist, very slightly, just beyond being still readable, so that you can see enough detail of the artwork.

At the same time with this change the freetype people limited your choice about the older rendering while claiming the opposite (they say they increased the choice). I don't know if they did it on purpose or just didn't know better, they claim at least that they found the final perfect solution and all that, and that everything would be configureable and legacy behavior still supported, but that's a lie. They even combined their misunderstandings of font technology with a corporate-style marketing effort, trying to convince all IT hipsters how they have perfected fonts once and for all.

A lot of people I know are happy with it regardless. Fun-fact: they all have very high dpi displays and spend most of their day web browsing (obviously with those shitty web fonts). It's too hard to install microsoft fonts anyway, so I can see how they never realized they now look really bad.

As much as people rant about microsoft, they did this one thing right: they really know how to display text on our (still) limited resolution.

One alternative if you want crisp fonts like me and can't figure out how to make freetype do it's job is to just download a BDF version of the good old VGA font.
http://sciops.net/downloads/vga/
http://www.inp.nsk.su/~bolkhov/files/fonts/univga/index.html

I agree about rxvt, it's my favourite terminal. i dislike xterm because of rewrapping being weird. sometimes the end of my lines are lost.
aterm: the horror :P
« Last Edit: January 22, 2018, 11:40:44 AM by hiro »

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #9 on: January 22, 2018, 05:42:33 PM »
Well...  I have to admit I'll leave my major font management up to my media consumption boxes. :)

With the proper bitmapped font (Terminus), things have kind of changed for me as far as terminals go.  I can deal with Aterm now.  In fact I always liked xterm's mini-menu (ctrl-right click) and kind of miss that with Aterm and rxvt.

From a small and simple standpoint, Terminus and TC has proven to be a really workable setup for me.  Not only Aterm, but the DILLO browser too!

Dillo: after installing Terminus, I pointed my bitmapped fonts to "terminus", instead of the ugly Helvetica or whatever it decides to choose and forced it to use Terminus for all fonts.   Tweak your minimum font size, and I'm in heaven now.  I could go with the fltk-full and a boatload of ttf fonts, but for me, now there is no need to do that and I can stick with the standard, um, TC / Picore out of the box setup.

So without having to tweak all the TTF , xft , antialias options etc etc, the Terminus font is good enough for what I use TC for, which isn't mass media consumption generally.  Clean, readable for hours on end just like they pitched it.  Heh, sure all pages in Dillo have that terminus-font look, but it is soooo much cleaner and easier to read.

I'm in love with Terminus now.  Thing is, in '95 I didn't know squat about how to change fonts.  Because of TC's prompting, now I know how!  Too bad it only took me 23 years to figure it out. :)

UPDATE:  Yes!  All my fltk/flwm dialogs have things working with the terminus fonts like file previews etc and are soo much nicer.  Man, it was worth the effort.  My RPI-zero w is like a new machine.

« Last Edit: January 22, 2018, 05:51:09 PM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Font improvements in ~/.Xdefaults
« Reply #10 on: January 22, 2018, 10:00:08 PM »
Did you upload a terminus extension? In theory it should be platform independent.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #11 on: January 23, 2018, 03:43:26 AM »
I thought about submitting that - but didn't know how to handle all the variants 1) X-only 2) X and VGA, 3) ISO-8859 4) ISO-10646 5) everything.

So I didn't want to submit some montrously huge font package for those that need to keep it light and may only need a handful.  I will update my other post to kind of finalize things to help out...
That's a UNIX book! - cool  -- Garth

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Font improvements in ~/.Xdefaults
« Reply #12 on: January 23, 2018, 04:57:16 PM »
pdp-8: nice setup you have, i can identify with that. for a year or so i used dillo as my main browser on a celeron 400MHz :D

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Font improvements in ~/.Xdefaults
« Reply #13 on: January 23, 2018, 06:30:11 PM »
I like it - I'll do a writeup on how I got it to work well in regards to TC/piCore in another subforum - keeping an eye out not to be blogging.  The desire is not to turn back the clock, but to make the most out  of a tiny resource, regardless of how old/new the hardware is....
That's a UNIX book! - cool  -- Garth