OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ttsubpix.c */ | 3 /* ttsubpix.c */ |
4 /* */ | 4 /* */ |
5 /* TrueType Subpixel Hinting. */ | 5 /* TrueType Subpixel Hinting. */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2010-2013 by */ | 7 /* Copyright 2010-2015 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 /* */ | 56 /* */ |
57 /* The rule structures could also use some enhancement to handle ranges. */ | 57 /* The rule structures could also use some enhancement to handle ranges. */ |
58 /* */ | 58 /* */ |
59 /* ****************** WORK IN PROGRESS ******************* */ | 59 /* ****************** WORK IN PROGRESS ******************* */ |
60 /* */ | 60 /* */ |
61 | 61 |
62 /* These are `classes' of fonts that can be grouped together and used in */ | 62 /* These are `classes' of fonts that can be grouped together and used in */ |
63 /* rules below. A blank entry "" is required at the end of these! */ | 63 /* rules below. A blank entry "" is required at the end of these! */ |
64 #define FAMILY_CLASS_RULES_SIZE 7 | 64 #define FAMILY_CLASS_RULES_SIZE 7 |
65 | 65 |
66 static const SPH_Font_Class FAMILY_CLASS_Rules | 66 static const SPH_Font_Class FAMILY_CLASS_Rules |
67 [FAMILY_CLASS_RULES_SIZE] = | 67 [FAMILY_CLASS_RULES_SIZE] = |
68 { | 68 { |
69 { "MS Legacy Fonts", | 69 { "MS Legacy Fonts", |
70 { "Aharoni", | 70 { "Aharoni", |
71 "Andale Mono", | 71 "Andale Mono", |
72 "Andalus", | 72 "Andalus", |
73 "Angsana New", | 73 "Angsana New", |
74 "AngsanaUPC", | 74 "AngsanaUPC", |
75 "Arabic Transparent", | 75 "Arabic Transparent", |
76 "Arial Black", | 76 "Arial Black", |
77 "Arial Narrow", | 77 "Arial Narrow", |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 /* Define this to force natural (i.e. not bitmap-compatible) widths. */ | 216 /* Define this to force natural (i.e. not bitmap-compatible) widths. */ |
217 /* The default leans strongly towards natural widths except for a few */ | 217 /* The default leans strongly towards natural widths except for a few */ |
218 /* legacy fonts where a selective combination produces nicer results. */ | 218 /* legacy fonts where a selective combination produces nicer results. */ |
219 /* #define FORCE_NATURAL_WIDTHS */ | 219 /* #define FORCE_NATURAL_WIDTHS */ |
220 | 220 |
221 | 221 |
222 /* Define `classes' of styles that can be grouped together and used in */ | 222 /* Define `classes' of styles that can be grouped together and used in */ |
223 /* rules below. A blank entry "" is required at the end of these! */ | 223 /* rules below. A blank entry "" is required at the end of these! */ |
224 #define STYLE_CLASS_RULES_SIZE 5 | 224 #define STYLE_CLASS_RULES_SIZE 5 |
225 | 225 |
226 const SPH_Font_Class STYLE_CLASS_Rules | 226 static const SPH_Font_Class STYLE_CLASS_Rules |
227 [STYLE_CLASS_RULES_SIZE] = | 227 [STYLE_CLASS_RULES_SIZE] = |
228 { | 228 { |
229 { "Regular Class", | 229 { "Regular Class", |
230 { "Regular", | 230 { "Regular", |
231 "Book", | 231 "Book", |
232 "Medium", | 232 "Medium", |
233 "Roman", | 233 "Roman", |
234 "Normal", | 234 "Normal", |
235 "", | 235 "", |
236 }, | 236 }, |
237 }, | 237 }, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 "Black", | 272 "Black", |
273 "", | 273 "", |
274 }, | 274 }, |
275 }, | 275 }, |
276 }; | 276 }; |
277 | 277 |
278 | 278 |
279 /* Force special legacy fixes for fonts. */ | 279 /* Force special legacy fixes for fonts. */ |
280 #define COMPATIBILITY_MODE_RULES_SIZE 1 | 280 #define COMPATIBILITY_MODE_RULES_SIZE 1 |
281 | 281 |
282 const SPH_TweakRule COMPATIBILITY_MODE_Rules | 282 static const SPH_TweakRule COMPATIBILITY_MODE_Rules |
283 [COMPATIBILITY_MODE_RULES_SIZE] = | 283 [COMPATIBILITY_MODE_RULES_SIZE] = |
284 { | 284 { |
285 { "Verdana Clones", 0, "", 0 }, | 285 { "Verdana Clones", 0, "", 0 }, |
286 }; | 286 }; |
287 | 287 |
288 | 288 |
289 /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */ | 289 /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */ |
290 #define PIXEL_HINTING_RULES_SIZE 2 | 290 #define PIXEL_HINTING_RULES_SIZE 2 |
291 | 291 |
292 const SPH_TweakRule PIXEL_HINTING_Rules | 292 static const SPH_TweakRule PIXEL_HINTING_Rules |
293 [PIXEL_HINTING_RULES_SIZE] = | 293 [PIXEL_HINTING_RULES_SIZE] = |
294 { | 294 { |
295 /* these characters are almost always safe */ | 295 /* these characters are almost always safe */ |
296 { "Courier New", 12, "Italic", 'z' }, | 296 { "Courier New", 12, "Italic", 'z' }, |
297 { "Courier New", 11, "Italic", 'z' }, | 297 { "Courier New", 11, "Italic", 'z' }, |
298 }; | 298 }; |
299 | 299 |
300 | 300 |
301 /* Subpixel hinting ignores SHPIX rules on X. Force SHPIX for these. */ | 301 /* Subpixel hinting ignores SHPIX rules on X. Force SHPIX for these. */ |
302 #define DO_SHPIX_RULES_SIZE 1 | 302 #define DO_SHPIX_RULES_SIZE 1 |
303 | 303 |
304 const SPH_TweakRule DO_SHPIX_Rules | 304 static const SPH_TweakRule DO_SHPIX_Rules |
305 [DO_SHPIX_RULES_SIZE] = | 305 [DO_SHPIX_RULES_SIZE] = |
306 { | 306 { |
307 { "-", 0, "", 0 }, | 307 { "-", 0, "", 0 }, |
308 }; | 308 }; |
309 | 309 |
310 | 310 |
311 /* Skip Y moves that start with a point that is not on a Y pixel */ | 311 /* Skip Y moves that start with a point that is not on a Y pixel */ |
312 /* boundary and don't move that point to a Y pixel boundary. */ | 312 /* boundary and don't move that point to a Y pixel boundary. */ |
313 #define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 4 | 313 #define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 4 |
314 | 314 |
315 const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules | 315 static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules |
316 [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] = | 316 [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] = |
317 { | 317 { |
318 /* fix vwxyz thinness*/ | 318 /* fix vwxyz thinness*/ |
319 { "Consolas", 0, "", 0 }, | 319 { "Consolas", 0, "", 0 }, |
320 /* Fix thin middle stems */ | 320 /* Fix thin middle stems */ |
321 { "Core MS Legacy Fonts", 0, "Regular", 0 }, | 321 { "Core MS Legacy Fonts", 0, "Regular", 0 }, |
322 /* Cyrillic small letter I */ | 322 /* Cyrillic small letter I */ |
323 { "Legacy Sans Fonts", 0, "", 0 }, | 323 { "Legacy Sans Fonts", 0, "", 0 }, |
324 /* Fix artifacts with some Regular & Bold */ | 324 /* Fix artifacts with some Regular & Bold */ |
325 { "Verdana Clones", 0, "", 0 }, | 325 { "Verdana Clones", 0, "", 0 }, |
326 }; | 326 }; |
327 | 327 |
328 | 328 |
329 #define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 | 329 #define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 |
330 | 330 |
331 const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions | 331 static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions |
332 [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] = | 332 [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] = |
333 { | 333 { |
334 /* Fixes < and > */ | 334 /* Fixes < and > */ |
335 { "Courier New", 0, "Regular", 0 }, | 335 { "Courier New", 0, "Regular", 0 }, |
336 }; | 336 }; |
337 | 337 |
338 | 338 |
339 /* Skip Y moves that start with a point that is not on a Y pixel */ | 339 /* Skip Y moves that start with a point that is not on a Y pixel */ |
340 /* boundary and don't move that point to a Y pixel boundary. */ | 340 /* boundary and don't move that point to a Y pixel boundary. */ |
341 #define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE 2 | 341 #define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE 2 |
342 | 342 |
343 const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules | 343 static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules |
344 [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] = | 344 [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] = |
345 { | 345 { |
346 /* Maintain thickness of diagonal in 'N' */ | 346 /* Maintain thickness of diagonal in 'N' */ |
347 { "Times New Roman", 0, "Regular/Bold Class", 'N' }, | 347 { "Times New Roman", 0, "Regular/Bold Class", 'N' }, |
348 { "Georgia", 0, "Regular/Bold Class", 'N' }, | 348 { "Georgia", 0, "Regular/Bold Class", 'N' }, |
349 }; | 349 }; |
350 | 350 |
351 | 351 |
352 /* Skip Y moves that move a point off a Y pixel boundary. */ | 352 /* Skip Y moves that move a point off a Y pixel boundary. */ |
353 #define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 1 | 353 #define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 1 |
354 | 354 |
355 const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules | 355 static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules |
356 [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] = | 356 [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] = |
357 { | 357 { |
358 { "-", 0, "", 0 }, | 358 { "-", 0, "", 0 }, |
359 }; | 359 }; |
360 | 360 |
361 | 361 |
362 #define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 | 362 #define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 |
363 | 363 |
364 const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions | 364 static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions |
365 [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] = | 365 [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] = |
366 { | 366 { |
367 { "-", 0, "", 0 }, | 367 { "-", 0, "", 0 }, |
368 }; | 368 }; |
369 | 369 |
370 | 370 |
371 /* Round moves that don't move a point to a Y pixel boundary. */ | 371 /* Round moves that don't move a point to a Y pixel boundary. */ |
372 #define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 2 | 372 #define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 2 |
373 | 373 |
374 const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules | 374 static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules |
375 [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] = | 375 [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] = |
376 { | 376 { |
377 /* Droid font instructions don't snap Y to pixels */ | 377 /* Droid font instructions don't snap Y to pixels */ |
378 { "Droid Sans", 0, "Regular/Italic Class", 0 }, | 378 { "Droid Sans", 0, "Regular/Italic Class", 0 }, |
379 { "Droid Sans Mono", 0, "", 0 }, | 379 { "Droid Sans Mono", 0, "", 0 }, |
380 }; | 380 }; |
381 | 381 |
382 | 382 |
383 #define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 | 383 #define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1 |
384 | 384 |
385 const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions | 385 static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions |
386 [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] = | 386 [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] = |
387 { | 387 { |
388 { "-", 0, "", 0 }, | 388 { "-", 0, "", 0 }, |
389 }; | 389 }; |
390 | 390 |
391 | 391 |
392 /* Allow a Direct_Move along X freedom vector if matched. */ | 392 /* Allow a Direct_Move along X freedom vector if matched. */ |
393 #define ALLOW_X_DMOVE_RULES_SIZE 1 | 393 #define ALLOW_X_DMOVE_RULES_SIZE 1 |
394 | 394 |
395 const SPH_TweakRule ALLOW_X_DMOVE_Rules | 395 static const SPH_TweakRule ALLOW_X_DMOVE_Rules |
396 [ALLOW_X_DMOVE_RULES_SIZE] = | 396 [ALLOW_X_DMOVE_RULES_SIZE] = |
397 { | 397 { |
398 /* Fixes vanishing diagonal in 4 */ | 398 /* Fixes vanishing diagonal in 4 */ |
399 { "Verdana", 0, "Regular", '4' }, | 399 { "Verdana", 0, "Regular", '4' }, |
400 }; | 400 }; |
401 | 401 |
402 | 402 |
403 /* Return MS rasterizer version 35 if matched. */ | 403 /* Return MS rasterizer version 35 if matched. */ |
404 #define RASTERIZER_35_RULES_SIZE 8 | 404 #define RASTERIZER_35_RULES_SIZE 8 |
405 | 405 |
406 const SPH_TweakRule RASTERIZER_35_Rules | 406 static const SPH_TweakRule RASTERIZER_35_Rules |
407 [RASTERIZER_35_RULES_SIZE] = | 407 [RASTERIZER_35_RULES_SIZE] = |
408 { | 408 { |
409 /* This seems to be the only way to make these look good */ | 409 /* This seems to be the only way to make these look good */ |
410 { "Times New Roman", 0, "Regular", 'i' }, | 410 { "Times New Roman", 0, "Regular", 'i' }, |
411 { "Times New Roman", 0, "Regular", 'j' }, | 411 { "Times New Roman", 0, "Regular", 'j' }, |
412 { "Times New Roman", 0, "Regular", 'm' }, | 412 { "Times New Roman", 0, "Regular", 'm' }, |
413 { "Times New Roman", 0, "Regular", 'r' }, | 413 { "Times New Roman", 0, "Regular", 'r' }, |
414 { "Times New Roman", 0, "Regular", 'a' }, | 414 { "Times New Roman", 0, "Regular", 'a' }, |
415 { "Times New Roman", 0, "Regular", 'n' }, | 415 { "Times New Roman", 0, "Regular", 'n' }, |
416 { "Times New Roman", 0, "Regular", 'p' }, | 416 { "Times New Roman", 0, "Regular", 'p' }, |
417 { "Times", 0, "", 0 }, | 417 { "Times", 0, "", 0 }, |
418 }; | 418 }; |
419 | 419 |
420 | 420 |
421 /* Don't round to the subpixel grid. Round to pixel grid. */ | 421 /* Don't round to the subpixel grid. Round to pixel grid. */ |
422 #define NORMAL_ROUND_RULES_SIZE 1 | 422 #define NORMAL_ROUND_RULES_SIZE 1 |
423 | 423 |
424 const SPH_TweakRule NORMAL_ROUND_Rules | 424 static const SPH_TweakRule NORMAL_ROUND_Rules |
425 [NORMAL_ROUND_RULES_SIZE] = | 425 [NORMAL_ROUND_RULES_SIZE] = |
426 { | 426 { |
427 /* Fix serif thickness for certain ppems */ | 427 /* Fix serif thickness for certain ppems */ |
428 /* Can probably be generalized somehow */ | 428 /* Can probably be generalized somehow */ |
429 { "Courier New", 0, "", 0 }, | 429 { "Courier New", 0, "", 0 }, |
430 }; | 430 }; |
431 | 431 |
432 | 432 |
433 /* Skip IUP instructions if matched. */ | 433 /* Skip IUP instructions if matched. */ |
434 #define SKIP_IUP_RULES_SIZE 1 | 434 #define SKIP_IUP_RULES_SIZE 1 |
435 | 435 |
436 const SPH_TweakRule SKIP_IUP_Rules | 436 static const SPH_TweakRule SKIP_IUP_Rules |
437 [SKIP_IUP_RULES_SIZE] = | 437 [SKIP_IUP_RULES_SIZE] = |
438 { | 438 { |
439 { "Arial", 13, "Regular", 'a' }, | 439 { "Arial", 13, "Regular", 'a' }, |
440 }; | 440 }; |
441 | 441 |
442 | 442 |
443 /* Skip MIAP Twilight hack if matched. */ | 443 /* Skip MIAP Twilight hack if matched. */ |
444 #define MIAP_HACK_RULES_SIZE 1 | 444 #define MIAP_HACK_RULES_SIZE 1 |
445 | 445 |
446 const SPH_TweakRule MIAP_HACK_Rules | 446 static const SPH_TweakRule MIAP_HACK_Rules |
447 [MIAP_HACK_RULES_SIZE] = | 447 [MIAP_HACK_RULES_SIZE] = |
448 { | 448 { |
449 { "Geneva", 12, "", 0 }, | 449 { "Geneva", 12, "", 0 }, |
450 }; | 450 }; |
451 | 451 |
452 | 452 |
453 /* Skip DELTAP instructions if matched. */ | 453 /* Skip DELTAP instructions if matched. */ |
454 #define ALWAYS_SKIP_DELTAP_RULES_SIZE 23 | 454 #define ALWAYS_SKIP_DELTAP_RULES_SIZE 23 |
455 | 455 |
456 const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules | 456 static const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules |
457 [ALWAYS_SKIP_DELTAP_RULES_SIZE] = | 457 [ALWAYS_SKIP_DELTAP_RULES_SIZE] = |
458 { | 458 { |
459 { "Georgia", 0, "Regular", 'k' }, | 459 { "Georgia", 0, "Regular", 'k' }, |
460 /* fix various problems with e in different versions */ | 460 /* fix various problems with e in different versions */ |
461 { "Trebuchet MS", 14, "Regular", 'e' }, | 461 { "Trebuchet MS", 14, "Regular", 'e' }, |
462 { "Trebuchet MS", 13, "Regular", 'e' }, | 462 { "Trebuchet MS", 13, "Regular", 'e' }, |
463 { "Trebuchet MS", 15, "Regular", 'e' }, | 463 { "Trebuchet MS", 15, "Regular", 'e' }, |
464 { "Trebuchet MS", 0, "Italic", 'v' }, | 464 { "Trebuchet MS", 0, "Italic", 'v' }, |
465 { "Trebuchet MS", 0, "Italic", 'w' }, | 465 { "Trebuchet MS", 0, "Italic", 'w' }, |
466 { "Trebuchet MS", 0, "Regular", 'Y' }, | 466 { "Trebuchet MS", 0, "Regular", 'Y' }, |
467 { "Arial", 11, "Regular", 's' }, | 467 { "Arial", 11, "Regular", 's' }, |
(...skipping 14 matching lines...) Expand all Loading... |
482 { "Arial", 35, "Bold", 's' }, | 482 { "Arial", 35, "Bold", 's' }, |
483 { "Arial", 36, "Bold", 's' }, | 483 { "Arial", 36, "Bold", 's' }, |
484 { "Arial", 25, "Regular", 's' }, | 484 { "Arial", 25, "Regular", 's' }, |
485 { "Arial", 26, "Regular", 's' }, | 485 { "Arial", 26, "Regular", 's' }, |
486 }; | 486 }; |
487 | 487 |
488 | 488 |
489 /* Always do DELTAP instructions if matched. */ | 489 /* Always do DELTAP instructions if matched. */ |
490 #define ALWAYS_DO_DELTAP_RULES_SIZE 1 | 490 #define ALWAYS_DO_DELTAP_RULES_SIZE 1 |
491 | 491 |
492 const SPH_TweakRule ALWAYS_DO_DELTAP_Rules | 492 static const SPH_TweakRule ALWAYS_DO_DELTAP_Rules |
493 [ALWAYS_DO_DELTAP_RULES_SIZE] = | 493 [ALWAYS_DO_DELTAP_RULES_SIZE] = |
494 { | 494 { |
495 { "-", 0, "", 0 }, | 495 { "-", 0, "", 0 }, |
496 }; | 496 }; |
497 | 497 |
498 | 498 |
499 /* Don't allow ALIGNRP after IUP. */ | 499 /* Don't allow ALIGNRP after IUP. */ |
500 #define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 1 | 500 #define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 1 |
501 | 501 |
502 static const SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules | 502 static const SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules |
503 [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] = | 503 [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] = |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 | 737 |
738 static const SPH_ScaleRule X_SCALING_Rules | 738 static const SPH_ScaleRule X_SCALING_Rules |
739 [X_SCALING_RULES_SIZE] = | 739 [X_SCALING_RULES_SIZE] = |
740 { | 740 { |
741 { "-", 0, "", 0, 1000 }, | 741 { "-", 0, "", 0, 1000 }, |
742 }; | 742 }; |
743 | 743 |
744 #endif /* FORCE_NATURAL_WIDTHS */ | 744 #endif /* FORCE_NATURAL_WIDTHS */ |
745 | 745 |
746 | 746 |
747 FT_LOCAL_DEF( FT_Bool ) | 747 static FT_Bool |
748 is_member_of_family_class( const FT_String* detected_font_name, | 748 is_member_of_family_class( const FT_String* detected_font_name, |
749 const FT_String* rule_font_name ) | 749 const FT_String* rule_font_name ) |
750 { | 750 { |
751 FT_UInt i, j; | 751 FT_UInt i, j; |
752 | 752 |
753 | 753 |
754 /* Does font name match rule family? */ | 754 /* Does font name match rule family? */ |
755 if ( strcmp( detected_font_name, rule_font_name ) == 0 ) | 755 if ( strcmp( detected_font_name, rule_font_name ) == 0 ) |
756 return TRUE; | 756 return TRUE; |
757 | 757 |
(...skipping 14 matching lines...) Expand all Loading... |
772 detected_font_name ) == 0 ) | 772 detected_font_name ) == 0 ) |
773 return TRUE; | 773 return TRUE; |
774 } | 774 } |
775 } | 775 } |
776 } | 776 } |
777 | 777 |
778 return FALSE; | 778 return FALSE; |
779 } | 779 } |
780 | 780 |
781 | 781 |
782 FT_LOCAL_DEF( FT_Bool ) | 782 static FT_Bool |
783 is_member_of_style_class( const FT_String* detected_font_style, | 783 is_member_of_style_class( const FT_String* detected_font_style, |
784 const FT_String* rule_font_style ) | 784 const FT_String* rule_font_style ) |
785 { | 785 { |
786 FT_UInt i, j; | 786 FT_UInt i, j; |
787 | 787 |
788 | 788 |
789 /* Does font style match rule style? */ | 789 /* Does font style match rule style? */ |
790 if ( strcmp( detected_font_style, rule_font_style ) == 0 ) | 790 if ( strcmp( detected_font_style, rule_font_style ) == 0 ) |
791 return TRUE; | 791 return TRUE; |
792 | 792 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 #define TWEAK_RULES_EXCEPTIONS( x ) \ | 896 #define TWEAK_RULES_EXCEPTIONS( x ) \ |
897 if ( sph_test_tweak( face, family, ppem, style, glyph_index, \ | 897 if ( sph_test_tweak( face, family, ppem, style, glyph_index, \ |
898 x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \ | 898 x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \ |
899 loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x; | 899 loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x; |
900 | 900 |
901 | 901 |
902 FT_LOCAL_DEF( void ) | 902 FT_LOCAL_DEF( void ) |
903 sph_set_tweaks( TT_Loader loader, | 903 sph_set_tweaks( TT_Loader loader, |
904 FT_UInt glyph_index ) | 904 FT_UInt glyph_index ) |
905 { | 905 { |
906 TT_Face face = (TT_Face)loader->face; | 906 TT_Face face = loader->face; |
907 FT_String* family = face->root.family_name; | 907 FT_String* family = face->root.family_name; |
908 int ppem = loader->size->metrics.x_ppem; | 908 FT_UInt ppem = loader->size->metrics.x_ppem; |
909 FT_String* style = face->root.style_name; | 909 FT_String* style = face->root.style_name; |
910 | 910 |
911 | 911 |
912 /* don't apply rules if style isn't set */ | 912 /* don't apply rules if style isn't set */ |
913 if ( !face->root.style_name ) | 913 if ( !face->root.style_name ) |
914 return; | 914 return; |
915 | 915 |
916 #ifdef SPH_DEBUG_MORE_VERBOSE | 916 #ifdef SPH_DEBUG_MORE_VERBOSE |
917 printf( "%s,%d,%s,%c=%d ", | 917 printf( "%s,%d,%s,%c=%d ", |
918 family, ppem, style, glyph_index, glyph_index ); | 918 family, ppem, style, glyph_index, glyph_index ); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 | 1002 |
1003 #else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | 1003 #else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
1004 | 1004 |
1005 /* ANSI C doesn't like empty source files */ | 1005 /* ANSI C doesn't like empty source files */ |
1006 typedef int _tt_subpix_dummy; | 1006 typedef int _tt_subpix_dummy; |
1007 | 1007 |
1008 #endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | 1008 #endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ |
1009 | 1009 |
1010 | 1010 |
1011 /* END */ | 1011 /* END */ |
OLD | NEW |