Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 3 4 #ifndef tools_hershey 5 #define tools_hershey 6 7 ////////////////////////////////////////////////////////////////////////////// 8 // drawn fonts comming from CERNLIB ! A long story now. ////////////////////// 9 ////////////////////////////////////////////////////////////////////////////// 10 11 namespace tools { 12 13 class hershey { 14 private: 15 enum { 16 H_ROMAN = 1, 17 H_DIGIT = 2, 18 H_MATH = 3, 19 H_SPECIAL = 4, 20 H_GREEK = 5, 21 H_UPPER = 1, 22 H_LOWER = 2, 23 H_NBITMX = 30 24 }; 25 public: 26 27 static unsigned int max_poly() { return 8;} //font special reaches 8 28 static unsigned int max_point() {return 160;} // 40 * 4 29 30 static void special_char_points(char a_char,float a_scale, //input 31 int& a_number,int* a_mx_point, 32 float* aX,float* aY,float& a_width){ 33 // PAW special characters. 34 extract(H_SPECIAL,H_UPPER,a_char,a_scale,a_number,a_mx_point,aX,aY,a_width); 35 } 36 37 static void latin_char_points(char a_char,float a_scale, //input 38 int& a_number,int* a_mx_point, 39 float* aX,float* aY,float& a_width){ 40 41 // Latin correspondance with HPLSOF 42 // ABCDEFGHIJKLMNOPQRSTUVWXYZ done with H_ROMAN UPPER 43 // abcdefghijklmnopqrstuvwxyz done with H_ROMAN LOWER 44 // 0123456789 done with H_DIGIT 45 // .,/()-+=* done with H_MATH 46 // $!#>?:;<[]{}%& done with H_SPECIAL 47 48 switch(a_char) { 49 case 'A':extract(H_ROMAN,H_UPPER,'A',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 50 case 'B':extract(H_ROMAN,H_UPPER,'B',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 51 case 'C':extract(H_ROMAN,H_UPPER,'C',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 52 case 'D':extract(H_ROMAN,H_UPPER,'D',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 53 case 'E':extract(H_ROMAN,H_UPPER,'E',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 54 case 'F':extract(H_ROMAN,H_UPPER,'F',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 55 case 'G':extract(H_ROMAN,H_UPPER,'G',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 56 case 'H':extract(H_ROMAN,H_UPPER,'H',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 57 case 'I':extract(H_ROMAN,H_UPPER,'I',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 58 case 'J':extract(H_ROMAN,H_UPPER,'J',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 59 case 'K':extract(H_ROMAN,H_UPPER,'K',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 60 case 'L':extract(H_ROMAN,H_UPPER,'L',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 61 case 'M':extract(H_ROMAN,H_UPPER,'M',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 62 case 'N':extract(H_ROMAN,H_UPPER,'N',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 63 case 'O':extract(H_ROMAN,H_UPPER,'O',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 64 case 'P':extract(H_ROMAN,H_UPPER,'P',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 65 case 'Q':extract(H_ROMAN,H_UPPER,'Q',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 66 case 'R':extract(H_ROMAN,H_UPPER,'R',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 67 case 'S':extract(H_ROMAN,H_UPPER,'S',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 68 case 'T':extract(H_ROMAN,H_UPPER,'T',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 69 case 'U':extract(H_ROMAN,H_UPPER,'U',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 70 case 'V':extract(H_ROMAN,H_UPPER,'V',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 71 case 'W':extract(H_ROMAN,H_UPPER,'W',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 72 case 'X':extract(H_ROMAN,H_UPPER,'X',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 73 case 'Y':extract(H_ROMAN,H_UPPER,'Y',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 74 case 'Z':extract(H_ROMAN,H_UPPER,'Z',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 75 76 case 'a':extract(H_ROMAN,H_LOWER,'A',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 77 case 'b':extract(H_ROMAN,H_LOWER,'B',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 78 case 'c':extract(H_ROMAN,H_LOWER,'C',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 79 case 'd':extract(H_ROMAN,H_LOWER,'D',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 80 case 'e':extract(H_ROMAN,H_LOWER,'E',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 81 case 'f':extract(H_ROMAN,H_LOWER,'F',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 82 case 'g':extract(H_ROMAN,H_LOWER,'G',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 83 case 'h':extract(H_ROMAN,H_LOWER,'H',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 84 case 'i':extract(H_ROMAN,H_LOWER,'I',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 85 case 'j':extract(H_ROMAN,H_LOWER,'J',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 86 case 'k':extract(H_ROMAN,H_LOWER,'K',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 87 case 'l':extract(H_ROMAN,H_LOWER,'L',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 88 case 'm':extract(H_ROMAN,H_LOWER,'M',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 89 case 'n':extract(H_ROMAN,H_LOWER,'N',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 90 case 'o':extract(H_ROMAN,H_LOWER,'O',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 91 case 'p':extract(H_ROMAN,H_LOWER,'P',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 92 case 'q':extract(H_ROMAN,H_LOWER,'Q',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 93 case 'r':extract(H_ROMAN,H_LOWER,'R',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 94 case 's':extract(H_ROMAN,H_LOWER,'S',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 95 case 't':extract(H_ROMAN,H_LOWER,'T',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 96 case 'u':extract(H_ROMAN,H_LOWER,'U',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 97 case 'v':extract(H_ROMAN,H_LOWER,'V',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 98 case 'w':extract(H_ROMAN,H_LOWER,'W',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 99 case 'x':extract(H_ROMAN,H_LOWER,'X',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 100 case 'y':extract(H_ROMAN,H_LOWER,'Y',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 101 case 'z':extract(H_ROMAN,H_LOWER,'Z',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 102 103 case '0':extract(H_DIGIT,H_UPPER,'0',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 104 case '1':extract(H_DIGIT,H_UPPER,'1',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 105 case '2':extract(H_DIGIT,H_UPPER,'2',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 106 case '3':extract(H_DIGIT,H_UPPER,'3',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 107 case '4':extract(H_DIGIT,H_UPPER,'4',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 108 case '5':extract(H_DIGIT,H_UPPER,'5',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 109 case '6':extract(H_DIGIT,H_UPPER,'6',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 110 case '7':extract(H_DIGIT,H_UPPER,'7',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 111 case '8':extract(H_DIGIT,H_UPPER,'8',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 112 case '9':extract(H_DIGIT,H_UPPER,'9',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 113 114 case '.':extract(H_MATH,H_UPPER,'.',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 115 case ',':extract(H_MATH,H_UPPER,',',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 116 case '/':extract(H_MATH,H_UPPER,'/',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 117 case '(':extract(H_MATH,H_UPPER,'(',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 118 case ')':extract(H_MATH,H_UPPER,')',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 119 case '-':extract(H_MATH,H_UPPER,'-',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 120 case '+':extract(H_MATH,H_UPPER,'+',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 121 case '=':extract(H_MATH,H_UPPER,'=',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 122 case '*':extract(H_MATH,H_UPPER,'*',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 123 124 case '$':extract(H_SPECIAL,H_UPPER,'D',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 125 case '!':extract(H_SPECIAL,H_UPPER,'E',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 126 case '#':extract(H_SPECIAL,H_UPPER,'F',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 127 case '>':extract(H_SPECIAL,H_UPPER,'G',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 128 case '?':extract(H_SPECIAL,H_UPPER,'H',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 129 case ':':extract(H_SPECIAL,H_UPPER,'J',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 130 case ';':extract(H_SPECIAL,H_UPPER,'K',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 131 case '<':extract(H_SPECIAL,H_UPPER,'L',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 132 case '[':extract(H_SPECIAL,H_UPPER,'M',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 133 case ']':extract(H_SPECIAL,H_UPPER,'N',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 134 case '{':extract(H_SPECIAL,H_UPPER,'P',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 135 case '}':extract(H_SPECIAL,H_UPPER,'Q',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 136 case '%':extract(H_SPECIAL,H_UPPER,'Y',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 137 case '&':extract(H_SPECIAL,H_UPPER,'W',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 138 139 case '_': 140 a_number = 1; 141 a_mx_point[0] = 2; 142 aX[0] = 0; 143 aY[0] = 0; 144 aX[1] = a_scale; 145 aY[1] = 0; 146 a_width = a_scale; 147 break; 148 149 case ' ': 150 a_number = 0; 151 a_width = a_scale/2; 152 break; 153 154 default : 155 a_number = 0; 156 a_width = a_scale; 157 break; 158 } 159 } 160 161 static void greek_char_points(char a_char,float a_scale, //input 162 int& a_number,int* a_mx_point, 163 float* aX,float* aY,float& a_width){ 164 switch(a_char) { 165 case 'A':extract(H_GREEK,H_UPPER,'A',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 166 case 'B':extract(H_GREEK,H_UPPER,'B',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 167 case 'C':extract(H_GREEK,H_UPPER,'C',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 168 case 'D':extract(H_GREEK,H_UPPER,'D',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 169 case 'E':extract(H_GREEK,H_UPPER,'E',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 170 case 'F':extract(H_GREEK,H_UPPER,'F',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 171 case 'G':extract(H_GREEK,H_UPPER,'G',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 172 case 'H':extract(H_GREEK,H_UPPER,'H',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 173 case 'I':extract(H_GREEK,H_UPPER,'I',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 174 case 'J':extract(H_GREEK,H_UPPER,'J',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 175 case 'K':extract(H_GREEK,H_UPPER,'K',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 176 case 'L':extract(H_GREEK,H_UPPER,'L',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 177 case 'M':extract(H_GREEK,H_UPPER,'M',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 178 case 'N':extract(H_GREEK,H_UPPER,'N',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 179 case 'O':extract(H_GREEK,H_UPPER,'O',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 180 case 'P':extract(H_GREEK,H_UPPER,'P',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 181 case 'Q':extract(H_GREEK,H_UPPER,'Q',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 182 case 'R':extract(H_GREEK,H_UPPER,'R',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 183 case 'S':extract(H_GREEK,H_UPPER,'S',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 184 case 'T':extract(H_GREEK,H_UPPER,'T',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 185 case 'U':extract(H_GREEK,H_UPPER,'U',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 186 case 'V':extract(H_GREEK,H_UPPER,'V',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 187 case 'W':extract(H_GREEK,H_UPPER,'W',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 188 case 'X':extract(H_GREEK,H_UPPER,'X',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 189 case 'Y':extract(H_GREEK,H_UPPER,'Y',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 190 case 'Z':extract(H_GREEK,H_UPPER,'Z',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 191 192 case 'a':extract(H_GREEK,H_LOWER,'A',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 193 case 'b':extract(H_GREEK,H_LOWER,'B',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 194 case 'c':extract(H_GREEK,H_LOWER,'C',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 195 case 'd':extract(H_GREEK,H_LOWER,'D',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 196 case 'e':extract(H_GREEK,H_LOWER,'E',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 197 case 'f':extract(H_GREEK,H_LOWER,'F',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 198 case 'g':extract(H_GREEK,H_LOWER,'G',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 199 case 'h':extract(H_GREEK,H_LOWER,'H',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 200 case 'i':extract(H_GREEK,H_LOWER,'I',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 201 case 'j':extract(H_GREEK,H_LOWER,'J',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 202 case 'k':extract(H_GREEK,H_LOWER,'K',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 203 case 'l':extract(H_GREEK,H_LOWER,'L',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 204 case 'm':extract(H_GREEK,H_LOWER,'M',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 205 case 'n':extract(H_GREEK,H_LOWER,'N',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 206 case 'o':extract(H_GREEK,H_LOWER,'O',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 207 case 'p':extract(H_GREEK,H_LOWER,'P',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 208 case 'q':extract(H_GREEK,H_LOWER,'Q',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 209 case 'r':extract(H_GREEK,H_LOWER,'R',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 210 case 's':extract(H_GREEK,H_LOWER,'S',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 211 case 't':extract(H_GREEK,H_LOWER,'T',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 212 case 'u':extract(H_GREEK,H_LOWER,'U',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 213 case 'v':extract(H_GREEK,H_LOWER,'V',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 214 case 'w':extract(H_GREEK,H_LOWER,'W',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 215 case 'x':extract(H_GREEK,H_LOWER,'X',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 216 case 'y':extract(H_GREEK,H_LOWER,'Y',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 217 case 'z':extract(H_GREEK,H_LOWER,'Z',a_scale,a_number,a_mx_point,aX,aY,a_width);break; 218 219 default : latin_char_points(a_char,a_scale,a_number,a_mx_point,aX,aY,a_width);break; 220 } 221 } 222 223 private: 224 static void extract(int aType,int aCase,char aC,float a_scale, //input 225 int& aN,int* a_mx_point, 226 float* aX,float* aY,float& a_width){ 227 int count; 228 int npoly,ichr,iw,idif,ibit,kx,ky,iy0,ix0,dky,ipoint; 229 float scale,size; 230 float max_x; 231 232 ichr = 1; 233 if (aType==H_DIGIT) { 234 switch(aC) { 235 case '0':ichr= 1;break; 236 case '1':ichr= 2;break; 237 case '2':ichr= 3;break; 238 case '3':ichr= 4;break; 239 case '4':ichr= 5;break; 240 case '5':ichr= 6;break; 241 case '6':ichr= 7;break; 242 case '7':ichr= 8;break; 243 case '8':ichr= 9;break; 244 case '9':ichr=10;break; 245 } 246 } else if (aType==H_ROMAN) { 247 switch(aC) { 248 case 'A':ichr=11;break; 249 case 'B':ichr=12;break; 250 case 'C':ichr=13;break; 251 case 'D':ichr=14;break; 252 case 'E':ichr=15;break; 253 case 'F':ichr=16;break; 254 case 'G':ichr=17;break; 255 case 'H':ichr=18;break; 256 case 'I':ichr=19;break; 257 case 'J':ichr=20;break; 258 case 'K':ichr=21;break; 259 case 'L':ichr=22;break; 260 case 'M':ichr=23;break; 261 case 'N':ichr=24;break; 262 case 'O':ichr=25;break; 263 case 'P':ichr=26;break; 264 case 'Q':ichr=27;break; 265 case 'R':ichr=28;break; 266 case 'S':ichr=29;break; 267 case 'T':ichr=30;break; 268 case 'U':ichr=31;break; 269 case 'V':ichr=32;break; 270 case 'W':ichr=33;break; 271 case 'X':ichr=34;break; 272 case 'Y':ichr=35;break; 273 case 'Z':ichr=36;break; 274 } 275 } else if (aType==H_GREEK) { 276 switch(aC) { 277 case 'A':ichr=1 ;break; 278 case 'B':ichr=2 ;break; 279 case 'C':ichr=7 ;break; 280 case 'D':ichr=4 ;break; 281 case 'E':ichr=5 ;break; 282 case 'F':ichr=21;break; 283 case 'G':ichr=3 ;break; 284 case 'H':ichr=22;break; 285 case 'I':ichr=9 ;break; 286 case 'J':ichr=9 ;break; 287 case 'K':ichr=10;break; 288 case 'L':ichr=11;break; 289 case 'M':ichr=12;break; 290 case 'N':ichr=13;break; 291 case 'O':ichr=15;break; 292 case 'P':ichr=16;break; 293 case 'Q':ichr=8 ;break; 294 case 'R':ichr=17;break; 295 case 'S':ichr=18;break; 296 case 'T':ichr=19;break; 297 case 'U':ichr=20;break; 298 case 'V':ichr=22;break; 299 case 'W':ichr=24;break; 300 case 'X':ichr=14;break; 301 case 'Y':ichr=23;break; 302 case 'Z':ichr=6 ;break; 303 } 304 ichr += 36; 305 } else if (aType==H_SPECIAL) { 306 switch(aC) { 307 case 'A':ichr=61;break; 308 case 'B':ichr=62;break; 309 case 'C':ichr=63;break; 310 case 'D':ichr=64;break; 311 case 'E':ichr=65;break; 312 case 'F':ichr=66;break; 313 case 'G':ichr=67;break; 314 case 'H':ichr=68;break; 315 case 'I':ichr=69;break; 316 case 'J':ichr=70;break; 317 case 'K':ichr=71;break; 318 case 'L':ichr=72;break; 319 case 'M':ichr=73;break; 320 case 'N':ichr=74;break; 321 case 'O':ichr=75;break; 322 case 'P':ichr=76;break; 323 case 'Q':ichr=77;break; 324 case 'R':ichr=78;break; 325 case 'S':ichr=79;break; 326 case 'T':ichr=80;break; 327 case 'U':ichr=81;break; 328 case 'V':ichr=82;break; 329 case 'W':ichr=83;break; 330 case 'X':ichr=84;break; 331 case 'Y':ichr=85;break; 332 case 'Z':ichr=86;break; 333 case '0':ichr=87;break; 334 case '1':ichr=88;break; 335 case '2':ichr=89;break; 336 case '3':ichr=90;break; 337 case '4':ichr=91;break; 338 case '5':ichr=92;break; 339 case '6':ichr=93;break; 340 case '7':ichr=94;break; 341 case '8':ichr=95;break; 342 case '9':ichr=96;break; 343 } 344 } else if (aType==H_MATH) { 345 switch(aC) { 346 case '.':ichr= 97;break; 347 case ',':ichr= 98;break; 348 case '/':ichr= 99;break; 349 case '(':ichr=100;break; 350 case ')':ichr=101;break; 351 case '-':ichr=102;break; 352 case '+':ichr=103;break; 353 case '=':ichr=104;break; 354 case '*':ichr=105;break; 355 } 356 } 357 358 if (aCase==H_LOWER) ichr += 105; 359 360 // scale : 361 size = a_scale; 362 if(size<0.001) size = 0.25F; 363 iy0 = 9; 364 dky = 21; 365 if (aType==H_SPECIAL) rescale(ichr,iy0,dky); 366 scale = size/dky; 367 368 iw = hs(ichr-1) - 1; 369 kx = (hx(iw) % 64 ) - 32; 370 ky = (hy(iw) % 64 ) - 32; 371 ibit = 1; 372 idif = 1; 373 ix0 = kx; 374 // a character may be composed of many polylines : 375 npoly = 0; 376 ipoint = 0; 377 max_x = 0; 378 while(1) { 379 count = 0; 380 while(1) { 381 ibit += 6; 382 idif *= 64; 383 if(ibit>=H_NBITMX) { 384 ibit = 1; 385 idif = 1; 386 iw ++; 387 } 388 kx = ((hx(iw)/idif) % 64 ) - 32; 389 ky = ((hy(iw)/idif) % 64 ) - 32; 390 if(kx==31) break; 391 aX[ipoint] = scale * (kx - ix0); 392 aY[ipoint] = scale * (iy0 - ky); 393 if (aX[ipoint] > max_x) max_x = aX[ipoint]; 394 ipoint ++; 395 count ++; 396 } 397 // got one polyline : 398 a_mx_point[npoly] = count; 399 npoly ++; 400 if(ky==31) break; 401 } 402 aN = npoly; 403 a_width = max_x; 404 } 405 406 static void rescale(int aIchr,int& aIy0,int& aDky){ 407 int iw,ibit,idif,kx,ky,kymin,kymax; 408 409 iw = hs(aIchr-1) - 1; 410 kymin = 100; 411 kymax = -100; 412 ibit = 1; 413 idif = 1; 414 while(1) { 415 while(1) { 416 ibit += 6; 417 idif *= 64; 418 if(ibit>=H_NBITMX) { 419 ibit = 1; 420 idif = 1; 421 iw ++; 422 } 423 kx = ((hx(iw)/idif) % 64 ) - 32; 424 ky = ((hy(iw)/idif) % 64 ) - 32; 425 if(kx==31) break; 426 if(ky>kymax) kymax = ky; 427 if(ky<kymin) kymin = ky; 428 } 429 if(ky==31) break; 430 } 431 //output : 432 aIy0 = kymax; 433 aDky = 21; 434 if(kymin<kymax) { 435 aDky = kymax-kymin; 436 } 437 } 438 439 private: //data 440 static int hx(unsigned int a_index) { 441 static const int s_hx[751] = 442 {0x1969C7D6,0x217DC699,0x269E79A4,0x00FDF864,0x2185E716,0x0000003F, 443 0x1C6DA696,0x2696489E,0x27663966,0x0000003F,0x238266D6,0x269E79A5, 444 0x1A6DE864,0x00000FD9,0x3FA198D6,0x0003F8E3,0x1B69B956,0x279A485E, 445 0x1E8649A7,0x00FD969B,0x208A5996,0x1B69A6DD,0x2692181D,0x219269E7, 446 0x3F69B760,0x19FDD9D6,0x00000FE7,0x1A69B796,0x2692175B,0x229669E7, 447 0x1965A6DE,0x258DF71A,0x1E8A59A6,0x0000003F,0x208E5996,0x1965A71F, 448 0x2381F71A,0x239669A5,0x3F69B7A0,0x20FD8817,0x3F95BFE8,0x19FD9655, 449 0x279E6962,0x19FE2966,0x279E6962,0x3F662966,0x23967A16,0x1969B75F, 450 0x1F75B699,0x3FA27963,0x19FD9655,0x279A58E0,0x208E59A7,0x00000FD9, 451 0x1AFDA696,0x3F89AFE7,0x0003F9DA,0x1AFDA696,0x3F89AFE7,0x23967A16, 452 0x1969B75F,0x1F75B699,0x28A27963,0x00FE88FF,0x27FD9655,0x3F9D9FE7, 453 0x00FE081C,0x228E4918,0x1A6DC7A0,0x00000FDA,0x27FD9655,0x3F9DEFD9, 454 0x1AFDA696,0x00000FE6,0x18FD8614,0x3F828FE0,0x0003FA28,0x19FD9655, 455 0x3F9E7FE7,0x1969C795,0x1C699618,0x279A489E,0x249A7A28,0x0003F7A2, 456 0x19FD9655,0x279E6962,0x3F662966,0x1969C795,0x1C699618,0x279A489E, 457 0x249A7A28,0x2787F7A2,0x0000003F,0x19FD9655,0x279E6962,0x3F662966, 458 0x0003F9E0,0x1E8A59D6,0x1B69965B,0x279A58DD,0x1B7A2967,0x00000FD9, 459 0x19FE0818,0x00000FE7,0x1C699655,0x279A485F,0x00000FE7,0x28FE0617, 460 0x00000FE0,0x20FDB594,0x3F960FDB,0x0003F96A,0x27FE7656,0x00000FD9, 461 0x3F820617,0x0003F828,0x19FD99D6,0x3F9D9FE7,0x20FD8817,0x3F95BFE8, 462 0x19FD9655,0x279E6962,0x19FE2966,0x279E6962,0x3F662966,0x1AFDA696, 463 0x00000FE6,0x20FD8817,0x3FA18FE8,0x1AFDA696,0x3F89AFE7,0x0003F9DA, 464 0x19FD99D6,0x3F9D9FE7,0x27FD9655,0x3F9D9FE7,0x1969C795,0x1C699618, 465 0x279A489E,0x249A7A28,0x2377F7A2,0x0000003F,0x00FE081C,0x27FD9655, 466 0x3F9DEFD9,0x20FD8817,0x00000FE8,0x18FD8614,0x3F828FE0,0x0003FA28, 467 0x19FD9655,0x3F9E7FE7,0x1DFE7657,0x3F9D9FE3,0x1969C795,0x1C699618, 468 0x279A489E,0x249A7A28,0x0003F7A2,0x27FD9655,0x3F9D9FE7,0x19FD9655, 469 0x279E6962,0x3F662966,0x3F660657,0x2767F9D9,0x0000003F,0x19FE0818, 470 0x00000FE7,0x1B699657,0x2081F79D,0x259A79FF,0x3F8218A3,0x1EFE0816, 471 0x1A65969B,0x2696279B,0x229669E7,0x00000FDE,0x19FE7656,0x00000FE7, 472 0x17FE0815,0x1C6DA658,0x2696485F,0x00FE9A27,0x1969D656,0x217DC699, 473 0x269E79A4,0x0003F9E3,0x18FE0814,0x3FA18FE8,0x00FE081C,0x1A69E79A, 474 0x268A279E,0x3F7A28A6,0x22FDE796,0x26966FE2,0x1E8A59E7,0x1B69965B, 475 0x3F9E58DD,0x258DD6D9,0x229679E6,0x1A6596DE,0x0003F69B,0x20FE081B, 476 0x3F82181F,0x27FDA856,0x3FA1AFE0,0x0003F9D9,0x3F628614,0x1C6DA697, 477 0x2696489E,0x20824966,0x2181F83F,0x00000FE0,0x2AA68A54,0x23967A6A, 478 0x1D7A0862,0x228E4FDC,0x1B75E7E0,0x175965D9,0x0003F5D8,0x2181F81B, 479 0x207E0FE0,0x0003F821,0x2181F81B,0x1F821FE0,0x1F821860,0x0000003F, 480 0x3FA18A14,0x1EFDD759,0x3F91DFDE,0x0003F91D,0x23FE2899,0x3F8DCFE3, 481 0x0003F8DC,0x3F6E56D8,0x256FF95B,0x0000003F,0x1E7E0899,0x218607DE, 482 0x1F7E0FDF,0x218A2860,0x218A285D,0x3F81F7E0,0x1F82185F,0x2281F79E, 483 0x0000003F,0x22860799,0x1F7E0862,0x21860FE1,0x1F79E7E0,0x1F79E7E3, 484 0x3F821860,0x2181F7E1,0x1E8218A2,0x0000003F,0x3F81748F,0x20C3F816, 485 0x0000003F,0x1865C814,0x1F75B658,0x27920FE0,0x23967A28,0x1F83F821, 486 0x22860FDE,0x00FE27BF,0x1C79F814,0x1961865B,0x20FE071A,0x279648A1, 487 0x249A7A28,0x00000FE0,0x1769E814,0x299A283F,0x2079A5FF,0x208A6A7F, 488 0x0000003F,0x26922814,0x26A29A68,0x2387F864,0x1F863924,0x1F75C71D, 489 0x1869C7FF,0x1C6985D7,0x1F83F81E,0x22860FDE,0x00FE27BF,0x28A6AA93, 490 0x208A49A7,0x165D869E,0x207D85D6,0x1C7A0861,0x2379C6DB,0x2AAA99E5, 491 0x0000003F,0x27FE7655,0x00000FD9,0x1DFDA998,0x1A6DD79E,0x2485D6DA, 492 0x228A3FE6,0x259A6963,0x00000FE3,0x258E2815,0x2BAEAA67,0x23967A6A, 493 0x196DD7A2,0x16555597,0x1E75B657,0x00000FE0,0x1C71D7DC,0x248E17DD, 494 0x3F7E18E4,0x1E7BF75D,0x20FDF7FF,0x3F861FE0,0x238FF8A2,0x0000003F, 495 0x2491C71C,0x3F75DFDC,0x1F7FF79E,0x21FE083F,0x3F8A2FE1,0x0003F8E3, 496 0x2095B81B,0x20FDD83F,0x3F7E0FE3,0x0003F860,0x206E581B,0x20FE383F, 497 0x3F860FDD,0x0003F7E0,0x1A99C81A,0x2083F824,0x20FDA83F,0x3F920FDC, 498 0x0003F9A0,0x3F9A9993,0x17FE3A23,0x00000FE8,0x3F8A0798,0x20FE581B, 499 0x00000FE0,0x3F697693,0x18FDD61D,0x00000FE9,0x3F8A0798,0x20FE581B, 500 0x00000FE0,0x2181F81B,0x00FDF821,0x2181F81B,0x00000FE0,0x207E085B, 501 0x3F7E0861,0x00FD7A55,0x1E822919,0x2281E75D,0x00000FE4,0x2281E719, 502 0x1E8228E3,0x00000FDC,0x00FE95D3,0x17FE0813,0x00000FE9,0x17FE95D3, 503 0x00000FE9,0x1BFE0818,0x3F6E5FE5,0x1D75E81B,0x238E281E,0x0003F822, 504 0x3F82079B,0x2385F75B,0x3F8DD8A3,0x2385F75B,0x2183F863,0x1D7E18E3, 505 0x0000003F,0x21FE185B,0x0003F91C,0x207DD79B,0x1F8228E2,0x3F89EFDD, 506 0x1D7A089B,0x238A079D,0x3F75E822,0x1DFDF8DB,0x00000FE3,0x1F75D7DB, 507 0x1F8638E1,0x1F75D7FF,0x3F8638E1,0x1E8228DB,0x238A079D,0x3F7A08A3, 508 0x26FE6997,0x1B75F8A4,0x1F75B69A,0x00FE6922,0x1AFDA696,0x258E179C, 509 0x218E59A6,0x00FDA71E,0x1F8A4997,0x1B69A6DD,0x269227DD,0x0000003F, 510 0x26FE6997,0x1B75F8A4,0x1F75B69A,0x00FE6922,0x259A6697,0x1B75F8A4, 511 0x1F75B69A,0x00FE6922,0x2086395B,0x3F91DFE0,0x24966997,0x26FDD7E2, 512 0x1B75F8A4,0x1F75B69A,0x00FE6922,0x1BFDB6D7,0x2696381E,0x00000FE6, 513 0x208607DC,0x3F820FDF,0x218A181B,0x20861FE0,0x0003F71E,0x25FDB6D7, 514 0x3F99FFDB,0x00FE081C,0x15FD5551,0x207DD698,0x258E0FE0,0x3FAEBAA8, 515 0x1BFDB6D7,0x2696381E,0x00000FE6,0x1A6DD7D7,0x227DD6DA,0x269E79A4, 516 0x00FDF8A4,0x1AFDA696,0x258E179C,0x218E59A6,0x00FDA71E,0x26FE6997, 517 0x1B75F8A4,0x1F75B69A,0x00FE6922,0x1DFDD759,0x3F96281E,0x1F8A5998, 518 0x2379C6DC,0x229669A5,0x00FDB71F,0x2386081B,0x3F91DFE5,0x1E71B6D7, 519 0x26FE68E1,0x00000FE6,0x26FE0698,0x00000FE0,0x20FDC615,0x3F920FDC, 520 0x0003F928,0x26FE66D8,0x00000FDB,0x26FE0698,0x1969C7A0,0x0000003F, 521 0x1BFDB998,0x3F99BFE6,0x1A6DD7D6,0x1E71A659,0x289E58E0,0x238A17FF, 522 0x3FA279A5,0x1D7E18D7,0x3F65A6DC,0x269E7963,0x20FE08E5,0x24965922, 523 0x1C75F863,0x00000FDB,0x1D71A617,0x2086181F,0x209A7A3F,0x0003F75E, 524 0x1B75F897,0x1E71B69A,0x259648A0,0x1F7E08A4,0x3F9A48A0,0x1F8A4958, 525 0x3F85E75D,0x1C6DB761,0x3F96385E,0x1F7E0898,0x26FE68E0,0x1B6DC7E2, 526 0x228A179C,0x00FDE7E1,0x1C6985D6,0x3F69C75D,0x248A079C,0x3F8A59A6, 527 0x1B657595,0x1C6DB71C,0x248E17DD,0x239669A5,0x23860821,0x0003FA25, 528 0x1D75E81A,0x3F8E281E,0x27FD9757,0x1D7E3966,0x1F79CFDC,0x3F9238A1, 529 0x1E75B658,0x3F6A0FE6,0x1CFD7756,0x217DD6DB,0x259FF963,0x299E5924, 530 0x00000FEA,0x1B71D697,0x259A7FDA,0x3F69D823,0x1F7E0898,0x23FE68E0, 531 0x1F75D7A0,0x1E8BF922,0x2175B6DC,0x3F7A08A2,0x1B71E818,0x217DD71B, 532 0x259A6963,0x00FE08A4,0x23FDA795,0x17FE6964,0x00FE9719,0x1D71B6D7, 533 0x2696385F,0x208A4966,0x3F5DB71E,0x1B75FA57,0x1E71B69A,0x259648A0, 534 0x00FE18E4,0x18FDE856,0x00FE875A,0x1C6985D6,0x1D6DB75D,0x279A489F, 535 0x00000FE7,0x1865B755,0x1F71A658,0x28A27962,0x1E822926,0x00000FDB, 536 0x2375B657,0x27A3F9E5,0x3F6196E5,0x15FDC914,0x1B6DA616,0x1F75B69A, 537 0x29A26922,0x0000003F,0x1761A714,0x1D6D9617,0x207E0FDF,0x289E58E1, 538 0x00FE69E8,0x1BFE0818,0x3F95BFE5,0x00FE081E,0x209D9819,0x2066783F, 539 0x0000003F,0x22FDF7D9,0x24925FE2,0x1C7A3965,0x3F96475C,0x2596475C, 540 0x1C75F8A4,0x3F71D75C,0x21FE081E,0x21820FE1,0x0003F821,0x23FDE81B, 541 0x3F91DFE1,0x0003F91D,0x3F6E56D8,0x2386079C,0x21860823,0x21820FE3, 542 0x0003F821,0x279E6997,0x20862926,0x23FDD79F,0x1E7E0862,0x1A65969C, 543 0x00000FDA,0x2186081E,0x21820FE0,0x0003F821,0x2186081E,0x20821FE0, 544 0x00FE0861,0x3F95B958,0x1FFDE79B,0x3F8DEFDF,0x0003F8DE,0x22FE185B, 545 0x3F89DFE2,0x0003F89D,0x3F95B958,0x256FF95B,0x0000003F,0x1E79F85A, 546 0x1E7FF860,0x1EFE087F,0x1E82185F,0x1E7E1860,0x1EFE183F,0x1E821FDF, 547 0x00FE17DE,0x228A17DB,0x2287F7E0,0x22FE07FF,0x2281F7E1,0x2285F7E0, 548 0x22FDF83F,0x2281FFE1,0x00FDF862,0x3F81A5D5,0x20A7F819,0x0000003F, 549 0x217DE795,0x1657F8A2,0x1B69A658,0x269A58DD,0x3FAEAA27,0x1E7FFAD5, 550 0x3F86285F,0x20FE0818,0x3F860FDF,0x1F83F85F,0x1C7FF71E,0x248A183F, 551 0x20FE487F,0x1EFD869C,0x2483F61A,0x268BFA26,0x1D7A0FE8,0x1D7A0FDD, 552 0x238E283F,0x3F8E283F,0x20FE0818,0x3F820FE0,0x2183F7E0,0x20FE17FF, 553 0x2183F79F,0x2281EFE2,0x1B71E83F,0x2592283F,0x2281E73F,0x1C7A0FE4, 554 0x3F69965A,0x279A48A0,0x1E73F9A7,0x20FE48A0,0x1969B75E,0x20FDA618, 555 0x279A58E2,0x1BFE6A28,0x3F96381D,0x20FDF818,0x3F85FFE1,0x28A268E0, 556 0x27A27967,0x218E48E5,0x1B75C75F,0x196D9619,0x2075A618,0x0000003F, 557 0x218A391A,0x1D71C760,0x1E821860,0x2385F75D,0x00000FE4,0x23FE375B, 558 0x00000FDD,0x29AABAD7,0x1A761926,0x1A6175D8,0x299A485D,0x00FEBAEA, 559 0x24967A16,0x1C79F862,0x1961865B,0x217DE71B,0x289E5922,0x00000FE8, 560 0x1969C7D9,0x217DC699,0x269E79A4,0x00FDF864,0x2699A69A,0x00000FDA, 561 0x209D9819,0x0000003F,0x2681A81A,0x00000FE0,0x1D61E818,0x288E581B, 562 0x0003F822,0x239A3897,0x23963FE2,0x00FE56BF,0x1DFE081B,0x3F8E281E, 563 0x00FE281E,0x1D69D797,0x1D6DDFDE,0x00FE66FF,0x1DFE081B,0x3F8E281E, 564 0x00FE281E,0x2182085E,0x0003F821,0x2186081E,0x00000FE0,0x2182085E, 565 0x0003F821,0x00FDC91B,0x1F7E089D,0x0003F8A0,0x2186079C,0x0003F7A0, 566 0x00FE471A,0x1CFE081A,0x00000FE4,0x1CFE471A,0x00000FE4,0x1DFE081B, 567 0x3F763FE3}; 568 return s_hx[a_index]; 569 } 570 571 static int hy(unsigned int a_index) { 572 static const int s_hy[751] = 573 {0x1D61552A,0x29A68960,0x18760968,0x00FD4515,0x2951762A,0x0000003F, 574 0x1559866A,0x18595514,0x29A5F71A,0x0000003F,0x1C71452A,0x268E179D, 575 0x27A29A68,0x00000FE5,0x208A252A,0x0003FA54,0x1C75452A,0x2179C6DB, 576 0x29A689A3,0x00FE59E8,0x145155EA,0x2689D615,0x26A29A68,0x1C75F8A3, 577 0x3F89F75C,0x1482952A,0x00000FD4,0x195D552A,0x2079D71B,0x29A27962, 578 0x22967A29,0x1B71D7A0,0x145155D9,0x0000003F,0x2181E6EA,0x1A6DE821, 579 0x15514557,0x289606D7,0x3F9A8A69,0x14829529,0x3F8A2829,0x1482952A, 580 0x1A616554,0x1E81E75C,0x258A07DE,0x3FA69A27,0x1455766B,0x1C657554, 581 0x29A26921,0x3F926A29,0x1482952A,0x1C657554,0x29A26921,0x00000FE9, 582 0x14829529,0x2079E814,0x0003FA69,0x14829528,0x3F79E814,0x1455766B, 583 0x1C657554,0x29A26921,0x21926A29,0x00FE1860,0x1482952B,0x3F79E829, 584 0x00FE9524,0x289E4528,0x249E8A69,0x00000FE2,0x1482952A,0x3FA5D822, 585 0x29829527,0x00000FE9,0x1482952C,0x20A54829,0x0003FA54,0x1482952B, 586 0x3FA54829,0x195D552B,0x289A485C,0x249A8A69,0x155D9721,0x0003F514, 587 0x1482952A,0x1B616554,0x3F7DF79D,0x195D552B,0x289A485C,0x249A8A69, 588 0x155D9721,0x2B960514,0x0000003F,0x1482952A,0x1A616554,0x2079E75C, 589 0x0003FA5E,0x145155EA,0x1C6D95D5,0x238607DD,0x28A69A26,0x00000FE6, 590 0x14829528,0x00000FD4,0x289A352B,0x239A8A69,0x00000FD4,0x14829529, 591 0x00000FE9,0x1482952C,0x20A54829,0x0003FA54,0x1482952A,0x00000FE9, 592 0x20A5E529,0x0003F794,0x1482952A,0x3FA69814,0x14829529,0x3F8A2829, 593 0x1482952A,0x1A616554,0x1E81E75C,0x258A07DE,0x3FA69A27,0x14829527, 594 0x00000FD4,0x14829529,0x3FA69829,0x14829529,0x2079E814,0x0003FA69, 595 0x1482952A,0x3FA69814,0x1482952B,0x3F79E829,0x195D552B,0x289A485C, 596 0x249A8A69,0x155D9721,0x1E7A0514,0x0000003F,0x00FE9524,0x1482952A, 597 0x3FA5D822,0x14829529,0x00000FE9,0x1482952C,0x20A54829,0x0003FA54, 598 0x1482952B,0x3FA54829,0x1E814529,0x3FA6981E,0x195D552B,0x289A485C, 599 0x249A8A69,0x155D9721,0x0003F514,0x1482952B,0x3F514829,0x1482952A, 600 0x1B616554,0x3F7DF79D,0x20A5E529,0x29A60514,0x0000003F,0x14829528, 601 0x00000FD4,0x14557669,0x296D7554,0x14557660,0x3F6D7554,0x1982952A, 602 0x2281D6DA,0x228E4923,0x1969B760,0x00000FD9,0x2982952A,0x00000FD4, 603 0x1A82952B,0x2285F6DA,0x1F8628E3,0x00FDA69B,0x1E8A9A6A,0x145155DA, 604 0x2279A5D5,0x0003FA69,0x2082962C,0x3FA69820,0x00FF0424,0x2279E6A6, 605 0x228A69A2,0x3F69A79E,0x1082D42A,0x1961782D,0x145155D8,0x1C6D95D5, 606 0x208A07DD,0x1F79C6D9,0x29A268A0,0x24966A29,0x0003F9A5,0x27822525, 607 0x3F9E8A68,0x1083042B,0x2075D830,0x0003F8E3,0x3FA605EC,0x15598669, 608 0x18595514,0x227DD71A,0x28A689E0,0x00000FE7,0x124D246C,0x13450411, 609 0x2CA1C615,0x1851282E,0x2FB6BA24,0x2DBAFC30,0x0003FBEE,0x1C75C6E5, 610 0x29A2781B,0x0003F9E8,0x1C75C6E5,0x28A6881B,0x2DB2AA27,0x0000003F, 611 0x3FA605EC,0x10830427,0x20410830,0x0003FC30,0x10830427,0x20410830, 612 0x0003FC30,0x2085D668,0x269A08A2,0x0000003F,0x14491427,0x1D6D9616, 613 0x154D181F,0x1E71A617,0x289A48A0,0x20BEDAE9,0x289E58E1,0x30BEEB2A, 614 0x0000003F,0x14491427,0x1D6D9616,0x154D181F,0x1E71A617,0x289A48A0, 615 0x20BEDAE9,0x289E58E1,0x30BEEB2A,0x0000003F,0x209DB6F0,0x29220A5C, 616 0x0000003F,0x2179A5AC,0x259A6963,0x1E696823,0x269A58E1,0x278E08E5, 617 0x2A9E382A,0x00FEAAA0,0x165D972C,0x207595D6,0x1C82A962,0x175965D9, 618 0x258A0759,0x00000FEA,0x2075856C,0x20758560,0x2BA23820,0x2BA23820, 619 0x0000003F,0x269A58AC,0x1E7E18E5,0x1D7E07DE,0x1659765B,0x1F75B657, 620 0x1F79E7E0,0x269A58E1,0x278A08A5,0x2A9E282A,0x00FEAAA0,0x1B6DC76D, 621 0x289A379C,0x259E8A69,0x1B720863,0x155155D9,0x267DC657,0x27A29A68, 622 0x0000003F,0x1982766B,0x00000FE7,0x19826668,0x1C75D71A,0x1A69965A, 623 0x258E2819,0x228E59A6,0x00000FE2,0x2592382B,0x1F863925,0x1C6DB71D, 624 0x259648DD,0x1D7E18E4,0x1D71B6DC,0x00000FE0,0x217DD724,0x218E4923, 625 0x2071C75F,0x227A085F,0x1D823760,0x208DD823,0x217E089E,0x0000003F, 626 0x1C924724,0x208DD81C,0x237608DD,0x1D823760,0x208DD823,0x0003F8DD, 627 0x1A8E36A5,0x1D822760,0x208A0822,0x0003F8A0,0x2675D9A5,0x2381E8E0, 628 0x207A081E,0x0003F7A0,0x1E7A56A6,0x1A8206A5,0x2081E820,0x20960825, 629 0x0003F7A0,0x208A07AD,0x2082581B,0x00000FE0,0x206976A8,0x1881D61D, 630 0x00000FE9,0x208A07AD,0x2082581B,0x00000FE0,0x209A99A8,0x17823A23, 631 0x00000FE8,0x155155A5,0x00FDA657,0x28A689E5,0x00000FE7,0x27A29A25, 632 0x3FB6CAA8,0x00FF042B,0x19552427,0x2EAE789E,0x00000FF0,0x19552427, 633 0x2EAE789E,0x00000FF0,0x00FE082D,0x208295ED,0x00000FE0,0x2381D76D, 634 0x00000FE3,0x1D8266A8,0x3F8DD823,0x2179C6E5,0x1E863923,0x0003F6DC, 635 0x3F91B765,0x1C6DB725,0x3F92481E,0x1C6DB725,0x1F7E07DE,0x239248E0, 636 0x0000003F,0x1B8246E5,0x0003F861,0x1E79F6E5,0x2492385F,0x3F6DB823, 637 0x1E71B6E5,0x218E48E1,0x3F85F79F,0x1B8246E5,0x00000FDB,0x1F79C6E5, 638 0x1B6DC79F,0x248E07E0,0x3F7E08E4,0x208607A5,0x1E71B71E,0x3F9248E1, 639 0x1E8296EA,0x1E71B6DC,0x29A268E1,0x00FE6A29,0x1E829529,0x1E71B6DC, 640 0x29A268E1,0x00FE6A29,0x1B6DC7A9,0x268E179C,0x26A29A68,0x0000003F, 641 0x1E82952A,0x1E71B6DC,0x29A268E1,0x00FE6A29,0x1D7E1869,0x1E71B6DC, 642 0x29A268E1,0x00FE6A29,0x18554527,0x3F6DB829,0x2FBAB6EA,0x1E82FC30, 643 0x1E71B6DC,0x29A268E1,0x00FE6A29,0x1F82952A,0x1F71B6DC,0x00000FE9, 644 0x13515524,0x3FA5B814,0x13515525,0x2FB1B814,0x0003FC30,0x1B829528, 645 0x3FA61825,0x00FE9524,0x1F8296EF,0x1F71B6DC,0x1B71F829,0x3FA5F71B, 646 0x1F8296EA,0x1F71B6DC,0x00000FE9,0x2179C6EA,0x29A689A3,0x1E8639A8, 647 0x00FDB6DC,0x1E8306E9,0x1E71B6DC,0x29A268E1,0x00FE6A29,0x1E8306EA, 648 0x1E71B6DC,0x29A268E1,0x00FE6A29,0x218296E6,0x3F6DB71E,0x1B6DC7A9, 649 0x2286079C,0x29A26963,0x00FE6A29,0x29A25527,0x3F6DB829,0x29A256EA, 650 0x1B825A29,0x00000FE9,0x1B8296E8,0x00000FE9,0x1B8296EB,0x20A5B829, 651 0x0003FA5B,0x1B8296E9,0x00000FE9,0x1B8296E8,0x30C2FB69,0x0000003F, 652 0x1B8296E9,0x3FA6981B,0x2079C6EB,0x29A689A3,0x1B7A2968,0x1E71B6E0, 653 0x3FA69A26,0x1B5D552A,0x20C2889E,0x1B656514,0x1D81D75C,0x2796281E, 654 0x27A29A68,0x00000FE4,0x1B6DC7AA,0x2992075C,0x2981E6E0,0x0003FC2D, 655 0x1E71B6E9,0x29A27921,0x208E6A29,0x155D96DD,0x3F5D5514,0x1B6DC768, 656 0x2086079C,0x289A48A1,0x3F9A8A69,0x17595527,0x19819658,0x258E075B, 657 0x2FB6BA67,0x00FEEC30,0x1B6DD7EA,0x20A6279C,0x1B6DC7A2,0x3FC2581D, 658 0x1B6DD7EA,0x289A379C,0x23968A69,0x145586E0,0x1E6D8594,0x0003F8A0, 659 0x289A26E5,0x3F967A69,0x1C8296E9,0x2181C6DB,0x238A1821,0x3FA29A68, 660 0x16554528,0x3FA5B829,0x1F8306EB,0x28A699E4,0x226E08A6,0x27A69A26, 661 0x00000FE5,0x2685B6E9,0x2079B829,0x3FA689A3,0x17595528,0x19819658, 662 0x217DD6DA,0x238A08A2,0x2CAA89A4,0x3FC30BED,0x2179C6E9,0x29A689E4, 663 0x1D8239A8,0x00FDB6DC,0x1B8296EB,0x1E8299A1,0x00FDB6DC,0x289E4869, 664 0x239A8A69,0x1B6DC760,0x3FC2179C,0x1E71B6EB,0x29A27921,0x208E6A29, 665 0x00FDB71D,0x1E8296EA,0x00FDB6DC,0x1B6DD7EA,0x299E479C,0x1E8A6A29, 666 0x00000FDB,0x227DD72B,0x29A689E5,0x1D8239A8,0x2685D6DB,0x00000FF0, 667 0x2E75B6E9,0x1D6E0C30,0x3FC2EAE0,0x1F83052B,0x1E71B6DD,0x29A689A3, 668 0x1B7A39A8,0x0000003F,0x227DC6EB,0x28A69A25,0x28961825,0x22968A69, 669 0x00FDB71F,0x208266E8,0x3F9A6820,0x00FE56A2,0x18924627,0x2871CA20, 670 0x0000003F,0x1682A5A8,0x1B69A82A,0x1A65969B,0x208A179C,0x248A075C, 671 0x249669A5,0x3F9248E3,0x1B8206E3,0x24923820,0x0003F8E3,0x1A8256A6, 672 0x2079E825,0x0003F861,0x3F9A06A8,0x1C6DB725,0x1F8207DE,0x2492381E, 673 0x0003F8E3,0x176185E9,0x1D698596,0x178299E3,0x289A3759,0x28A29AAA, 674 0x00000FE9,0x1E7DF7A3,0x2492381E,0x0003F8E3,0x1E7DF7A3,0x2392481E, 675 0x00FE7963,0x3F9A06A8,0x1682A5A5,0x2059682A,0x0003FAAA,0x1682A5A5, 676 0x2059682A,0x0003FAAA,0x2085D668,0x269A08A2,0x0000003F,0x1A6175A5, 677 0x1A5E079C,0x1881F720,0x207DE71A,0x289A48A1,0x26824860,0x26922829, 678 0x00FEAA68,0x1A6175A6,0x1A5E079C,0x1881F720,0x207DE71A,0x289A48A1, 679 0x26824860,0x26922829,0x00FEAA68,0x2095D769,0x2652099D,0x0000003F, 680 0x145155EB,0x26A205D5,0x1865E8A4,0x1E6585D7,0x20A26922,0x29A20A28, 681 0x3FA29AAA,0x218216E8,0x20AA182A,0x186E0AAA,0x15620556,0x155986E0, 682 0x1B815620,0x1A81B659,0x196E06DA,0x1A6A06D9,0x1D71B81B,0x2075B820, 683 0x2075C6E0,0x3F81D6E0,0x1C8195E8,0x208E181E,0x2A9E0AA7,0x1582AAA0, 684 0x17560617,0x185D8818,0x1C75C660,0x1C75C660,0x1D71D760,0x2285E81D, 685 0x208A1822,0x208A285E,0x228A08A1,0x238228A1,0x27A289E6,0x238289E5, 686 0x27A289E6,0x288289E5,0x3FA289E8,0x2782A9E8,0x20AAA82A,0x239A8A27, 687 0x1B7608A2,0x155986DA,0x1A6D8595,0x228A075B,0x27A289A3,0x0000003F, 688 0x23860826,0x20863924,0x1B6DC79F,0x248E179C,0x00000FE4,0x1D823765, 689 0x00000FE3,0x218E6A2B,0x1D71C75E,0x238A17DE,0x1F8A3924,0x00FD869D, 690 0x238E282A,0x1C75E862,0x2281F75C,0x1E8628E3,0x1F75C71D,0x00000FE0, 691 0x1F71A667,0x279E6921,0x1C7E1926,0x00FD965A,0x1A9A66A6,0x00000FDA, 692 0x18924627,0x0000003F,0x20AA05A6,0x00000FD6,0x2175D5E8,0x1D8678E7, 693 0x0003F5DD,0x2281E769,0x2281E823,0x00FE0820,0x1E8266E5,0x2079D69D, 694 0x00FDD6DD,0x2281E769,0x2281E823,0x00FE0820,0x228256A5,0x208A39A3, 695 0x00FE3963,0x1B6DC723,0x0003F7DD,0x239248E3,0x00000FE3,0x238E4923, 696 0x0003F9E5,0x00FE56A5,0x2179C6A4,0x0003F963,0x2179C6A3,0x0003F963, 697 0x00FE0826,0x20824726,0x00000FE0,0x2281E7A6,0x00000FE2,0x1E823765, 698 0x3F89E822}; 699 return s_hy[a_index]; 700 } 701 static int hs(unsigned int a_index) { 702 static const int s_hs[210] = 703 { 1, 5, 7, 11, 15, 17, 21, 26, 28, 35, 40, 42, 47, 51, 55, 704 58, 60, 65, 67, 68, 71, 73, 75, 78, 80, 85, 88, 94, 98,103, 705 105,108,110,113,115,117,119,121,126,128,130,133,135,137,143, 706 144,146,148,151,153,155,160,162,165,168,170,174,179,181,185, 707 189,191,192,195,204,206,209,210,215,222,225,229,230,233,236, 708 239,248,257,260,267,273,278,288,296,298,304,311,319,325,329, 709 333,338,341,344,347,350,352,354,356,357,360,363,364,366,368, 710 370,373,374,376,380,382,385,388,390,394,397,401,405,409,413, 711 417,419,424,427,429,432,434,435,439,442,446,450,454,456,460, 712 462,465,467,470,472,475,477,482,489,493,498,502,507,511,517, 713 519,523,525,530,533,539,543,546,550,554,556,560,565,568,573, 714 578,580,581,584,591,594,597,598,602,608,611,614,615,618,621, 715 624,632,640,643,650,663,682,691,696,698,703,709,713,715,717, 716 719,722,725,728,731,734,736,738,740,741,743,745,746,748,750}; 717 return s_hs[a_index]; 718 } 719 720 721 722 }; 723 724 725 } 726 727 #endif