LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2010, 05:37 PM   #1
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Rep: Reputation: 29
send all fonts on my computer to printer


I need to write a command line script.

I have scribus install on my machine which someone suggested would do what I want. It does. But unfortunately I can not get it to work. The text print screen freezes when it is loading a font and will not respond.

One of the other disadvantages with scribus I did find was it wanted to print the fonts in all the size available and at 3 per page I have enough fonts to fill 607 pages.

I have googled, read all the scripting books I have, read several online tutorials and have not found a way to send a request for a certain style font to the printer from the command line.

Am I looking for the impossible? (unobtainable)
TIA
Dafy

Last edited by Dafydd; 05-27-2010 at 05:43 PM. Reason: Question worded badly
 
Old 05-29-2010, 01:13 PM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Save your project to PDF, and print the PDF from evince.
 
Old 05-30-2010, 12:13 AM   #3
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
I have 6300+ fonts loaded on my machine. I need to delete some. Foreign, runes , and others. I want to print each font in its style with its name. I read better from a book/page as opposed to clicking on each font in one of the fontmanagers.

A this link.
In section: 4.2 Printing TrueType font specimens

I found this code but have not had success.

Code:
xfstt --gslist --sync | printfont
I have installed the script below in /usr/bin/printfont
Code:
#!/bin/sh
##printfont
set -e
IFS= ')'

while read fontname rest
do
    cat << EOM | lpr
%!PS
(/usr/lib/ghostscript/5.50/prfont.ps) run
$fontname) DoFont
EOM
done
Produces this error:
Quote:
dave@dave:~/font$ xfstt --gslist --sync | printfont
/usr/bin/printfont: 4: ): not found
cannot write to font database!
sync failed.

Last edited by Dafydd; 05-30-2010 at 12:18 AM.
 
Old 05-30-2010, 07:35 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
I don't understand why this line is needed
Code:
IFS= ')'
but it should be one of
Code:
IFS=' )'
or
IFS=')'
Quote:
cannot write to font database!
sync failed.
Perhaps the sync fails because your user lacks write permission, you would have to run this as root. Did you run this while X was started? The man page says
Code:
--sync Synchronize the font database with installed fonts and exit when
               done.  Don’t do this while xfstt is running.
 
Old 05-31-2010, 12:09 AM   #5
Dafydd
Member
 
Registered: Oct 2008
Posts: 344

Original Poster
Rep: Reputation: 29
I owe you a pomegranate, an orange or a beer or whatever. I've been using Ubuntu since release 7.04 and did not know until now there was a manual.

I've got some reading to do, I may or may not be back.
 
Old 06-01-2010, 01:00 AM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
There is also an unofficial guide and a book.

There are unix manuals for pretty much every command. Enter

man <command>

in a terminal (no matter which distro) to read them. "man man" tells you how to use the man command. The apropos command can be used to find exact commands and their manuals. eg.

apropos font

gives you a list of every manual that has anything to do with fonts.

These are possibly the two most useful commands in the whole thing. If you want to look for a unix manual online - you can google for "man command" too. Of course, you still have to read the manual and understand it: they are usually more useful than your average help page, but harder to understand as a result.

I originally figured that if you were getting scribus to generate your sample text for printing, that it should be no trouble just to save what you had and use a different program to handle the printing. Also, if you use wysiwig, you can see where a font needs to be printed larger to see what it is ... but then, with a gui, you can browse to the font directory and the icons will show you a preview, and you can arrow-key through the collection, deleting the ones you don't like.

Then I realised that with 6300 fonts - there are no quick solutions. Fr eg. you could type a line in each font in OOo - but you'd be typing 6300 lines! We can get a script to print sample text in each font, but you still have to go back and find and delete them pretty much one at a time. So - just using the icon-preview (make the icons bigger to see it properly) and the del key seems the most efficient overall.

But then - I don't know how your fonts are organized.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to send fax from computer JosephS Slackware 12 04-25-2010 11:28 AM
Postfix - send mail from one local computer to another local computer Runge_Kutta Linux - Software 3 01-09-2010 07:08 AM
[SOLVED] Postfix - I can send mail from my computer; but others can't send to me... djuhl30 Linux - Server 8 10-12-2009 02:34 PM
redirect printer output on computer 1(Win2000) to Computer 2(Ubuntu)via parallel port dmarkd Linux - Hardware 2 12-01-2008 03:51 AM
Send email from computer Awatto Linux - Newbie 1 12-17-2003 02:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration