freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compiling FreeType2 for EPOC (the Symbian platform): some issues with gl


From: Graham Asher
Subject: compiling FreeType2 for EPOC (the Symbian platform): some issues with global data
Date: Mon, 23 Oct 2000 15:17:30 +0100

David,

when FreeType2 is compiled as a DLL for EPOC, the Symbian operating system 
for mobile phones and PDAs, the toolchain has some very strict 
requirements. In particular, there cannot be any writable global data, or 
global data that, although typed as constant, is initialised after loading. 
Luckily there are some simple patches for FreeType2 that are generally 
beneficial, and allow it to be compiled as an EPOC DLL, as long as the 
re-entrant build is specified.

I must stress that these patches are intended to go into the general build 
and are not EPOC-specific, although they allow the EPOC version to be 
built. They may also be helpful to other builds, and surely cannot do any 
harm. Anyway, here they are (with comments tagged 'GA' that can be 
removed):

1. ftoutln.h and ftoutln.c: add 'const' to the 2nd arg to 
FT_Outline_Decompose, making it

  FT_EXPORT_DEF( FT_Error )  FT_Outline_Decompose(
                               FT_Outline*        outline,
                               const FT_Outline_Funcs*  interface, // GA: 
added const
                               void*              user )

2. ftinit.c: add a trailing 'const' to the declaration of 
ft_default_modules:

static
const FT_Module_Class* const  ft_default_modules[] = // GA: added trailing 
const
  {
#ifdef macintosh
    FT_USE_MODULE(fond_driver_class)
#endif
#include <freetype/config/ftmodule.h>
    0
  };

3. ftraster.c: add 'const' to ft_standard_raster:

const  FT_Raster_Funcs  ft_standard_raster = // GA: added const
  {
    ft_glyph_format_outline,
    (FT_Raster_New_Func)     ft_black_new,
    (FT_Raster_Reset_Func)   ft_black_reset,
    (FT_Raster_Set_Mode_Func)ft_black_set_mode,
    (FT_Raster_Render_Func)  ft_black_render,
    (FT_Raster_Done_Func)    ft_black_done
  };

4. ftraster.h: same as (3):

  FT_EXPORT_VAR( const FT_Raster_Funcs )  ft_standard_raster;

5. ftgrays.c: in the function grays_convert_glyph, add const to the 
declaration of 'interface':

  static
  int  grays_convert_glyph( RAS_ARG_ FT_Outline*  outline )
  {
    static const // GA: added const
    FT_Outline_Funcs  interface =
    {
      (FT_Outline_MoveTo_Func) Move_To,
      (FT_Outline_LineTo_Func) Line_To,
      (FT_Outline_ConicTo_Func)Conic_To,
      (FT_Outline_CubicTo_Func)Cubic_To,
      0,
      0
    };

... etc.

5. ftgrays.h: add const to ft_grays_raster:

  FT_EXPORT_VAR( const FT_Raster_Funcs )  ft_grays_raster; // GA: added 
const

Best regards

Graham


Graham Asher
freelance software architect




reply via email to

[Prev in Thread] Current Thread [Next in Thread]