THE SOFTWARE.
*/
+#include "fcint.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <libgen.h>
-#include "fcint.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TRUETYPE_TABLES_H
#define NUM_FC_MAC_ROMAN_FAKE (int) (sizeof (fcMacRomanFake) / sizeof (fcMacRomanFake[0]))
-#if HAVE_ICONV && HAVE_ICONV_H
-#define USE_ICONV 1
+#if USE_ICONV
#include <iconv.h>
#endif
FcChar8 *family = 0;
#endif
FcChar8 *complex;
- FcChar8 *file2;
const FcChar8 *foundry = 0;
int spacing;
TT_OS2 *os2;
* or which are simply a FC_FAMILY and FC_STYLE glued together
*/
{
- int fn, fa, st;
+ int fn, fa;
FcChar8 *full;
FcChar8 *fam;
FcChar8 *style;
printf ("Saving unique fullname %s\n", full);
}
- file2 = FcStrCopy (file);
- if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)file2)))
- {
- FcStrFree (file2);
+ if (!FcPatternAddString (pat, FC_FILE, file))
goto bail1;
- }
- FcStrFree (file2);
-
- FcPatternAddFullFname (pat, (const char *)FcStrCopy (file));
if (!FcPatternAddInteger (pat, FC_INDEX, id))
goto bail1;
if (!foundry)
{
int rc;
- BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM)
foundry = (FcChar8 *) prop.u.atom;
if(face->num_fixed_sizes == 1) {
int rc;
int value;
- BDF_PropertyRec prop;
/* skip bitmap fonts which do not even have a family name */
rc = FT_Get_BDF_Property(face, "FAMILY_NAME", &prop);
FT_Stream stream = face->stream;
FT_Error error;
FT_UShort n, p;
- FT_Memory memory = stream->memory;
+ FT_Memory memory;
if ( !stream )
return TT_Err_Invalid_Face_Handle;
+ memory = stream->memory;
+
if (( error = ftglue_face_goto_table( face, tabletag, stream ) ))
return error;
if ( ftglue_stream_seek ( stream, base_offset + 4L ) || ftglue_stream_frame_enter( stream, 2L ) )
return error;
- new_offset = ((FT_UShort)ftglue_stream_get_short ( stream )) + base_offset;
+ new_offset = GET_UShort() + base_offset;
ftglue_stream_frame_exit( stream );
if ( ftglue_stream_frame_enter( stream, 2L ) )
return error;
- *script_count = ((FT_UShort)ftglue_stream_get_short ( stream ));
+ *script_count = GET_UShort ();
ftglue_stream_frame_exit( stream );
if ( ftglue_stream_frame_enter( stream, 6L ) )
goto Fail;
- (*stags)[p] = ((FT_ULong)ftglue_stream_get_long ( stream ));
- new_offset = ((FT_UShort)ftglue_stream_get_short ( stream )) + base_offset;
+ (*stags)[p] = GET_ULong ();
+ new_offset = GET_UShort () + base_offset;
ftglue_stream_frame_exit( stream );
cur_offset = ftglue_stream_pos( stream );
- if ( ftglue_stream_seek( stream, new_offset ) )
- goto Fail;
+ error = ftglue_stream_seek( stream, new_offset );
if ( error == TT_Err_Ok )
p++;
- else if ( error != TTO_Err_Empty_Script )
- goto Fail;
(void)ftglue_stream_seek( stream, cur_offset );
}
goto Fail;
}
- // sort the tag list before returning it
+ /* sort the tag list before returning it */
qsort(*stags, *script_count, sizeof(FT_ULong), compareulong);
return TT_Err_Ok;
Fail:
*script_count = 0;
ftglue_free( memory, *stags );
+ *stags = NULL;
return error;
}