OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* ttdriver.c */ | 3 /* ttdriver.c */ |
4 /* */ | 4 /* */ |
5 /* TrueType font driver implementation (body). */ | 5 /* TrueType font driver implementation (body). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 1996-2013 by */ | 7 /* Copyright 1996-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 | 18 |
19 #include "../../include/ft2build.h" | 19 #include <ft2build.h> |
20 #include "../../include/freetype/internal/ftdebug.h" | 20 #include FT_INTERNAL_DEBUG_H |
21 #include "../../include/freetype/internal/ftstream.h" | 21 #include FT_INTERNAL_STREAM_H |
22 #include "../../include/freetype/internal/sfnt.h" | 22 #include FT_INTERNAL_SFNT_H |
23 #include "../../include/freetype/internal/services/svxf86nm.h" | 23 #include FT_SERVICE_XFREE86_NAME_H |
24 | 24 |
25 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT | 25 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT |
26 #include "../../include/freetype/ftmm.h" | 26 #include FT_MULTIPLE_MASTERS_H |
27 #include "../../include/freetype/internal/services/svmm.h" | 27 #include FT_SERVICE_MULTIPLE_MASTERS_H |
28 #endif | 28 #endif |
29 | 29 |
30 #include "../../include/freetype/internal/services/svtteng.h" | 30 #include FT_SERVICE_TRUETYPE_ENGINE_H |
31 #include "../../include/freetype/internal/services/svttglyf.h" | 31 #include FT_SERVICE_TRUETYPE_GLYF_H |
32 #include "../../include/freetype/internal/services/svprop.h" | 32 #include FT_SERVICE_PROPERTIES_H |
33 #include "../../include/freetype/ftttdrv.h" | 33 #include FT_TRUETYPE_DRIVER_H |
34 | 34 |
35 #include "ttdriver.h" | 35 #include "ttdriver.h" |
36 #include "ttgload.h" | 36 #include "ttgload.h" |
37 #include "ttpload.h" | 37 #include "ttpload.h" |
38 | 38 |
39 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT | 39 #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT |
40 #include "ttgxvar.h" | 40 #include "ttgxvar.h" |
41 #endif | 41 #endif |
42 | 42 |
43 #include "tterrors.h" | 43 #include "tterrors.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 /* XXX: TODO: check for sbits */ | 208 /* XXX: TODO: check for sbits */ |
209 | 209 |
210 if ( flags & FT_LOAD_VERTICAL_LAYOUT ) | 210 if ( flags & FT_LOAD_VERTICAL_LAYOUT ) |
211 { | 211 { |
212 for ( nn = 0; nn < count; nn++ ) | 212 for ( nn = 0; nn < count; nn++ ) |
213 { | 213 { |
214 FT_Short tsb; | 214 FT_Short tsb; |
215 FT_UShort ah; | 215 FT_UShort ah; |
216 | 216 |
217 | 217 |
218 TT_Get_VMetrics( face, start + nn, &tsb, &ah ); | 218 /* since we don't need `tsb', we use zero for `yMax' parameter */ |
| 219 TT_Get_VMetrics( face, start + nn, 0, &tsb, &ah ); |
219 advances[nn] = ah; | 220 advances[nn] = ah; |
220 } | 221 } |
221 } | 222 } |
222 else | 223 else |
223 { | 224 { |
224 for ( nn = 0; nn < count; nn++ ) | 225 for ( nn = 0; nn < count; nn++ ) |
225 { | 226 { |
226 FT_Short lsb; | 227 FT_Short lsb; |
227 FT_UShort aw; | 228 FT_UShort aw; |
228 | 229 |
(...skipping 30 matching lines...) Expand all Loading... |
259 FT_Error error = FT_Err_Ok; | 260 FT_Error error = FT_Err_Ok; |
260 | 261 |
261 | 262 |
262 ttsize->strike_index = strike_index; | 263 ttsize->strike_index = strike_index; |
263 | 264 |
264 if ( FT_IS_SCALABLE( size->face ) ) | 265 if ( FT_IS_SCALABLE( size->face ) ) |
265 { | 266 { |
266 /* use the scaled metrics, even when tt_size_reset fails */ | 267 /* use the scaled metrics, even when tt_size_reset fails */ |
267 FT_Select_Metrics( size->face, strike_index ); | 268 FT_Select_Metrics( size->face, strike_index ); |
268 | 269 |
269 tt_size_reset( ttsize ); | 270 tt_size_reset( ttsize ); /* ignore return value */ |
270 } | 271 } |
271 else | 272 else |
272 { | 273 { |
273 SFNT_Service sfnt = (SFNT_Service) ttface->sfnt; | 274 SFNT_Service sfnt = (SFNT_Service) ttface->sfnt; |
274 FT_Size_Metrics* metrics = &size->metrics; | 275 FT_Size_Metrics* metrics = &size->metrics; |
275 | 276 |
276 | 277 |
277 error = sfnt->load_strike_metrics( ttface, strike_index, metrics ); | 278 error = sfnt->load_strike_metrics( ttface, strike_index, metrics ); |
278 if ( error ) | 279 if ( error ) |
279 ttsize->strike_index = 0xFFFFFFFFUL; | 280 ttsize->strike_index = 0xFFFFFFFFUL; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 FT_Error error; | 363 FT_Error error; |
363 | 364 |
364 | 365 |
365 if ( !slot ) | 366 if ( !slot ) |
366 return FT_THROW( Invalid_Slot_Handle ); | 367 return FT_THROW( Invalid_Slot_Handle ); |
367 | 368 |
368 if ( !size ) | 369 if ( !size ) |
369 return FT_THROW( Invalid_Size_Handle ); | 370 return FT_THROW( Invalid_Size_Handle ); |
370 | 371 |
371 if ( !face ) | 372 if ( !face ) |
372 return FT_THROW( Invalid_Argument ); | 373 return FT_THROW( Invalid_Face_Handle ); |
373 | 374 |
374 #ifdef FT_CONFIG_OPTION_INCREMENTAL | 375 #ifdef FT_CONFIG_OPTION_INCREMENTAL |
375 if ( glyph_index >= (FT_UInt)face->num_glyphs && | 376 if ( glyph_index >= (FT_UInt)face->num_glyphs && |
376 !face->internal->incremental_interface ) | 377 !face->internal->incremental_interface ) |
377 #else | 378 #else |
378 if ( glyph_index >= (FT_UInt)face->num_glyphs ) | 379 if ( glyph_index >= (FT_UInt)face->num_glyphs ) |
379 #endif | 380 #endif |
380 return FT_THROW( Invalid_Argument ); | 381 return FT_THROW( Invalid_Argument ); |
381 | 382 |
382 if ( load_flags & FT_LOAD_NO_HINTING ) | 383 if ( load_flags & FT_LOAD_NO_HINTING ) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 | 531 |
531 FT_DEFINE_DRIVER( | 532 FT_DEFINE_DRIVER( |
532 tt_driver_class, | 533 tt_driver_class, |
533 | 534 |
534 FT_MODULE_FONT_DRIVER | | 535 FT_MODULE_FONT_DRIVER | |
535 FT_MODULE_DRIVER_SCALABLE | | 536 FT_MODULE_DRIVER_SCALABLE | |
536 TT_HINTER_FLAG, | 537 TT_HINTER_FLAG, |
537 | 538 |
538 sizeof ( TT_DriverRec ), | 539 sizeof ( TT_DriverRec ), |
539 | 540 |
540 "truetype_xyq", /* driver name */ | 541 "truetype", /* driver name */ |
541 0x10000L, /* driver version == 1.0 */ | 542 0x10000L, /* driver version == 1.0 */ |
542 0x20000L, /* driver requires FreeType 2.0 or above */ | 543 0x20000L, /* driver requires FreeType 2.0 or above */ |
543 | 544 |
544 (void*)0, /* driver specific interface */ | 545 (void*)0, /* driver specific interface */ |
545 | 546 |
546 tt_driver_init, | 547 tt_driver_init, |
547 tt_driver_done, | 548 tt_driver_done, |
548 tt_get_interface, | 549 tt_get_interface, |
549 | 550 |
550 sizeof ( TT_FaceRec ), | 551 sizeof ( TT_FaceRec ), |
(...skipping 12 matching lines...) Expand all Loading... |
563 tt_get_kerning, | 564 tt_get_kerning, |
564 0, /* FT_Face_AttachFunc */ | 565 0, /* FT_Face_AttachFunc */ |
565 tt_get_advances, | 566 tt_get_advances, |
566 | 567 |
567 tt_size_request, | 568 tt_size_request, |
568 TT_SIZE_SELECT | 569 TT_SIZE_SELECT |
569 ) | 570 ) |
570 | 571 |
571 | 572 |
572 /* END */ | 573 /* END */ |
OLD | NEW |