| OLD | NEW |
| (Empty) |
| 1 ------------------------------------------------------------------------------ | |
| 2 ot-sanitise - TTF/OTF font validator/transcoder | |
| 3 | |
| 4 Description: | |
| 5 ot-sanitise is a program which validates and/or transcodes a truetype or | |
| 6 opentype font file using the OTS library: | |
| 7 | |
| 8 transcoded_font = ValidateAndTranscode(original_font); | |
| 9 if (validation_error) | |
| 10 PrintErrorAndExit; | |
| 11 OutputToStdout(transcoded_font); | |
| 12 | |
| 13 Usage: | |
| 14 $ ./ot-sanitise ttf_or_otf_file [transcoded_file] | |
| 15 | |
| 16 Example: | |
| 17 $ ./ot-sanitise sample.otf transcoded_sample.otf | |
| 18 $ ./ot-sanitise malformed.ttf | |
| 19 WARNING at ots/src/ots.cc:158: bad range shift | |
| 20 ERROR at ots/src/ots.cc:199 (bool<unnamed>::do_ots_process(ots::OpenTypeFile*,
ots::OTSStream*, const uint8_t*, size_t)) | |
| 21 Failed to sanitise file! | |
| 22 $ | |
| 23 | |
| 24 ------------------------------------------------------------------------------ | |
| 25 idempotent - TTF/OTF font transcoder (for OTS debugging) | |
| 26 | |
| 27 Description: | |
| 28 idempotent is a program which validates and transcodes a truetype or opentype | |
| 29 font file using OTS. This tool transcodes the original font twice and then | |
| 30 verifies that the two transcoded fonts are identical: | |
| 31 | |
| 32 t1 = ValidateAndTranscode(original_font); | |
| 33 if (validation_error) | |
| 34 PrintErrorAndExit; | |
| 35 t2 = ValidateAndTranscode(t1); | |
| 36 if (validation_error) | |
| 37 PrintErrorAndExit; | |
| 38 if (t1 != t2) | |
| 39 PrintErrorAndExit; | |
| 40 | |
| 41 This tool is basically for OTS developers. | |
| 42 | |
| 43 Usage: | |
| 44 $ ./idempotent ttf_or_otf_file | |
| 45 | |
| 46 Example: | |
| 47 $ ./idempotent sample.otf | |
| 48 $ ./idempotent malformed.ttf | |
| 49 WARNING at ots/src/ots.cc:158: bad range shift | |
| 50 ERROR at ots/src/ots.cc:199 (bool<unnamed>::do_ots_process(ots::OpenTypeFile*,
ots::OTSStream*, const uint8_t*, size_t)) | |
| 51 Failed to sanitise file! | |
| 52 $ | |
| 53 | |
| 54 ------------------------------------------------------------------------------ | |
| 55 validator_checker - font validation checker | |
| 56 | |
| 57 Description: | |
| 58 validator_checker is a program which is intended to validate malformed fonts. | |
| 59 If the program detects that the font is invalid, it prints "OK" and returns | |
| 60 with 0 (success). If it coulndn't detect any errors, the program then opens | |
| 61 the transcoded font and renders some characters using FreeType2: | |
| 62 | |
| 63 transcoded_font = ValidateAndTranscode(malicious_font); | |
| 64 if (validation_error) | |
| 65 Print("OK"); | |
| 66 OpenAndRenderSomeCharacters(transcoded_font); # may cause SIGSEGV | |
| 67 Print("OK"); | |
| 68 | |
| 69 If SEGV doesn't raise inside FreeType2 library, the program prints "OK" and | |
| 70 returns with 0 as well. You should run this tool under the catchsegv or | |
| 71 valgrind command so that you can easily verify that all transformed fonts | |
| 72 don't crash the library (see the example below). | |
| 73 | |
| 74 Usage: | |
| 75 $ catchsegv ./validator_checker malicous_ttf_or_otf_file | |
| 76 | |
| 77 Example: | |
| 78 $ for f in malformed/*.ttf ; do catchsegv ./validator-checker "$f" ; done | |
| 79 OK: the malicious font was filtered: malformed/1.ttf | |
| 80 OK: the malicious font was filtered: malformed/2.ttf | |
| 81 OK: FreeType2 didn't crash: malformed/3.ttf | |
| 82 OK: the malicious font was filtered: malformed/4.ttf | |
| 83 $ | |
| 84 | |
| 85 ------------------------------------------------------------------------------ | |
| 86 perf - performance checker | |
| 87 | |
| 88 Description: | |
| 89 perf is a program which validates and transcodes a truetype or opentype font | |
| 90 file N times using OTS, then prints the elapsed time: | |
| 91 | |
| 92 for (N times) | |
| 93 ValidateAndTranscode(original_font); | |
| 94 Print(elapsed_time_in_us / N); | |
| 95 | |
| 96 Usage: | |
| 97 $ ./perf ttf_or_otf_file | |
| 98 | |
| 99 Example: | |
| 100 $ ./perf sample.ttf | |
| 101 903 [us] sample.ttf (139332 bytes, 154 [byte/us]) | |
| 102 $ ./perf sample-bold.otf | |
| 103 291 [us] sample-bold.otf (150652 bytes, 517 [byte/us]) | |
| 104 | |
| 105 ------------------------------------------------------------------------------ | |
| 106 side-by-side - font quality checker | |
| 107 | |
| 108 Description: | |
| 109 side-by-side is a program which renders some characters (ASCII, Latin-1, CJK) | |
| 110 using both original font and transcoded font and checks that the two rendering | |
| 111 results are exactly equal. | |
| 112 | |
| 113 The following Unicode characters are used during the test: | |
| 114 0x0020 - 0x007E // Basic Latin | |
| 115 0x00A1 - 0x017F // Latin-1 | |
| 116 0x1100 - 0x11FF // Hangul | |
| 117 0x3040 - 0x309F // Japanese HIRAGANA letters | |
| 118 0x3130 - 0x318F // Hangul | |
| 119 0x4E00 - 0x4F00 // CJK Kanji/Hanja | |
| 120 0xAC00 - 0xAD00 // Hangul | |
| 121 | |
| 122 This tool uses FreeType2 library. | |
| 123 Note: This tool doesn't check kerning (GPOS/kern) nor font substitution | |
| 124 (GSUB). These should be tested in Layout tests if necessary. | |
| 125 | |
| 126 Usage: | |
| 127 $ ./side-by-side ttf_or_otf_file | |
| 128 | |
| 129 Example: | |
| 130 $ ./side-by-side linux/kochi-gothic.ttf # no problem | |
| 131 $ ./side-by-side free/kredit1.ttf # this is known issue of OTS. | |
| 132 bitmap metrics doesn't match! (14, 57), (37, 45) | |
| 133 EXPECTED: | |
| 134 | |
| 135 +#######*. | |
| 136 +##########+ | |
| 137 .###+.#. .#. | |
| 138 *#* # #* | |
| 139 ##. # ## | |
| 140 ## # ## | |
| 141 ## # ## | |
| 142 ## #. ## | |
| 143 ##. #. .## | |
| 144 ##. #. .## | |
| 145 *#+ *+ +#* | |
| 146 *#+ *+ +#* | |
| 147 *#+ *+ +#* | |
| 148 *#+ *+ +#* | |
| 149 *#+ *+ *#* | |
| 150 *#+ ++ *#+ | |
| 151 +#* +* *#+ | |
| 152 +#* +* *#+ | |
| 153 +#* +* *#+ | |
| 154 +#* +* ##. | |
| 155 +#* +* ##. | |
| 156 .## .# ## | |
| 157 .## .# ## | |
| 158 .## .# ## | |
| 159 ## # ## | |
| 160 ## # ## | |
| 161 ## # .## | |
| 162 ## # .## | |
| 163 ## .#+ +#* | |
| 164 ## +######* | |
| 165 ##.+#######* | |
| 166 *##########* | |
| 167 +##########+ | |
| 168 #########* | |
| 169 .######## | |
| 170 +####+ | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 .*######* | |
| 178 +##*.*##### | |
| 179 .##+.#+ +# | |
| 180 *#* ## #+ | |
| 181 ##*### ## | |
| 182 ###### ## | |
| 183 ##+.##+ +## | |
| 184 ## ########## | |
| 185 ## +######### | |
| 186 ## +######## | |
| 187 *#. .########* | |
| 188 .#* #########. | |
| 189 +##########+ | |
| 190 +*######* | |
| 191 | |
| 192 ACTUAL: | |
| 193 | |
| 194 .*##*+ | |
| 195 +##+.##*. | |
| 196 .#* .##.+#* | |
| 197 *# ### *#+ | |
| 198 #*######+ .*#+ | |
| 199 #########*. +#*. | |
| 200 ###########* +#* | |
| 201 *############+ *#+ | |
| 202 +##############. .##. | |
| 203 *##############* +#* | |
| 204 +###############+ *#+ | |
| 205 *###############+ .*#+ | |
| 206 .###############*. +#*. | |
| 207 +###############* +#* | |
| 208 *###############+ *#+ | |
| 209 .*###############+ .*#+ | |
| 210 +###############*. +#* | |
| 211 +###############* ** | |
| 212 *###############+ #+ | |
| 213 .###############* ## | |
| 214 +############+ ## | |
| 215 +########* .## | |
| 216 .######. +### | |
| 217 +#####+ .*#..# | |
| 218 +#####* *###..# | |
| 219 *#####. +#######* | |
| 220 +#####+ .*########. | |
| 221 +#####* +#########* | |
| 222 *#####. +##########+ | |
| 223 +#####+ *#########*. | |
| 224 .#####* +##########+ | |
| 225 *#####. +##########* | |
| 226 +#####+ *#########*. | |
| 227 .#####* +##########+ | |
| 228 *#####+ +##########* | |
| 229 .#*++#+ *#########*. | |
| 230 .#+ ## +##########+ | |
| 231 ****###+.##########* | |
| 232 ##################. | |
| 233 ###+ *#########+ | |
| 234 ## +########* | |
| 235 *#+ *########. | |
| 236 ##.#######+ | |
| 237 +#######* | |
| 238 *###*. | |
| 239 | |
| 240 | |
| 241 Glyph mismatch! (file: free/kredit1.ttf, U+0021, 100pt)! | |
| 242 $ | |
| 243 ------------------------------------------------------------------------------ | |
| OLD | NEW |