| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* ftpfr.c */ | 3 /* ftpfr.c */ |
| 4 /* */ | 4 /* */ |
| 5 /* FreeType API for accessing PFR-specific data (body). */ | 5 /* FreeType API for accessing PFR-specific data (body). */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 2002-2004, 2008, 2010, 2013 by */ | 7 /* Copyright 2002-2004, 2008, 2010, 2013, 2014 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 |
| 18 #include "../../include/ft2build.h" | 18 #include <ft2build.h> |
| 19 #include "../../include/freetype/internal/ftdebug.h" | 19 #include FT_INTERNAL_DEBUG_H |
| 20 | 20 |
| 21 #include "../../include/freetype/internal/ftobjs.h" | 21 #include FT_INTERNAL_OBJECTS_H |
| 22 #include "../../include/freetype/internal/services/svpfr.h" | 22 #include FT_SERVICE_PFR_H |
| 23 | 23 |
| 24 | 24 |
| 25 /* check the format */ | 25 /* check the format */ |
| 26 static FT_Service_PfrMetrics | 26 static FT_Service_PfrMetrics |
| 27 ft_pfr_check( FT_Face face ) | 27 ft_pfr_check( FT_Face face ) |
| 28 { | 28 { |
| 29 FT_Service_PfrMetrics service = NULL; | 29 FT_Service_PfrMetrics service = NULL; |
| 30 | 30 |
| 31 | 31 |
| 32 if ( face ) | 32 if ( face ) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 FT_UInt *aoutline_resolution, | 43 FT_UInt *aoutline_resolution, |
| 44 FT_UInt *ametrics_resolution, | 44 FT_UInt *ametrics_resolution, |
| 45 FT_Fixed *ametrics_x_scale, | 45 FT_Fixed *ametrics_x_scale, |
| 46 FT_Fixed *ametrics_y_scale ) | 46 FT_Fixed *ametrics_y_scale ) |
| 47 { | 47 { |
| 48 FT_Error error = FT_Err_Ok; | 48 FT_Error error = FT_Err_Ok; |
| 49 FT_Service_PfrMetrics service; | 49 FT_Service_PfrMetrics service; |
| 50 | 50 |
| 51 | 51 |
| 52 if ( !face ) | 52 if ( !face ) |
| 53 return FT_THROW( Invalid_Argument ); | 53 return FT_THROW( Invalid_Face_Handle ); |
| 54 | 54 |
| 55 service = ft_pfr_check( face ); | 55 service = ft_pfr_check( face ); |
| 56 if ( service ) | 56 if ( service ) |
| 57 { | 57 { |
| 58 error = service->get_metrics( face, | 58 error = service->get_metrics( face, |
| 59 aoutline_resolution, | 59 aoutline_resolution, |
| 60 ametrics_resolution, | 60 ametrics_resolution, |
| 61 ametrics_x_scale, | 61 ametrics_x_scale, |
| 62 ametrics_y_scale ); | 62 ametrics_y_scale ); |
| 63 } | 63 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 FT_Get_PFR_Kerning( FT_Face face, | 99 FT_Get_PFR_Kerning( FT_Face face, |
| 100 FT_UInt left, | 100 FT_UInt left, |
| 101 FT_UInt right, | 101 FT_UInt right, |
| 102 FT_Vector *avector ) | 102 FT_Vector *avector ) |
| 103 { | 103 { |
| 104 FT_Error error; | 104 FT_Error error; |
| 105 FT_Service_PfrMetrics service; | 105 FT_Service_PfrMetrics service; |
| 106 | 106 |
| 107 | 107 |
| 108 if ( !face ) | 108 if ( !face ) |
| 109 return FT_THROW( Invalid_Face_Handle ); |
| 110 |
| 111 if ( !avector ) |
| 109 return FT_THROW( Invalid_Argument ); | 112 return FT_THROW( Invalid_Argument ); |
| 110 | 113 |
| 111 service = ft_pfr_check( face ); | 114 service = ft_pfr_check( face ); |
| 112 if ( service ) | 115 if ( service ) |
| 113 error = service->get_kerning( face, left, right, avector ); | 116 error = service->get_kerning( face, left, right, avector ); |
| 114 else | 117 else |
| 115 error = FT_Get_Kerning( face, left, right, | 118 error = FT_Get_Kerning( face, left, right, |
| 116 FT_KERNING_UNSCALED, avector ); | 119 FT_KERNING_UNSCALED, avector ); |
| 117 | 120 |
| 118 return error; | 121 return error; |
| 119 } | 122 } |
| 120 | 123 |
| 121 | 124 |
| 122 /* documentation is in ftpfr.h */ | 125 /* documentation is in ftpfr.h */ |
| 123 | 126 |
| 124 FT_EXPORT_DEF( FT_Error ) | 127 FT_EXPORT_DEF( FT_Error ) |
| 125 FT_Get_PFR_Advance( FT_Face face, | 128 FT_Get_PFR_Advance( FT_Face face, |
| 126 FT_UInt gindex, | 129 FT_UInt gindex, |
| 127 FT_Pos *aadvance ) | 130 FT_Pos *aadvance ) |
| 128 { | 131 { |
| 129 FT_Error error; | 132 FT_Error error; |
| 130 FT_Service_PfrMetrics service; | 133 FT_Service_PfrMetrics service; |
| 131 | 134 |
| 132 | 135 |
| 136 if ( !face ) |
| 137 return FT_THROW( Invalid_Face_Handle ); |
| 138 |
| 139 if ( !aadvance ) |
| 140 return FT_THROW( Invalid_Argument ); |
| 141 |
| 133 service = ft_pfr_check( face ); | 142 service = ft_pfr_check( face ); |
| 134 if ( service ) | 143 if ( service ) |
| 135 { | |
| 136 error = service->get_advance( face, gindex, aadvance ); | 144 error = service->get_advance( face, gindex, aadvance ); |
| 137 } | |
| 138 else | 145 else |
| 139 /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */ | 146 /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */ |
| 140 error = FT_THROW( Invalid_Argument ); | 147 error = FT_THROW( Invalid_Argument ); |
| 141 | 148 |
| 142 return error; | 149 return error; |
| 143 } | 150 } |
| 144 | 151 |
| 145 | 152 |
| 146 /* END */ | 153 /* END */ |
| OLD | NEW |