OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2009 Red Hat, Inc. | 2 * Copyright © 2009 Red Hat, Inc. |
3 * Copyright © 2009 Keith Stribley | 3 * Copyright © 2009 Keith Stribley |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 { | 448 { |
449 /* Not found; allocate one. */ | 449 /* Not found; allocate one. */ |
450 if (FT_Init_FreeType (&library)) | 450 if (FT_Init_FreeType (&library)) |
451 return NULL; | 451 return NULL; |
452 | 452 |
453 if (!hb_atomic_ptr_cmpexch (&ft_library, NULL, library)) { | 453 if (!hb_atomic_ptr_cmpexch (&ft_library, NULL, library)) { |
454 FT_Done_FreeType (library); | 454 FT_Done_FreeType (library); |
455 goto retry; | 455 goto retry; |
456 } | 456 } |
457 | 457 |
458 #ifdef HAVE_ATEXIT | 458 #ifdef HB_USE_ATEXIT |
459 atexit (free_ft_library); /* First person registers atexit() callback. */ | 459 atexit (free_ft_library); /* First person registers atexit() callback. */ |
460 #endif | 460 #endif |
461 } | 461 } |
462 | 462 |
463 return library; | 463 return library; |
464 } | 464 } |
465 | 465 |
466 static void | 466 static void |
467 _release_blob (FT_Face ft_face) | 467 _release_blob (FT_Face ft_face) |
468 { | 468 { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 513 |
514 FT_Face | 514 FT_Face |
515 hb_ft_font_get_face (hb_font_t *font) | 515 hb_ft_font_get_face (hb_font_t *font) |
516 { | 516 { |
517 if (font->destroy == (hb_destroy_func_t) FT_Done_Face || | 517 if (font->destroy == (hb_destroy_func_t) FT_Done_Face || |
518 font->destroy == (hb_destroy_func_t) _do_nothing) | 518 font->destroy == (hb_destroy_func_t) _do_nothing) |
519 return (FT_Face) font->user_data; | 519 return (FT_Face) font->user_data; |
520 | 520 |
521 return NULL; | 521 return NULL; |
522 } | 522 } |
OLD | NEW |