WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Fonts in a custom core.gz?  (Read 5176 times)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Fonts in a custom core.gz?
« on: November 02, 2013, 04:09:22 AM »
I'd like to keep my backup file small so I moved any fonts I had in  ~/.fonts/  directory to  /usr/share/fonts/  which I have packed in a custom core.gz .

I executed:
Code: [Select]
fc-cache -fv
Works for .ttf fonts but, if I get it right, bitmap fonts need:
Code: [Select]
xset +fp /usr/share/fonts/artwiz-latin1artwiz-latin1 in my case.

Where would be a good place, or which file do I have to edit to load bitmap fonts before X starts if not using  ~/.xsession  to make them available soon enough?

I currently have above xset command being executed by adding a file into  /etc/skel/.X.d/  which is included in my custom core.gz - But this doesn't really work because the window manager is started before any files from  .X.d  are getting sourced from within  .xsession  so the WM can't use those fonts until I restart the WM.


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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Fonts in a custom core.gz?
« Reply #1 on: November 02, 2013, 06:06:09 AM »
The X font path is not persistent, so you need to execute that after X is running.

You can either do it in your .xsession, or edit the X server options (you can give it a font path as an argument).
The only barriers that can stop you are the ones you create yourself.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Fonts in a custom core.gz?
« Reply #2 on: November 02, 2013, 01:28:28 PM »
By saing "not persistent", you mean its neither in /opt or /home, nor will it be included in backup by default?
Well, I'd think I have it in some kind of semi persistant form while it's stored in a custom .gz and can get accessed any time.

I'd like to not use user files for that.

Would be great if I can include that font path at the same place where the default bitmap fonts are listed (6x13, 7x13, 7x13bold etc).
I wouldn't be too afraid to try editing files and include them in my custom .gz .

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

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Fonts in a custom core.gz?
« Reply #3 on: November 02, 2013, 07:22:01 PM »
Just curious... would there be any advantage or disadvantage to including a second .gz (initrd) at load time vs. modifying the base initrd?

I understand it is fairly painless to remaster the initrd but I don't know what's involved in creating a new, additional initrd.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Fonts in a custom core.gz?
« Reply #4 on: November 02, 2013, 07:32:24 PM »
The method of creating a compressed cpio archive is covered in http://wiki.tinycorelinux.net/wiki:remastering

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Fonts in a custom core.gz?
« Reply #5 on: November 02, 2013, 09:31:14 PM »
I used the code posted on the wiki to create simple scripts for extracting/packing a .gz file.

Xfe supports executing scripts with 'right-clicked file' as a parameter.

This way it's pretty easy to add edited 'Core' files into a newly created .gz to overwite or add things while I don't have to care about backing up the original files because they stay untouched. Not changing the original files seems saver and easier to me.

What I thought was to to have a custom/optional core.cz (initrd) which includes additional fonts and 'makes' them available as well via included configs or script which run soon enough.
« Last Edit: November 02, 2013, 09:37:02 PM by Misalf »
Download a copy and keep it handy: Core book ;)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Fonts in a custom core.gz?
« Reply #6 on: November 03, 2013, 03:42:03 AM »
Quote
By saing "not persistent", you mean its neither in /opt or /home, nor will it be included in backup by default?

I mean that the X server does not store it anywhere. So you have to tell it, after every start, what you want for the font path.

If the server stored it, you'd only have to run the xset command once.
The only barriers that can stop you are the ones you create yourself.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Fonts in a custom core.gz?
« Reply #7 on: November 03, 2013, 03:43:58 AM »
Just curious... would there be any advantage or disadvantage to including a second .gz (initrd) at load time vs. modifying the base initrd?

Common sense says one is faster, but if you have numbers, please post :)

Quote
I understand it is fairly painless to remaster the initrd but I don't know what's involved in creating a new, additional initrd.

There's an example of this in the book, chapter 12 in the current edition.
The only barriers that can stop you are the ones you create yourself.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: Fonts in a custom core.gz?
« Reply #8 on: November 03, 2013, 10:19:48 AM »
Well duh!

I know I don't get to the wiki as often as I should but I had totally forgotten about the book.

Thanks.

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Fonts in a custom core.gz?
« Reply #9 on: November 03, 2013, 10:53:26 AM »
Is there an alternative to running the xset command?
Download a copy and keep it handy: Core book ;)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Fonts in a custom core.gz?
« Reply #10 on: November 03, 2013, 04:39:17 PM »
This way it's pretty easy to add edited 'Core' files into a newly created .gz to overwite or add things while I don't have to care about backing up the original files because they stay untouched. Not changing the original files seems saver and easier to me.

The one case I could think of where it could preferable to remaster an already existing cpio archive is when intending to remove files rather than adding or modifying.

A workaround could be to create 0-byte files of same path in additional archive, then the files would still exist but not take up space.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Fonts in a custom core.gz?
« Reply #11 on: November 03, 2013, 06:25:48 PM »
The benifit of additional cpio archives for me, as a user with a low level of experience regarding linux, is that I am pretty much unable to destroy my installation. I can always choose to not load any additional archives I made and thereby easily restore the previous/original system state. Additionally, I can keep using my additional cpio archives even if the main core.gz has been updated so I don't need to redo every cusomisation I made after every update. Also my customizations won't get lost due to updates. If I have to update my customization due to Core updates, I can extract my custom .gz and have a look at only the modified files; makes it less likely I forget about customizations I made.

I don't feel any drawbacks in terms of speed while booting. I often look at the 'uptime' value of conky's output right after boot which is unchainged at 28 seconds. I don't care about slower booting time as long as I don't notice.

If you guys know about any drawbacks or potential problems that could occure, I would ofcourse reconsider adding additional cpio archives.


Anyway, back to topic, I think the procedure to include additional bitmap fonts into a single / the main core.cz would be the same. I would be very grateful if anyone can help me accomplish this.

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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Fonts in a custom core.gz?
« Reply #12 on: November 04, 2013, 10:26:32 AM »
Well duh!

I know I don't get to the wiki as often as I should but I had totally forgotten about the book.

Well, it's still waiting for bftpd. I like to work with upstream, otherwise I'd have deployed a patched bftpd ages ago. Once it's published, expect a lot more "read that part" responses to new user questions ;)

Quote
I would be very grateful if anyone can help me accomplish this.

Perhaps my first post was unclear, so elaborating here.

You want to have that font available to the WM. This means you need to do one of
a) xset before the WM
b) tell Xvesa the font path with its -fp option

To do either, you need to edit your .xsession. It's usually in the backup, but you can include your modified .xsession file in a cpio archive too.

--

If you require the new fonts in the existing font dirs, you need to do some mangling: the bitmap font dirs have the index files created by mkfontdir and friends, these need to be up to date for them to work.
« Last Edit: November 04, 2013, 10:29:17 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Fonts in a custom core.gz?
« Reply #13 on: November 04, 2013, 10:42:17 AM »
Files int the cpio archive included as initrds will be overwritten by the ones in the backup, so if you use a cpio initrd to load .xsession you will need to add it to /opt/.xfiletool.lst.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Fonts in a custom core.gz?
« Reply #14 on: November 04, 2013, 02:17:24 PM »
Quote
[...] you need to do some mangling: [...]
I was hoping I could do something like creating additional font dirs inside  /usr/lib/X11/fonts/  and just list them in a config file. But well, I seem to have to do some mangling then.

Files int the cpio archive included as initrds will be overwritten by the ones in the backup, so if you use a cpio initrd to load .xsession you will need to add it to /opt/.xfiletool.lst.
Yes, I don't want to do that.


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