| 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 * Copyright © 2015 Google, Inc. | 4 * Copyright © 2015 Google, Inc. |
| 5 * | 5 * |
| 6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
| 7 * | 7 * |
| 8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
| 9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
| 10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "hb-private.hh" | 30 #include "hb-private.hh" |
| 31 | 31 |
| 32 #include "hb-ft.h" | 32 #include "hb-ft.h" |
| 33 | 33 |
| 34 #include "hb-font-private.hh" | 34 #include "hb-font-private.hh" |
| 35 | 35 |
| 36 #include "hb-cache-private.hh" // Maybe use in the future? | 36 #include "hb-cache-private.hh" // Maybe use in the future? |
| 37 | 37 |
| 38 #include FT_ADVANCES_H | 38 #include FT_ADVANCES_H |
| 39 #include FT_MULTIPLE_MASTERS_H |
| 39 #include FT_TRUETYPE_TABLES_H | 40 #include FT_TRUETYPE_TABLES_H |
| 40 | 41 |
| 41 | 42 |
| 42 | 43 |
| 43 #ifndef HB_DEBUG_FT | 44 #ifndef HB_DEBUG_FT |
| 44 #define HB_DEBUG_FT (HB_DEBUG+0) | 45 #define HB_DEBUG_FT (HB_DEBUG+0) |
| 45 #endif | 46 #endif |
| 46 | 47 |
| 47 | 48 |
| 48 /* TODO: | 49 /* TODO: |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 _hb_ft_font_set_funcs (font, ft_face, false); | 610 _hb_ft_font_set_funcs (font, ft_face, false); |
| 610 hb_font_set_scale (font, | 611 hb_font_set_scale (font, |
| 611 (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64
_t) ft_face->units_per_EM + (1u<<15)) >> 16), | 612 (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64
_t) ft_face->units_per_EM + (1u<<15)) >> 16), |
| 612 (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64
_t) ft_face->units_per_EM + (1u<<15)) >> 16)); | 613 (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64
_t) ft_face->units_per_EM + (1u<<15)) >> 16)); |
| 613 #if 0 /* hb-ft works in no-hinting model */ | 614 #if 0 /* hb-ft works in no-hinting model */ |
| 614 hb_font_set_ppem (font, | 615 hb_font_set_ppem (font, |
| 615 ft_face->size->metrics.x_ppem, | 616 ft_face->size->metrics.x_ppem, |
| 616 ft_face->size->metrics.y_ppem); | 617 ft_face->size->metrics.y_ppem); |
| 617 #endif | 618 #endif |
| 618 | 619 |
| 620 #ifdef HAVE_FT_GET_VAR_BLEND_COORDINATES |
| 621 FT_MM_Var *mm_var = NULL; |
| 622 if (!FT_Get_MM_Var (ft_face, &mm_var)) |
| 623 { |
| 624 FT_Fixed coords[mm_var->num_axis]; |
| 625 int hbCoords[mm_var->num_axis]; |
| 626 if (!FT_Get_Var_Blend_Coordinates (ft_face, mm_var->num_axis, coords)) |
| 627 { |
| 628 for (int i = 0; i < mm_var->num_axis; ++i) |
| 629 hbCoords[i] = coords[i] >> 2; |
| 630 |
| 631 hb_font_set_var_coords_normalized (font, hbCoords, mm_var->num_axis); |
| 632 } |
| 633 } |
| 634 free (mm_var); |
| 635 #endif |
| 636 |
| 619 return font; | 637 return font; |
| 620 } | 638 } |
| 621 | 639 |
| 622 /** | 640 /** |
| 623 * hb_ft_font_create_referenced: | 641 * hb_ft_font_create_referenced: |
| 624 * @ft_face: | 642 * @ft_face: |
| 625 * | 643 * |
| 626 * | 644 * |
| 627 * | 645 * |
| 628 * Return value: (transfer full): | 646 * Return value: (transfer full): |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 0, font->y_scale < 0 ? -1 : +1}; | 735 0, font->y_scale < 0 ? -1 : +1}; |
| 718 FT_Set_Transform (ft_face, &matrix, NULL); | 736 FT_Set_Transform (ft_face, &matrix, NULL); |
| 719 } | 737 } |
| 720 | 738 |
| 721 ft_face->generic.data = blob; | 739 ft_face->generic.data = blob; |
| 722 ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob; | 740 ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob; |
| 723 | 741 |
| 724 _hb_ft_font_set_funcs (font, ft_face, true); | 742 _hb_ft_font_set_funcs (font, ft_face, true); |
| 725 hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); | 743 hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); |
| 726 } | 744 } |
| OLD | NEW |