2002-05-30 21:22:14 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftxf86.c */
|
|
|
|
/* */
|
|
|
|
/* FreeType utility file for X11 support (body). */
|
|
|
|
/* */
|
|
|
|
/* Copyright 2002 by */
|
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2002-05-29 00:07:49 +02:00
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_XFREE86_H
|
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
|
|
|
|
2002-05-30 21:22:14 +02:00
|
|
|
/* XXX: This really is a sad hack, but I didn't want to change every */
|
|
|
|
/* driver just to support this at the moment, since other important */
|
|
|
|
/* changes are coming anyway. */
|
2002-05-29 00:07:49 +02:00
|
|
|
|
2002-05-30 21:22:14 +02:00
|
|
|
typedef struct FT_FontFormatRec_
|
2002-05-29 00:07:49 +02:00
|
|
|
{
|
|
|
|
const char* driver_name;
|
|
|
|
const char* format_name;
|
|
|
|
|
|
|
|
} FT_FontFormatRec;
|
|
|
|
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( const char* )
|
2002-05-30 21:22:14 +02:00
|
|
|
FT_Get_X11_Font_Format( FT_Face face )
|
2002-05-29 00:07:49 +02:00
|
|
|
{
|
|
|
|
static const FT_FontFormatRec font_formats[] =
|
|
|
|
{
|
|
|
|
{ "type1", "Type 1" },
|
|
|
|
{ "truetype", "TrueType" },
|
|
|
|
{ "bdf", "BDF" },
|
|
|
|
{ "pcf", "PCF" },
|
|
|
|
{ "type42", "Type 42" },
|
|
|
|
{ "cidtype1", "CID Type 1" },
|
|
|
|
{ "cff", "CFF" },
|
|
|
|
{ "pfr", "PFR" },
|
2003-07-05 09:46:49 +02:00
|
|
|
{ "winfonts", "Windows FNT" }
|
2002-05-29 00:07:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const char* result = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if ( face && face->driver )
|
|
|
|
{
|
2002-05-30 21:22:14 +02:00
|
|
|
FT_Module driver = (FT_Module)face->driver;
|
|
|
|
|
2002-05-29 00:07:49 +02:00
|
|
|
|
|
|
|
if ( driver->clazz && driver->clazz->module_name )
|
|
|
|
{
|
2002-05-30 21:22:14 +02:00
|
|
|
FT_Int n;
|
|
|
|
FT_Int count = sizeof( font_formats ) / sizeof ( font_formats[0] );
|
|
|
|
|
2002-05-29 00:07:49 +02:00
|
|
|
|
|
|
|
result = driver->clazz->module_name;
|
|
|
|
|
|
|
|
for ( n = 0; n < count; n++ )
|
|
|
|
if ( ft_strcmp( result, font_formats[n].driver_name ) == 0 )
|
|
|
|
{
|
|
|
|
result = font_formats[n].format_name;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2002-05-30 21:22:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|