Mercurial > mplayer.hg
annotate TOOLS/subfont-c/README @ 1607:7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
author | zybi |
---|---|
date | Tue, 21 Aug 2001 14:00:57 +0000 |
parents | 842c29861e25 |
children | 1f3030b34f5c |
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 Subfont was tested with Korean fonts from truetype-fonts-ko-2.0-1k.noarch.rpm |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
28 I found on http://rpmfind.net/ and euc-kr encoding. Custom encoding file |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
29 for euc-kr was generated from charmap I found in /usr/share/i18n/charmaps/EUC-KR.gz |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
30 (glibc package). This should work with -unicode switch for mplayer |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
31 (though it is not Unicode encoding). |
1607
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
32 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
|
33 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
34 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
35 Custom encodings: |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
36 ~~~~~~~~~~~~~~~~~ |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
37 For each character you want to render write the line consisting of: |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
38 hexadecimal Unicode character code, |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
39 followed by whitespace, |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
40 followed by hexadecimal number representing your encoding, |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
41 followed by new line character. |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
42 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
43 Example: to render a single letter `aogonek' (Unicode 0x0105) and encode |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
44 it using iso-8859-2 encoding (0xB1), your custom encoding file will consist |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
45 of a sigle line: |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
46 0105 B1 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
47 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
48 |
1607
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
49 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
|
50 ~~~~~~~~~~~~~~~~~~~~~==========~ |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
51 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
|
52 (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
|
53 |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
54 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
|
55 |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
56 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
|
57 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
|
58 `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
|
59 `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
|
60 `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
|
61 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
|
62 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
|
63 |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
64 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
|
65 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
|
66 bitmap start, |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
67 bitmap width, |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
68 bitmap height, |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
69 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
|
70 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
|
71 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
|
72 |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
73 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
|
74 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
|
75 |
7336606415f2
Implemented new Gaussian blur algorithm, extended font.desc format, optimized for speed and memory usage.
zybi
parents:
1505
diff
changeset
|
76 |
1505
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
77 Notes: |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
78 ~~~~~~ |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
79 + 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
|
80 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
|
81 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
82 + Currently subfont won't work on big-endian systems. |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
83 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
84 + 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
|
85 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
|
86 |
842c29861e25
upgraded to 1.0b version by Artur Zaprzala <artur.zaprzala@talex.com.pl>
arpi
parents:
1470
diff
changeset
|
87 + 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
|
88 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
|
89 |
2c7b0478db0c
mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff
changeset
|
90 |
2c7b0478db0c
mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff
changeset
|
91 Author: |
2c7b0478db0c
mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff
changeset
|
92 ~~~~~~~ |
2c7b0478db0c
mplayer font-generator using FreeType 2.x by Artur Zaprzala <zybi@fanthom.irc.pl>
arpi
parents:
diff
changeset
|
93 Artur Zaprzala <zybi@fanthom.irc.pl> |