contrib/OWB: add correct SDL dependency, fix compilers used
[AROS-Contrib.git] / freetype1 / lib / extend / ftxgasp.c
blobb2bc0837913b860f3cc681712ee9cf1c58b2704b
1 /*******************************************************************
3 * ftxgasp.c 1.0
5 * Gasp table support API extension body
7 * Copyright 1996-1999 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
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
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
17 * The gasp table is currently loaded by the core engine, but the
18 * standard API doesn't give access to it. This file is used to
19 * demonstrate the use of a simple API extension.
21 ******************************************************************/
23 #include "ftxgasp.h"
25 #include "tttypes.h"
26 #include "ttobjs.h"
27 #include "tttables.h"
30 EXPORT_FUNC
31 TT_Error TT_Get_Face_Gasp_Flags( TT_Face face,
32 TT_UShort point_size,
33 TT_Bool* grid_fit,
34 TT_Bool* smooth_font )
36 PFace faze = HANDLE_Face( face );
37 UShort i, flag;
40 if ( !faze )
41 return TT_Err_Invalid_Face_Handle;
43 if ( faze->gasp.numRanges == 0 || !faze->gasp.gaspRanges )
44 return TT_Err_Table_Missing;
46 for ( i = 0; i < faze->gasp.numRanges; i++ )
48 if ( point_size <= faze->gasp.gaspRanges[i].maxPPEM )
50 flag = faze->gasp.gaspRanges[i].gaspFlag;
52 *grid_fit = ( (flag & GASP_GRIDFIT) != 0 );
53 *smooth_font = ( (flag & GASP_DOGRAY ) != 0 );
55 return TT_Err_Ok;
59 /* for very large fonts we enable font smoothing and discard */
60 /* grid fitting */
62 *grid_fit = 0;
63 *smooth_font = 1;
65 return TT_Err_Ok;
69 /* END */