LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-04-2008, 02:00 AM   #1
secretlydead
Member
 
Registered: Sep 2003
Location: Qingdao, China
Distribution: mandriva, slack, red flag
Posts: 249

Rep: Reputation: 31
convert true type fonts -> jpg's


How can I convert a bunch of true type fonts into a jpg file and call the file by the name of the character it displays.

For example, if we were doing this for roman characters:

the file a.jpg would contain the font for "a", and the file A.jpg would contain a pic for the letter "A"

(I want to do this for chinese characters.)
 
Old 02-04-2008, 04:26 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Presumably you want to run the method in a script so it will be automatic.

The actual picture is produced with image magic (CLI: convert)
http://www.imagemagick.org/script/convert.php

Note: jpeg is not a good format for characters as it can mess them up when it dithers the lines. Sharp lines do not render well. Suggest you use PNG and flatten it (remove the alpha channel) to save space. Especially if you are just deing B&W.
Code:
 convert -size 80x80 xc:white -font  Bookman-DemiItalic -pointsize 72 -draw "text 10,60 'A'" / A.png
 
Old 02-07-2008, 06:43 PM   #3
secretlydead
Member
 
Registered: Sep 2003
Location: Qingdao, China
Distribution: mandriva, slack, red flag
Posts: 249

Original Poster
Rep: Reputation: 31
if you're getting an "unable to read font" error, you should modify the file type-ghostscript.xml which may reside in /usr/lib/ImageMagick-6.3.2/config/

and fc-list lists all your installed fonts, although for ImageMagick to work, you don't need to have a font installed on your system - you only need it correctly identified in the type-ghostscript.xml config file.

also, 90 x 80 is a better size if you're generating chinese characters

Last edited by secretlydead; 02-07-2008 at 06:50 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
True Type fonts RobKirchoff Linux - Software 1 10-20-2005 10:02 AM
True Type Fonts denning Linux - General 3 02-24-2005 07:48 PM
true type fonts flump Linux - Software 2 08-25-2003 10:01 AM
True Type Fonts XPediTioN Slackware 15 08-07-2003 12:35 PM
true type fonts!!! bigjohn Linux - Software 1 10-29-2002 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:40 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