annotate TOOLS/subfont-c/README @ 17050:cd540846d052

Add support to get the list of files from a file containing one filename per line. Patch from devik (devik .at. cdi .dot. cz).
author albeu
date Sat, 26 Nov 2005 17:10:17 +0000
parents 1bf2c3dbc36e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1470
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
1 Usage:
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
2 ~~~~~~
1505
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
3 1. Make sure you have FreeType 2 installed.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
4 2. Get a TrueType or Type 1 font.
1607
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
5 3. Run ./configure from mplayer's root directory.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
6 4. Modify `runme' script for your encoding and font path.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
7 5. Type: ./runme
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
8 6. Copy *.raw and font.desc files to ~/.mplayer/font/
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
9 7. Run subfont alone to see more options.
1470
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
10
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
11
1505
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
12 About:
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
13 ~~~~~~
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
14 `subfont' program renders antialiased OSD and subtitle fonts for mplayer.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
15
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
16 What you get are bitmap and alpha *.raw files and a font.desc.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
17 What you need is TrueType, Type 1 or any other font supported by FreeType.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
18
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
19 Alpha channel is created using outline and Gaussian blur filters.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
20
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
21 ANY encoding is now supported! That is, all 8-bit encodings known by libc
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
22 and user-supplied encodings (also multibyte) through custom encoding files.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
23
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
24 I prepared also Type 1 font `osd.pfb' for OSD characters based on bitmaps
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
25 created by chass.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
26
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
27
1676
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
28 Encodings:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
29 ~~~~~~~~~~
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
30 You can get any encoding and any charset.
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
31 1. If you want 8-bit charset, which is known to libc, encoded either in 8-bit
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
32 or Unicode (like ISO-8859-*, KOI8-*):
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
33
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
34 Find correct encoding name using `iconv --list' (on RedHat) and use it.
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
35 For latin2 subtitles I would write:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
36 ./subfont iso-8859-2 24 verdana.ttf
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
37 and for UTF-8 subtitles with latin2 charset:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
38 ./subfont --unicode iso-8859-2 24 verdana.ttf
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
39
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
40 2. If you want encoding not known to libc or non 8-bit (like EUC-KR):
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
41
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
42 Create file describing your charset:
1505
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
43
1676
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
44 For each character you want to render write the line consisting of:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
45 hexadecimal Unicode character code
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
46 followed by whitespace
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
47 followed by hexadecimal number representing your encoding
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
48 followed by new line character
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
49 or (for UTF-8 subtitles):
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
50 hexadecimal Unicode character code
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
51 followed by new line character.
1505
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
52
1676
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
53 Example:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
54 To render a single letter `aogonek' (Unicode 0x0105) and encode
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
55 it using iso-8859-2 encoding (0xB1), your custom encoding file will consist
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
56 of a sigle line:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
57 0105 B1
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
58
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
59 or to get unicode font.desc, write only:
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
60 0105
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
61
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
62 Subfont was tested with Korean fonts from truetype-fonts-ko-2.0-1k.noarch.rpm
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
63 I found on http://rpmfind.net/ and euc-kr encoding. Custom encoding file
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
64 for euc-kr was generated from charmap I found in /usr/share/i18n/charmaps/EUC-KR.gz
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
65 (glibc package). Simple script for this you will find in encodings directory.
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
66 This should work with -unicode switch for mplayer (though this is not Unicode).
1f3030b34f5c Described encodings issues in more details.
zybi
parents: 1607
diff changeset
67 It took about 10 seconds to render over 8000 characters on P3 @ 600MHz.
1505
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
68
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
69
1607
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
70 New font.desc format (proposal):
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
71 ~~~~~~~~~~~~~~~~~~~~~==========~
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
72 Subfont will generate new font.desc format when compiled with NEW_DESC macro defined
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
73 (uncomment appropriate line in Makefile).
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
74
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
75 These changes are to make bitmaps smaller and processing faster.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
76
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
77 Changes to [info] section:
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
78 There is no `spacewidth'. It will not be useful.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
79 `height` is the distance from one baseline to the next.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
80 `ascender' is the distance from the baseline to the highest grid coordinate used to place the outline point.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
81 `descender' is the distance from the baseline to the lowest grid coordinate used to place the outline point.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
82 Note: upwards direction is positive.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
83 Read more: freetype-2.*/docs/glyphs/glyphs-3.html
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
84
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
85 Changes to [characters] section:
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
86 Bitmap start and bitmap end are replaced with:
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
87 bitmap start,
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
88 bitmap width,
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
89 bitmap height,
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
90 left bearing -- the horizontal distance from the current pen position to the bitmaps's left edge,
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
91 top bearing -- the vertical distance from the baseline to the bitmaps's top edge,
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
92 advance -- the horizontal distance the pen position must be incremented by after each glyph is rendered.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
93
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
94 To anderstand this you must think in verctorial coordinates.
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
95 Necessarily read freetype-2.*/docs/glyphs/glyphs-7.html about vectorial coordinates!
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
96
7336606415f2 Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents: 1505
diff changeset
97
1505
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
98 Notes:
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
99 ~~~~~~
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
100 + Starting x position of each character and the bitmap width is aligned
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
101 to multiple of 8 (required by mplayer).
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
102
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
103 + My development platform is RedHat 7.1. FreeType versions tested are
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
104 2.0.1 through 2.0.4.
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
105
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
106 + FreeType library has a bug that makes subfont display some warning message
842c29861e25 upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents: 1470
diff changeset
107 about Unicode charmap for osd.pfb.
1470
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
108
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
109
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
110 Author:
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
111 ~~~~~~~
2c7b0478db0c mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff changeset
112 Artur Zaprzala <zybi@fanthom.irc.pl>