Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: ldp on April 22, 2012, 09:53:22 AM

Title: Fonts
Post by: ldp on April 22, 2012, 09:53:22 AM
Hope this is the right place to post a question which I'm sure has been raised before but I can't seem to find the answer I'm looking for (or at least I'm not doing /understanding what I'm seeing properly).

I'm new to TC and fairly new to linux in general. I've been playing arounf with various distributions nad have installed TC as one of three on an old machine.

The (minor) problems is: how to change the fonts I'm presented with on the title bars, menu bars and menus? I've managed to work out how to change styles but I was expecting the fonts to be included with the styles, but whichever style I choose (system or user) the font stays the same.

Can someone enlighten me and point out what I'm missing?

Thanks in anticipation.

I've got TC running with fluxbox - latest versions of both.
Title: Re: Fonts
Post by: ldp on April 22, 2012, 10:30:18 AM
As an ancillary question - why does the background change when I logout and restart X with one of the user styles?
Title: Re: Fonts
Post by: netnomad on April 22, 2012, 12:42:06 PM
hi,

perhaps you want to control your fonts in fluxbox with the overlay-config-file

~/.fluxbox/overlay
menu.title.font:                     -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
menu.frame.font:                 -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-iso8859-*
window.font:                         -*-helvetica-bold-r-normal-*-14-*-*-*-*-*-iso8859-*
window.tab.font:                   -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
toolbar.font:                          -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
toolbar.iconbar.focused.font:          -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
toolbar.iconbar.unfocused.font:      -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
toolbar.*.*.font:                      -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
*.font:                                     -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-iso8859-*
Title: Re: Fonts
Post by: ldp on April 22, 2012, 12:55:03 PM
I've seen and tried the overlay file, but I've failed to see any change to the fonts being displayed. This maybe because the fonts aren't setup properly and/or the description/format in the line is not correct. Any help on the correct font layout would be a great help.



Title: Re: Fonts
Post by: netnomad on April 22, 2012, 01:00:06 PM
the other important config-file is ~/.Xdefaults

~/.Xdefaults
Xft.dpi:96.0
#Xft.dpi:84.0
#Xft.dpi:82.0
#Xft.dpi:80.0
fltk*scheme:gtk+
aterm*loginShell:true
aterm*font:*-fixed-*-*-*-20-*
#aterm*font:-misc-fixed-medium-r-normal-*-20--*-*-c-*-iso8859-1
aterm*scrollBar:true
aterm*scrollBar_right:true
aterm*saveLines:32767
aterm*geometry:80x25
aterm*title:aterm
aterm*transparent:true
aterm*foreground:white
aterm*background:black
aterm*cursorColor:yellow
aterm*cursorBlink:true
aterm*fading:90
aterm*shading:5
aterm*color12:DodgerBlue1
Title: Re: Fonts
Post by: ldp on April 22, 2012, 01:12:34 PM
Apologies for being dense, but where does this file fit in with the way that fonts have to be set up? The example you displayed is the same as mine until the Xterm entries (the # entries excepted).

I sort of assumed that the initial tc install came with virtually no fonts to speak of, and I followed the instructions on the wiki to download and install some fonts, and I'm wondering if I've set them correctly.
Title: Re: Fonts
Post by: ldp on April 22, 2012, 01:26:35 PM
Hey, netnomad,  I've got the helvetica font as you listed in your overlay, now that I pasted the entire block rather than hand-writing a couple of lines. I don't know what I did wrong but thanks!

If you can indulge me again,where do the helvetica fonts lie, and how get/setup a different font?
Title: Re: Fonts
Post by: netnomad on April 22, 2012, 09:50:37 PM
this font is part of Xlibs.tcz -> /tmp/tcloop/Xlibs/usr/lib/X11/fonts/75dpi/*

you can find it in the path of  /usr/lib/X11/fonts/75dpi.
Title: Re: Fonts
Post by: ldp on April 23, 2012, 11:14:24 AM
I can see another folder 'misc' with additional fonts within, these seem available if I reference them in the same format as the helvetica entries in the overlay file.

How are these fonts made 'available' to the system? What fonts (rather what font formats should I download)?

I'm a bit confused as how it is all meant to fit together. Is there a definitive resource for us dummies to follow?

Thanks once again.
Title: Re: Fonts
Post by: curaga on April 23, 2012, 11:56:30 AM
@ldp

They are bitmap fonts, and I doubt you're going to find many of them on the 'net. xlsfonts lists them, the font path can be set with xset, and they need the index files in the same dir as the font (as generated by mkfontdir).

@netnomad

The fluxbox build doesn't do ttf?
Title: Re: Fonts
Post by: netnomad on April 23, 2012, 12:12:59 PM
hi curaga,

actually i'm very happy with that basic xlibs-fonts and with this configuration
i got uniform, readable fonts in all my applications.
some packages like libreoffice annoyed me with their dependency to dejavu-fonts-ttf.
in my configuration dejavu-fonts-ttf didn't look good,
(very wide fonts that weren't easy readable and that didn't attracted me),
especially in icecat, minefield or thunderbird...
... so i decided to create an empty dummy-package of dejavu-fonts-ttf to get rid of that annoyance.

perhaps it was my fault, that my dejavu-fonts-ttf-configuration didn't look good...
can you give me a hint to improve the appearance?

thank you in advance for some suggestions.
Title: Re: Fonts
Post by: curaga on April 23, 2012, 12:22:35 PM
Can't think of anything, but I find the dejavu fonts not too good looking myself.
Title: Re: Fonts
Post by: ldp on April 23, 2012, 01:33:49 PM
netnomad/curaga,

Thanks for your pointers and useful snippets of info.

To be honest I'm finding that just playing around on this spare box (which I've managed to get 3 different distros installed and booting) and just 'trying things' has been the best way to learn. I'm not going to break anything so it doesn't matter what I try or do!

Thanks again!
Title: Re: Fonts
Post by: solorin on April 23, 2012, 11:10:32 PM
hey ldp.

maybe a couple tips to help you in your exploration. skip whatever parts you know already.
(this is pretty much a long-winded rehash of what curaga and others have posted above)
the arch wiki has some good documentation. often times i find myself there.
https://wiki.archlinux.org/index.php/Fonts
the differences to Core aren't that many. (coz' Core is really stripped down, the major
difficulties are finding which extension the command you want is packaged in, and how to make
your adjustments persistent).

I've only experimented with bitmap fonts so I can't help you with console fonts,TTF or other
font systems. (TTF for example requires an understanding of fontconfig).
bitmap fonts are screen fonts for X and usually have the file extension pcf, pcf.gz, or bdf. pcf
and pcf.gz are fairly ready to use on your system - you just need to tell X where they are. the
terminal command xlsfonts will list the fonts that X sees at the moment and their aliases. you
can use these in the .Xdefaults file, for example, to set the font in your terminal emulator.
other programs have other ways to configure their fonts.

the repository does have a couple packages with additional bitmap fonts but my experience with them
is that they don't quite work out of the box. you can use a keyword search for fonts and then look
in the file listing for pcf or pcf.gz files. ones that come to mind are schumacher-clean-fonts.tcz
and xfonts-unifont.tcz. time permitting, i'll also upload an extension or two.
once you load the font extension. you'll have to run mkfontscale and mkfontdir on or in the directory your new fonts are in.
if this directory already has a fonts.dir or fonts.scale file you'll have to
rm these (and sudo where appropriate). mkfontdir and mkfontscale are found in Xorg-7.6-bin.tcz, etc.

next you'll have to tell X to see them by running:

xset +fp /path/to/fonts
(you can skip this if the directory is in your font path, xset -q will tell you)

xset fp rehash

if you've got X running, you'll most likely have xset already (it's found in Xlibs.tcz or
Xorg-7.x-bin.tcz).

xlsfonts will tell you if X sees the new fonts.
I haven't found a way to autogenerate fonts.alias yet, and have been editing it by hand. the format
is pretty simple, and nothing's blown up yet(i think).

you can make these changes persistent by adding fonts.dir, fonts.scale, and fonts.alias to
/opt/.filetool.lst (make sure you prepend the appropriate path)
you'll also have to add the xset commands to a script in your ~/.X.d directory.
this will load the fonts for that login name (to make it universal you'll probably have to put
them somewhere like bootlocal.sh or bootsync.sh - not sure)

contrary to what curaga said before, i've found lots of bitmap fonts on the net, the source links
of font packages in the arch user repository are a good start. (this is probably just a matter
of perception tho.)

to use them you can
a) make an extension with them and proceed as above (if you do submit pls pack fonts.dir,
fonts.scale, and font.alias with it, but make sure they don't conflict with existing ones.)
b) just download it to ~/.fonts and run the same commands as above on this directory.
these fonts will only be available to that user.

finally if you find .bdf files (the source format for bitmap fonts) you can convert them to
pcf files with the bdftopcf command (found in Xorg-7.5-bin.tcz but not Xorg-7.6-bin.tcz for some
reason).

Hope that helped a little. Questions, clarifications, corrections and addendums are all welcome.

cheerio,
solorin
Title: Re: Fonts
Post by: ldp on April 24, 2012, 08:53:49 AM
solorin,

Thanks for the reply. Really appreciate the responses and effort.

There's a fair bit to take in so let me digest it and I'll be sure to come back to you if I've any further queries!

Once again, thanks. LDP
Title: Re: Fonts
Post by: Sasha on December 14, 2023, 05:07:30 AM
Good afternoon I want to install cirillic fonts. I follow the steps written above, but after a reboot all changes disappear. Please tell me what is my mistake?

Code: [Select]
tc@TinyPC:~$ sudo su
root@TinyPC:/home/tc# cp -R /mnt/sdc1/cyrillic /usr/local/share/fonts
root@TinyPC:/home/tc# cd ../
root@TinyPC:/home# cd ../
root@TinyPC:/# ls
bin      home     linuxrc  proc     sbin     usr
dev      init     mnt     
root     sys      var
etc      lib      opt      run      tmp
root@TinyPC:/# cd usr/local/share/fonts/cyrillic
root@TinyPC:/usr/local/share/fonts/cyrillic# ls
PTC55F.ttf               
PTM75F.ttf               
PTZ55F.ttf
PTC75F.ttf               
PTN57F.ttf               
PTZ56F.ttf
PTF55E.ttf               
PTN77F.ttf               
cyrillic.ttf
PTF55F.ttf               
PTS55E.ttf               
koi8-r_bold.ttf
PTF56F.ttf               
PTS55F.ttf               
koi8-r_bold_italic.ttf
PTF75F.ttf               
PTS56F.ttf               
koi8-r_bold_regular.ttf
PTF76F.ttf               
PTS75F.ttf               
koi8-r_italic.ttf
PTM55F.ttf               
PTS76F.ttf               
ubuntu_regular.ttf
root@TinyPC:/usr/local/share/fonts/cyrillic# mkfontscale
root@TinyPC:/usr/local/share/fonts/cyrillic# mkfontdir
root@TinyPC:/usr/local/share/fonts/cyrillic# ls
PTC55F.ttf               
PTN57F.ttf               
cyrillic.ttf
PTC75F.ttf               
PTN77F.ttf               
fonts.dir
PTF55E.ttf               
PTS55E.ttf               
fonts.scale
PTF55F.ttf               
PTS55F.ttf               
koi8-r_bold.ttf
PTF56F.ttf               
PTS56F.ttf               
koi8-r_bold_italic.ttf
PTF75F.ttf               
PTS75F.ttf               
koi8-r_bold_regular.ttf
PTF76F.ttf               
PTS76F.ttf               
koi8-r_italic.ttf
PTM55F.ttf               
PTZ55F.ttf               
ubuntu_regular.ttf
PTM75F.ttf               
PTZ56F.ttf

    [EDIT]: Added  code  tags.  Rich
Title: Re: Fonts
Post by: Rich on December 14, 2023, 06:19:08 AM
Hi Sasha
Welcome to the forum.

Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.
Title: Re: Fonts
Post by: Juanito on December 14, 2023, 06:31:43 AM
Good afternoon I want to install cirillic fonts. I follow the steps written above, but after a reboot all changes disappear. Please tell me what is my mistake?

By default nothing is saved on reboot.

Either add the font files to your backup or, better, make an extension out of them.
Title: Re: Fonts
Post by: Rich on December 14, 2023, 06:43:29 AM
Hi Sasha
Your mistake was copying to  /usr.
Most of the directories get rebuilt from scratch every time
you reboot. The right way to do this is to create an extension.
Try this:
Code: [Select]
tce-load -wi squashfs-tools fontconfig
mkdir -p pkg/usr/local/share/fonts
cp -R /mnt/sdc1/cyrillic pkg/usr/local/share/fonts
mkdir -p pkg/usr/tce.installed
echo -e "#!/bin/sh\n\nfc-cache /usr/local/share/fonts/cyrillic" > pkg/usr/tce.installed/cyrillic-fonts
mksquashfs pkg cyrillic-fonts.tcz
cp cyrillic-fonts.tcz /etc/sysconfig/tcedir/optional/
echo cyrillic-fonts.tcz >> /etc/sysconfig/tcedir/onboot.lst

Reboot and see if that worked.
Title: Re: Fonts
Post by: Sasha on December 15, 2023, 05:05:31 AM
Rich, thank you so much and God bless you! I've been trying to add a font to the system for half a year now! I tried everything, but now it works! It's good that I didn't sell my Lenovo s100. It could only run Windows XP, but it can't run Windows 7. Now it can be fully used. Of course, the file names remained in crocodiles, but the Cyrillic alphabet appeared in libreoffice. This is already huge progress! I owe you. If you need a program for the gym, write to me and I’ll compose it for you in English, for any purpose)
github.com/Kryukov-max/cyrillic
Just in case, I attached a link to the Cyrillic fonts, surely someone will need it!
Title: Re: Fonts
Post by: Rich on December 15, 2023, 05:53:26 AM
Hi Sasha
You are quite welcome. Thank you for confirming it worked.

One last thing. I should have included a dependency file:
Code: [Select]
echo "fontconfig.tcz" > /etc/sysconfig/tcedir/optional/cyrillic-fonts.tcz.depbecause your extension depends on  fontconfig.tcz.

You won't notice a difference because the  tce-load  command
added it to your  onboot.lst  file, so it's already being loaded.
You want that so your extension won't break if  fontconfig.tcz
is ever removed from your  onboot.lst  file.
Title: Re: Fonts
Post by: Sasha on December 15, 2023, 06:07:00 AM
Rich, thank you again! I'll definitely add
echo "fontconfig.tcz" > /etc/sysconfig/tcedir/optional/cyrillic-fonts.tcz.dep
Changes you recommended! I’ve already been using the site porusski.net for half a year, but it’s very inconvenient. Because You always need the Internet. And now everything is great!