Has anyone built an msttcorefonts.dsl?


Forum: myDSL Extensions (deprecated)
Topic: Has anyone built an msttcorefonts.dsl?
started by: kopsis

Posted by kopsis on July 21 2005,15:26
I can get (with the addition of a strategically placed symlink to mkfontdir) the msttcorefonts to install via apt-get, but it appears that I need to backup more than just the fonts/TrueType directory to get it to restore properly.

What I need to do is hunt down all the files that result from the install and make a .dsl out of them. But I figured before I go through that exercise, I'd see if anyone has already done it. I know licensing restrictions on the fonts would prohibit distribution in .dsl form, but just knowing the list of files would make generating my own .dsl from an existing install pretty trivial.

How about it? Anyone been through this already?

Posted by mikshaw on July 22 2005,13:59
You could extract the contents of the deb file and see what's in there:

dpkg -x msttcorefonts.deb target_directory

This will extract only the installable files, though.  There may be a 'postinst' script which runs some additional commands during installation.  Use '-e' instead of '-x' to extract the control files

Posted by kopsis on July 22 2005,14:12
Quote (mikshaw @ July 22 2005,09:59)
You could extract the contents of the deb file and see what's in there:

Yep, the magic is in the postinst. I traced through all the scripts last night and I think I got it all figured out. I was able to build a .dsl that seems to install all the fonts properly. Of course due to core fonts licensing issues, I can't distribute the .dsl extension. But if anyone is interested I could probably make a .dsl with a little script that will give folks a "one click" way to apt-get install the fonts and then automatically package them all up into a local .dsl file.
Posted by RoGuE_StreaK on July 23 2005,01:30
I dunno about the licensing issue, from my very brief search it appeared that at some stage these fonts were available for free download from the MS site?

Either way, if you could come up with something that could install said fonts in a hassle-free way, with the option to use a local dir, that would be cool.
Or even better yet, if there was a way of setting up a system that could install any true-type fonts in a hassle-free way, that would be awesome.


er, can't be bothered editing that to sound less "dude, that would so, like, totally rock..." :D

Posted by kopsis on July 23 2005,09:55
Quote (RoGuE_StreaK @ July 22 2005,21:30)
I dunno about the licensing issue, from my very brief search it appeared that at some stage these fonts were available for free download from the MS site?

I'm pretty sure that Microsoft has long since pulled them from their site. The original license agreement did allow for redistribution of the files -- but only "without modification" which means in there original not-very-useful-self-extracting-windows-exe format :( The .exe files themselves are still downloadable from Sourceforge.

There are RPM and DEB packages with scripts to automate the download and install process. What I think I can do is further automate things for DSL by doing the install and then automatically generating a mydsl extension from the installed files. I'll work on that a bit this weekend if time permits.

Posted by mikshaw on July 23 2005,14:15
If the installation is a one-step process, you might avoid creating a dsl package by adding the install command to /opt/bootlocal.sh:
dpkg -i /path/to/msttcorefonts.deb

Posted by dare2dreamer on July 28 2005,05:18
the problem with relying on a deb would be that a livecd user could not use the corefonts package without enabling apt.

Personally, I think an extension that simply loaded all the fonts in a given directory would be far more versatile and less likely to get anyone sued into non-existence.

...of course if someone tossed their copy of c:\$WINDIR\fonts at the script it couldn't really be helped. ;-)

Posted by kopsis on July 28 2005,09:27
Not to mention that the msttcorefonts.deb package has a postinst script that requires the user to input a directory where the font .exe files reside and then it has to go through and do the extraction/installation for each one.

My first attempt at this sort of worked but all the fonts install to /usr/share which chews up way too much space in the ramdisk. I've now managed to manually build an extension that keeps everything in /opt and just symlinks it all into the normal Debian places. Now I need to script up the creation of the extension. Unfortunately I'm currently working 14 hour days debugging custom device drivers for an embedded PowerPC Linux system so it may be a week or two before I can get back to playing with DSL.

Posted by dare2dreamer on July 29 2005,00:29
doesn't symlinking everything into "the proper debian places" necessitate loading much of the system (/etc /usr, etc) into the ramdisk? If so, it sort of defeats the purpose of installing everything to /opt.

.dsl extensions, as I understand it, run the mkwriteable script. While this isn't a bad thing™ persay, it does up the memory load as compared to truly self-contained extensions (.tar.gz, .ci) that run entirely from /opt.

Is there a way to symlink everything into place without running mkwriteable? if so, I'd love to know about it for a few of the extensions I'm working on.

Posted by mikshaw on July 29 2005,02:24
If you just need to add a font path, you can use the command "xset +fp /path/to/new/fonts"

As far as symlinks without running mkwriteable, i think it depends on what is being linked.  An executable or library can be added to search paths using the PATH and LD_LIBRARY_PATH variables.  I couldn't say if it's possible to do something similar with directories or hard-coded paths

Posted by kopsis on July 29 2005,03:43
At the moment I'm relying on mkwriteable to allow symlinking to all the right spots. There may be ways to get the fonts to work without all the symlinking but that would require
a much better understanding of how X finds and uses TrueType fonts than what I currently possess. What I'm doing is really only a couple steps removed from a deb2dsl generated extension. If only I had more free time!

Posted by cbagger01 on July 29 2005,04:32
For all the hubub about mkwritable using extra memory, for most computers it really isn't that big of a deal.

For computers that have < 64MB of RAM it can be a problem, for everyone else it should be a non-issue.

Posted by kopsis on July 30 2005,04:10
Ok, I have something that works for me -- now I get to see if it works for anyone else :)

msttfonts_dsl.tar.gz is a "green" DSL extension that provides scripts and support files that will, with a single click, do the following:

1. Download the Microsoft TrueType "core fonts" distribution files from Sourceforge (you must have a working internet connection on your DSL system to use this).
2. Extract the actual font (ttf) files from the CAB (exe) files in the distribution.
3. Package the fonts and supporting files up into an msttcorefonts.tar.gz "green" DSL extension that will give you the joys of Times New Roman and friends in a memory friendly package.

So, to try this out first download < msttfonts_dsl.tar.gz >. Install the extension and you'll get a "Build msttcorefonts extension" option in your MyDSL desktop menu. Run that and let the scripts will take it from there.

Caveats:

* I've tried this on exactly one system running a frugal HD install. Will it work on other configs? You tell me :)

* I've only tested this against the X server in the XFree86 4.3.0 DSL extension. I don't know if the KDrive X server even supports TT fonts, let alone whether this will work with it.

Feedback on whether this works for you is greatly desired!

Posted by RoGuE_StreaK on July 30 2005,05:42
Any way to pre-download the CAB and point to the local file, rather than download live?  I still can't get my USB wifi to work with DSL, so I'm currently netless under DSL (I could run a cable, but the GF would not be amused).
Any thoughts on adding other ttf fonts using this system?

Posted by kopsis on July 30 2005,13:39
Quote (RoGuE_StreaK @ July 30 2005,01:42)
Any way to pre-download the CAB and point to the local file, rather than download live?

The get-core-fonts script supports doing that. I haven't tested it but you're welcome to give it a try.

Go < here > and download all the .exe files. Don't skip any because the script is expecting all of them.

Next, open an Aterm window and run the command:
Code Sample
sudo /opt/msttfonts_dsl/get-core-fonts /my/font/dir

where "/my/font/dir" is the complete path to the directory where you saved the .exe files.

The script should do its thing. If not, let me know.

Posted by kopsis on July 30 2005,13:58
Quote (RoGuE_StreaK @ July 30 2005,01:42)
Any thoughts on adding other ttf fonts using this system?

It turns out that adding TrueType fonts is pretty easy. This tool is handy for the MS fonts because a) there's a bunch of them and most folks will want them all, and b) they're packed up in silly .exe files so you need to extract and rename them. Doing all that manually would be pretty painful.

For adding individual fonts, < these instructions > should work. The dpkg-deb extension will allow you to "apt-get install fttools" which gives you the mkttfdir script you need to build the control files. Unless you're installing tons of fonts, we're only talking about a few files so once you get them setup, simply adding them to .filetool.lst may be easier than trying to create an extension.

I suppose if there's enough demand, I could whip up a more generic font installer extension, but I don't think most of the folks using DSL would have much need.

Posted by sci_fi on Aug. 02 2005,21:39
Hello Kopsis:

I am using the scripts you have most graciously provided.

My situation:

Just upgraded to DSL 1.4 and followed the directions regarding your scripts, etc. which I found in this thread. The scripts seem to work just as advertised. At the end of the process, the core fonts are present in the /opt/msttcorefonts/TrueType directory.

My problem is that my applications (Firefox and OpenOffice) don't see the fonts.

I thought from reading this thread that, after following the procedures,  the fonts would be available and automatically accessed by applications. Apparently not. I feel like I am missing something obvious, but ...

I have closed and re-run the ap's, re-booted, to no avail.

Any advice would be much appreciated.

Again, thanks for your efforts on the scripts. They appear work perfectly as far as retrieving and getting the fonts into the file system.

Best Regards,

sci_fi

Posted by kopsis on Aug. 02 2005,22:25
From an Aterm try the following command:
Code Sample
xset +fp /opt/msttcorefonts/TrueType


That will register the new font directory with the X server. After that apps like Firefox and OO should see the new fonts. If that doesn't work, give me some more details about your system (like are you using the XFree86 extension or the standard DSL X server) and I'll try to reproduce the problem.

Posted by sci_fi on Aug. 02 2005,23:17
Hello kopsis:

I tried running: xset +fp /opt/msttcorefonts/TrueType as root.

The command fails with bad font path element (#51), possible causes are:

Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax
----------------------------------------------------------------------
fonts.dir is present in the TrueType directory. I can't tell if it is corrupted or not.
I changed permissions on the TrueType directory - no joy

Not sure about the font server address since all the files are local.

I am running DSL 1.4 liveCD. The download was dsl-1.4.iso. I am not sure about your other questions regarding configuration but will check.

Thanks again.

sci_fi

Posted by ke4nt1 on Aug. 02 2005,23:42
Anyone tried running " update-fonts-dir /path/to/new/fonts "
( as root )

This should make a new fonts.dir file in the new font directory,
then the xset command may work for you.

73
ke4nt

Posted by sci_fi on Aug. 02 2005,23:58
Hi ke4nt1:

I tried running "update-fonts-dir" but bash does not recognize the command. I will look up the syntax. Thanks for the advice. I'll keep trying.

sci_fi

Posted by ke4nt1 on Aug. 03 2005,00:21
It may be a part of the gnu-utils.dsl package,
and not included in the busybox group of utils.

Quote
root@ttyp0[dsl]# update-fonts-dir
/usr/sbin/update-fonts-dir: one or more font directories must be provided.
root@ttyp0[dsl]#


73
ke4nt

Posted by sci_fi on Aug. 03 2005,01:50
ke4nt:

Yes, it is part of the  gnu-utils.dsl package. I installed the package, and ran "update-fonts-dir /opt/msttcorefonts/TrueType, as suggested.  It runs but gives a warning about the absolute path to the font directory.

I then ran  "xset +fp /opt/msttcorefonts/TrueType" but get exactly the same error as before, ie. 51. I tried adjusting the file permissions again but no luck.

I have noticed that somewhere in all this, a file, msttcorefonts.lst was  created in the root directory. Seems an odd place. I tried copying it into both /opt/msttcorefonts and /opt/msttcorefonts/TrueType directories, but it made no difference.

Not sure what to try next. Any ideas?

Thank you for your help.

sci_fi

Posted by kopsis on Aug. 03 2005,02:54
You shouldn't have to mess with update-fonts-dir or any of the other means of generating .dir and .scale files since that's already taken care of when you build the extension.

I think the problem is that Kdrive (DSL's tiny X server) just doesn't include a TrueType font renderer. Not surprising since that would run counter to the goal of keeping it small.

To use TrueType fonts in DSL you're probably going to have to run the XFree86 extension which provides a full featured X server including the standard suite of font rendering engines.

Posted by ke4nt1 on Aug. 03 2005,06:41
The absolute path would be /ramdisk/opt/msttcorefonts/TrueType

Or, try cd'ing into the TrueType directory directly,
and running " update-fonts-dir . "

It should not give an error about absolute pathing..

Then try the xset + command,  after first seeing your fonts listed
in a file called fonts.dir in that TrueType directory..

Kopsis point about truetype rendering may be true,
although there is already a truetype bitstream font in place in my system,
at /usr/share/fonts/truetype/

73
ke4nt

Posted by sci_fi on Aug. 03 2005,11:59
kopsis, ke4nt1:

Thanks for the latest suggestions. I will give them a try today and let you know.

sci_fi

Posted by sci_fi on Aug. 03 2005,18:46
Hello kopsis, ke4nt1:

Thank you both for the suggestions. I am making some progress.

I installed the XF86 extension and made the modifications explained in the instructions. I use the VESA version of  XF86Config-4 from the samples provided. Seems to work better than anything else.

I have the msttfonts.dsl file set up to load via MyDSL at boot.
I have added "sudo xset +fp /opt/msttcorefonts/TrueType" to /opt/bootlocal.shell

Here are the results:

1. The MSfonts seem to load fine via MyDSL.

2. When the xset command executes from bootlocal.sh, a message saying "xset could not open display"  appears, but the boot proceeds.

3. A lot of warnings and error messages relating to font paths appear briefly (can be viewed during shutdown procedure).

3. The boot appears to complete normally.

4. At this point, OpenOffice does not have the MS fonts.

5. Running "xset +fp /opt/msttcorefonts/TrueType" manually works without error and OO can now see the MS fonts.

6. FireFox does not see the fonts at all, ever. I am using FF 1.0.4 via GTK extension and have not tested with the earlier FF version that is standard in DSL. It certainly appears that FF handles fonts differently. I need to investigate this.

I am very puzzled that xset does not work from bootlocal.sh.
I do not know if the modifed file /home/dsl/.xserverrc" is functioning properly or not. (this was per the instructions for installing the XF86 extension).
I will be poking around FF trying to determine where it looks for fonts.

Any thoughts?

Thanks.

sci_fi

Posted by ke4nt1 on Aug. 03 2005,19:10
If I am correct, the GTK2 versions of most of our extensions
use the defoma package for font management..

After a succesful xset + command, try rerunning the
"Update to Gtk2" command, and see if it updates the
defoma cache.

and the xset command needs an X environment to
operate with.  Try adding the line to your .xinitrc file,
BEFORE the last 'enhance' line in the file.
This will run the command AFTER x has started.

73
ke4nt

Posted by kopsis on Aug. 03 2005,20:48
Quote (sci_fi @ Aug. 03 2005,14:46)
I have the msttfonts.dsl file set up to load via MyDSL at boot.
I have added "sudo xset +fp /opt/msttcorefonts/TrueType" to /opt/bootlocal.shell

Take the "sudo" off. Your X session is owned by the "dsl" user. You'd have to do an "xhost + ..." command to give "root" permission to run xset against "dsl's" X session.

You shouldn't need root priviledges to do the xset.

Posted by sci_fi on Aug. 03 2005,21:07
Hi ke4nt1 and kopsis:

Yes, I realized I didn't need the "sudo" on the xset and had already removed it. Forgot to mention. Sorry.

Slowly making progress. Not quite there yet.

1. I moved "xset +fp /opt/msttcorefonts/TrueType" to .xinitrc

I re-booted.

Immediately after boot-up OpenOffice now sees the new fonts. Hurrah!

Firefox does not see the fonts.

Exited FF.
I ran the Update_to_GTK2 command from the myDSL drop-down menu.
Run FF again.

Result: FF is still not seeing the fonts.

-----------------------------------------------------------------------------------
Additional information:

I examined the error messages appearing during boot up. They appear to be related to the XF86Config-4 file (IMHO only). Messages of apparent relevance:

Could not init font path element unix /:7100, removing from list

Couldn't load XKB keymap, falling back to pre-XKB keymap (I noticed that cntl-alt-delete and my power buttom don't seem to be seen)

[EE] Mouse(2) no protocol specified
[EE] PreInit failed for input device "Mouse(2)"


Perhaps the above font path element error is the culprit. What to do? I will change over to a different XF86Config-4 file as an experiment and let you know.

Thanks.

sci_fi

Posted by kopsis on Aug. 04 2005,09:27
Quote (sci_fi @ Aug. 03 2005,17:07)
Perhaps the above font path element error is the culprit. What to do? I will change over to a different XF86Config-4 file as an experiment and let you know.

The font path error you're seeing just indicates that that particular font path in your XF86Config-4 isn't valid. In this case it's specifying a socket connection to a local font server process that your are not actually running. All the other specified font paths should remain valid.

For what it's worth, I'm not seeing the TT fonts in Firefox GTK+2 either. This worked in an older attempt at my corefonts package that dumped everything into the regular Debian locations (/usr and /etc) so I'm guessing GTK+2 is looking in those spots to build its font lists. If you can wait until next week, I can probably get this problem sorted out this weekend. Stay tuned.

Posted by sci_fi on Aug. 04 2005,11:15
Hello Kopsis:

Thanks for the update and your efforts on this. No problem waiting until the weekend. You know how it is. One sort of gets obsessed with making things right.

Must be something to do with FF gtk2, since OpenOffice finds the fonts just fine.

BTW. I found a typo in the generic VESA XF86Config-4 file. In the mouse(2) section the word "protocol" is spelled "protocal". Changing that fixed my boot up mouse(2) warnings.

Still fiddling with the keyboard errors.

Thanks again. I'll post if I get anywhere wrt keyboard problems.

sci_fi

Posted by kopsis on Aug. 04 2005,11:51
Quote (sci_fi @ Aug. 04 2005,07:15)
You know how it is. One sort of gets obsessed with making things right.

Amen to that! A feeling I know all too well :)

For what it's worth the problem is definitely GTK2 specific and it is because the GTK2 extension is relying on defoma (DEbianFOntMAnager) for font information. The msttcorefonts extension isn't using defoma because that would require that I include defoma (which means draging a recent version of Perl along with it) and that it do the whole mkwriteable thing -- something I didn't want to force on folks with low memory systems.

Since GTK2 already includes defoma and forces a mkwriteable, what I'll do is add a script that GTK2 users can run to do the additional setup (once I figure out what that is). I also need to experiment with TrueType font server daemons (like xfstt). I think it may be possible to use these fonts with DSL's standard Kdrive X server if you have a font server daemon running to process them. Might be a good solution for those who don't want to go the full XFree86 route.

Posted by kopsis on Aug. 04 2005,21:52
Ok, I had a few free minutes so I did a little digging :)

There's a chance that making the MS TrueType fonts available to GTK2 apps may be as simple as doing:
Code Sample

sudo ln -s /opt/msttcorefonts/TrueType /usr/share/fonts/msttcorefonts

and then doing the "Update to GTK2" thing. I can't test this tonight, but if anyone wants to take a shot and post their results, I'd welcome it. Even if that doesn't do it, the fix is going to be something along those lines so I'll mod the scripts to build a .dsl instead of a .tar.gz and include the necessary links into /usr. Yeah, that means mkwriteable, but it looks like TrueType fonts only work with XFree86.dsl so that's a non-issue.

I tried getting KDrive (aka Xvesa, aka Xfbdev) to pull fonts from an xfstt font server daemon, but no joy. Looks like the tiny DSL X server wasn't built with font server support  :angry:

So what to do about folks who can't or don't want to run XFree86? Here's my thoughts:

I can modify my font extraction scripts to actually generate two extensions -- one that has the real TrueType fonts and another that has them converted to bitmap (.pcf.gz) fonts at relatively common point sizes (6, 8, 10, 11, 12, 14, 16, 20, 24, 32, 48?). I've tested that with a couple that I converted manually and it actually works! The fonts aren't scalable so if you need a point size that isn't available it looks ugly ... but for supported point sizes the fonts look just like their TrueType counterparts. Not a perfect solution, but it at least give users a chance of viewing web pages and documents the way the authors created them :)

The resulting extension will take somewhere between 6 and 10 MB but will be a .tar.gz extension so if you have an HD (or flash) for /opt it won't take any RAM.

Anyone have any thoughts on that? Would it be a worthwhile exercise or will all the folks that need fonts be happy to run XFree86? I'll probably build this regardless just because I have some use for it, but feedback before I do is certainly welcome.

Posted by ke4nt1 on Aug. 04 2005,22:03
Any chance of adding this path to the XF86Config-4 file,
under the list of font paths?

/opt/msttcorefonts/TrueType

??

Kent

Posted by sci_fi on Aug. 04 2005,23:16
Whooo Hooooo!!!! You got it, Kopsis!!!!!

I executed the command you gave and then did "Update to GTK2" again. Then FF sees the fonts. Outstanding!!!

I will try to automate this by adding the two commands to .xinitrc after the after the xset command.

More later after I try it.

Fantastic.

sci_fi

Posted by sci_fi on Aug. 04 2005,23:31
Yup.

Just added:

sudo ln -s /opt/msttcorefonts/TrueType /usr/share/fonts/msttcorefonts

BEFORE

xset +fps /etc/msttcorefonts/Truetype

in .xinitrc.

Seems to work like a dream.

This is VERY cool. Now running FF in DSL looks every bit as good as in Kanotix. I can go to DSL full time now. Boots faster. Less overhead. Nothing against Kanotix, which is a brilliant distro, but this is great.

Thanks again.

sci_fi

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.