4 |
/* */ |
/* */ |
5 |
/* The FreeType private base classes (body). */ |
/* The FreeType private base classes (body). */ |
6 |
/* */ |
/* */ |
7 |
/* Copyright 1996-2001, 2002, 2003, 2004 by */ |
/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ |
8 |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 |
/* */ |
/* */ |
10 |
/* This file is part of the FreeType project, and may only be used, */ |
/* This file is part of the FreeType project, and may only be used, */ |
68 |
valid->base = base; |
valid->base = base; |
69 |
valid->limit = limit; |
valid->limit = limit; |
70 |
valid->level = level; |
valid->level = level; |
71 |
valid->error = 0; |
valid->error = FT_Err_Ok; |
72 |
} |
} |
73 |
|
|
74 |
|
|
817 |
* when found. Otherwise, a 16-bit one is returned when found. |
* when found. Otherwise, a 16-bit one is returned when found. |
818 |
*/ |
*/ |
819 |
|
|
820 |
/* since the `interesting' table, with id's 3,10, is normally the */ |
/* Since the `interesting' table, with IDs (3,10), is normally the */ |
821 |
/* last one, we loop backwards. This looses with type1 fonts with */ |
/* last one, we loop backwards. This looses with type1 fonts with */ |
822 |
/* non-BMP characters (<.0001%), this wins with .ttf with non-BMP */ |
/* non-BMP characters (<.0001%), this wins with .ttf with non-BMP */ |
823 |
/* chars (.01% ?), and this is the same about 99.99% of the time! */ |
/* chars (.01% ?), and this is the same about 99.99% of the time! */ |
824 |
|
|
825 |
cur = first + face->num_charmaps; /* points after the last one */ |
cur = first + face->num_charmaps; /* points after the last one */ |
826 |
|
|
837 |
( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && |
( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE && |
838 |
cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) |
cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ) |
839 |
|
|
840 |
/* Hurray! We found a UCS-4 charmap. We can stop the scan! */ |
/* Hurray! We found a UCS-4 charmap. We can stop the scan! */ |
841 |
{ |
{ |
842 |
face->charmap = cur[0]; |
face->charmap = cur[0]; |
843 |
return 0; |
return 0; |
845 |
} |
} |
846 |
} |
} |
847 |
|
|
848 |
/* We do not have any UCS-4 charmap. Sigh. */ |
/* We do not have any UCS-4 charmap. Sigh. */ |
849 |
/* Let's see if we have some other kind of Unicode charmap, though. */ |
/* Let's see if we have some other kind of Unicode charmap, though. */ |
850 |
if ( unicmap != NULL ) |
if ( unicmap != NULL ) |
851 |
{ |
{ |
852 |
face->charmap = unicmap[0]; |
face->charmap = unicmap[0]; |
2270 |
FT_CharMap charmap, |
FT_CharMap charmap, |
2271 |
FT_CMap *acmap ) |
FT_CMap *acmap ) |
2272 |
{ |
{ |
2273 |
FT_Error error = 0; |
FT_Error error = FT_Err_Ok; |
2274 |
FT_Face face; |
FT_Face face; |
2275 |
FT_Memory memory; |
FT_Memory memory; |
2276 |
FT_CMap cmap; |
FT_CMap cmap; |
2297 |
/* add it to our list of charmaps */ |
/* add it to our list of charmaps */ |
2298 |
if ( FT_RENEW_ARRAY( face->charmaps, |
if ( FT_RENEW_ARRAY( face->charmaps, |
2299 |
face->num_charmaps, |
face->num_charmaps, |
2300 |
face->num_charmaps+1 ) ) |
face->num_charmaps + 1 ) ) |
2301 |
goto Fail; |
goto Fail; |
2302 |
|
|
2303 |
face->charmaps[face->num_charmaps++] = (FT_CharMap)cmap; |
face->charmaps[face->num_charmaps++] = (FT_CharMap)cmap; |