Thread: HOWTO: Create your own ttf Font for *nix
i wanted install new font in *nix system (debian 6 - squeeze) and
helping brother recreate old dos font being used
in small 486 single board controller send messages led & lcd controllers
had several pushbuttons, , built in led or lcd displays messages.
486 dos single board not being produced, , being replaced a
newer single board computer. new sbc required display exact
same messages in exact same font............whoo hoo!! how going to
in *nix, because original character set using borland bgi
library write font directly display?
search of internet found blog:
http://stackoverflow.com/questions/3...etype-font-ttf
but, didn't quite work way expected. so, conjured own method.
detailed below. maybe give assist need.
software pre-installed:
1. autotrace-0.31.1 -- sourceforge download - used fontforge
2. fontforge -- via synaptic package managercode:gunzip autotrace-0.31.1.tar.gz tar xf autotrace-0.31.1.tar cd autotrace-0.31.1 ./configure make sudo make install
3. gbdfed -- via synaptic package manager
4. mspaint in wine
ref: http://ubuntuforums.org/showthread.p...mspaint&page=3
posting #30
5. codeweavers crossover 9 pro -- allow installing font editor in bottle , execute font editor
6. sib font editor -- internet download 30 day trial windows software
first thing done extract font.fnt file controller, , either decode file, or display it's contents.
1. copy controller.exe, font.fnt, egavga.bgi files *nix dos subdirectory
ie. ~/386_c/cdr/tc/ufc.exe
(the source modified lock in loop, displaying initial character set on laptop display
using original font.fnt file. no file decoding necessary. saved hours....)
2. in *nix run dosbox, , mount dos subdirectory. (mount c ~/386_c/cdr/tc on system)
3. set *nix computer's video 800x600 mode, characters large possible on display.
4. run controller.exe dosbox graphics displayed on screen in 800x600, , remain there can capture them.
5. use *nix screen capture characters ufcfont.png file. (bmp not available in screencapture)
6. open ufcfont.png file mspaint (in *nix) , zoom 800x, invert colors.
7. save file ufcfonti.bmp. (~/desktop/ufcfonti.bmp)
8. crop file in *nix using gimp, resave. (~/desktop/ufcfonti.bmp)
9. copy ~/desktop/ufcfonti.bmp ~/desktop/ufcfontir.bmp , use image create water level line
along determining number of pixels required create box size can contain each possible
character such positioned same scroll through characters.
10. once box size determined, mine 12x60 pixels, copy each character box of size, in a
second window running mspaint.
11. save each character 0x20.bmp, 0x22.bmp, 0x23.bmp.......
12. install sib font editor (win program) in *nix, in bottle named (sib_fe) in codeweavers crossover 9 pro.
13. run font_editor , create newdos.fon. import each character's bmp file. save complete font file.
14. install gbdfed in *nix , generate newdos.bdf file. (fontforge wouldn't load bdf file.......??,
there may other font software will/can use it. used backup possible parallel method
wasn't used....)
15. generate newdos.sfd file, , save file
16. start fontforge in *nix, , open newdos.fon font file.
17. double left click on character 0x21 open editor.
18. file, import /home/larry/bgi/fxxfonts/ufc_symbols/0x21.bmp
19. element, autotrace, close window. use autotrace parameters of: -corner-surround=1 -line-threshold=10
first font character loaded. copied 0x21 0x20 , deleted contents cntl z.
close edit window. can right click on character , delete font window.
if load wrong bmp file, load new 1 on background bmp image.
20. repeat step #17 until characters through 0x7f done.
had edit 1 bmp 'a' change 1 pixel white. (ref: 0x61a.bmp)
had manually edit degree character inside loop ccw, , outer loop cw, because of intersecting lines.
21. correct char errors manually, using function "add curve point".
activating view->show->almost horizontal/vertical lines makes work easier.
22. save newdos.sfc file future edits.
23. generate true type font: file->generate fonts , choose truetype format. here find character errors.
24. window, new metric see spacing s , correct left & right bearing metrics.
correct spacing ~230 versus 1000.
25. select imported characters, hold left shift & left click on every character in font, , set width
230 in metric window.
26. export newdos.ttf file.
27. install newdos.ttf file in debian 6.
(see ref's below on how install ttf font in *nix)
ref - additional fonts:
http://www.dafont.com/
needed info:
http://www.linuxjournal.com/content/...ng-fonts-linux
http://wiki.debian.org/fonts#adding_fonts
http://linuxandfriends.com/2009/07/2...ubuntu-debian/
zit zot!
lk
Forum The Ubuntu Forum Community Other Discussion and Support Tutorials HOWTO: Create your own ttf Font for *nix
Ubuntu
Comments
Post a Comment