comparison TOOLS/subfont-c/README @ 1676:1f3030b34f5c

Described encodings issues in more details.
author zybi
date Fri, 24 Aug 2001 10:05:46 +0000
parents 7336606415f2
children 1bf2c3dbc36e
comparison
equal deleted inserted replaced
1675:8ccac62ddfb7 1676:1f3030b34f5c
22 and user-supplied encodings (also multibyte) through custom encoding files. 22 and user-supplied encodings (also multibyte) through custom encoding files.
23 23
24 I prepared also Type 1 font `osd.pfb' for OSD characters based on bitmaps 24 I prepared also Type 1 font `osd.pfb' for OSD characters based on bitmaps
25 created by chass. 25 created by chass.
26 26
27 Subfont was tested with Korean fonts from truetype-fonts-ko-2.0-1k.noarch.rpm
28 I found on http://rpmfind.net/ and euc-kr encoding. Custom encoding file
29 for euc-kr was generated from charmap I found in /usr/share/i18n/charmaps/EUC-KR.gz
30 (glibc package). This should work with -unicode switch for mplayer
31 (though it is not Unicode encoding).
32 It took about 10 seconds to render over 8000 characters on P3 @ 600MHz.
33 27
28 Encodings:
29 ~~~~~~~~~~
30 You can get any encoding and any charset.
31 1. If you want 8-bit charset, which is known to libc, encoded either in 8-bit
32 or Unicode (like ISO-8859-*, KOI8-*):
33
34 Find correct encoding name using `iconv --list' (on RedHat) and use it.
35 For latin2 subtitles I would write:
36 ./subfont iso-8859-2 24 verdana.ttf
37 and for UTF-8 subtitles with latin2 charset:
38 ./subfont --unicode iso-8859-2 24 verdana.ttf
34 39
35 Custom encodings: 40 2. If you want encoding not known to libc or non 8-bit (like EUC-KR):
36 ~~~~~~~~~~~~~~~~~
37 For each character you want to render write the line consisting of:
38 hexadecimal Unicode character code,
39 followed by whitespace,
40 followed by hexadecimal number representing your encoding,
41 followed by new line character.
42 41
43 Example: to render a single letter `aogonek' (Unicode 0x0105) and encode 42 Create file describing your charset:
44 it using iso-8859-2 encoding (0xB1), your custom encoding file will consist 43
45 of a sigle line: 44 For each character you want to render write the line consisting of:
46 0105 B1 45 hexadecimal Unicode character code
46 followed by whitespace
47 followed by hexadecimal number representing your encoding
48 followed by new line character
49 or (for UTF-8 subtitles):
50 hexadecimal Unicode character code
51 followed by new line character.
52
53 Example:
54 To render a single letter `aogonek' (Unicode 0x0105) and encode
55 it using iso-8859-2 encoding (0xB1), your custom encoding file will consist
56 of a sigle line:
57 0105 B1
58
59 or to get unicode font.desc, write only:
60 0105
61
62 Subfont was tested with Korean fonts from truetype-fonts-ko-2.0-1k.noarch.rpm
63 I found on http://rpmfind.net/ and euc-kr encoding. Custom encoding file
64 for euc-kr was generated from charmap I found in /usr/share/i18n/charmaps/EUC-KR.gz
65 (glibc package). Simple script for this you will find in encodings directory.
66 This should work with -unicode switch for mplayer (though this is not Unicode).
67 It took about 10 seconds to render over 8000 characters on P3 @ 600MHz.
47 68
48 69
49 New font.desc format (proposal): 70 New font.desc format (proposal):
50 ~~~~~~~~~~~~~~~~~~~~~==========~ 71 ~~~~~~~~~~~~~~~~~~~~~==========~
51 Subfont will generate new font.desc format when compiled with NEW_DESC macro defined 72 Subfont will generate new font.desc format when compiled with NEW_DESC macro defined
77 Notes: 98 Notes:
78 ~~~~~~ 99 ~~~~~~
79 + Starting x position of each character and the bitmap width is aligned 100 + Starting x position of each character and the bitmap width is aligned
80 to multiple of 8 (required by mplayer). 101 to multiple of 8 (required by mplayer).
81 102
82 + Currently subfont won't work on big-endian systems. 103 + Currently subfont won't work on big-endian systems. I need help.
83 104
84 + My development platform is RedHat 7.1. FreeType versions tested are 105 + My development platform is RedHat 7.1. FreeType versions tested are
85 2.0.1 through 2.0.4. 106 2.0.1 through 2.0.4.
86 107
87 + FreeType library has a bug that makes subfont display some warning message 108 + FreeType library has a bug that makes subfont display some warning message