~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/freetype/docs/CUSTOMIZE

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
How to customize the compilation of the library:
 
2
================================================
 
3
 
 
4
  FreeType  is  highly  customizable  to  fit various  needs,  and  this
 
5
  document describes how it is possible to select options and components
 
6
  at compilation time.
 
7
 
 
8
 
 
9
I. Configuration macros
 
10
 
 
11
  The file found in "include/freetype/config/ftoption.h" contains a list
 
12
  of commented configuration macros that can be toggled by developers to
 
13
  indicate which features should be active while building the library.
 
14
  
 
15
  These  options  range from  debug  level  to  availability of  certain
 
16
  features, like native TrueType hinting through a bytecode interpreter.
 
17
  
 
18
  We invite you to read this  file for more information.  You can change
 
19
  the file's content to suit your  needs, or override it with one of the
 
20
  techniques described below.
 
21
 
 
22
  
 
23
II. Modules list
 
24
 
 
25
  The file found in "include/freetype/config/ftmodule.h" contains a list
 
26
  of  names  corresponding  to  the  modules  and  font  drivers  to  be
 
27
  statically compiled in the FreeType library during the build.
 
28
 
 
29
  You can change it to suit your own preferences.  Be aware that certain
 
30
  modules depend  on others, as  described by the file  "modules.txt" in
 
31
  this directory.
 
32
 
 
33
  You can modify  the file's content to suit your  needs, or override it
 
34
  at compile time with one of the methods described below.
 
35
 
 
36
 
 
37
III. System interface
 
38
 
 
39
  FreeType's default interface to the  system (i.e., the parts that deal
 
40
  with   memory   management   and    i/o   streams)   is   located   in
 
41
  "src/base/ftsystem.c".
 
42
  
 
43
  The  current implementation uses  standard C  library calls  to manage
 
44
  memory and to read font files.  It is however possible to write custom
 
45
  implementations to suit specific systems.
 
46
 
 
47
  To  tell  the GNU  Make-based  build system  to  use  a custom  system
 
48
  interface, you  have to define  the environment variable  FTSYS_SRC to
 
49
  point to the relevant implementation:
 
50
  
 
51
    on Unix:
 
52
 
 
53
      ./configure <your options>
 
54
      export FTSYS_SRC=foo/my_ftsystem.c
 
55
      make
 
56
      make install
 
57
   
 
58
    on Windows:
 
59
 
 
60
      make setup <compiler>
 
61
      set FTSYS_SRC=foo/my_ftsystem.c
 
62
      make
 
63
     
 
64
     
 
65
IV. Overriding default configuration and module headers
 
66
 
 
67
  It  is  possible to  override  the  default  configuration and  module
 
68
  headers without changing the original files.  There are two ways to do
 
69
  that:
 
70
 
 
71
 
 
72
  1. Using the C include path
 
73
  
 
74
    Use the C include path to ensure that your own versions of the files
 
75
    are used at compile time when the lines
 
76
    
 
77
       #include FT_CONFIG_OPTIONS_H
 
78
       #include FT_CONFIG_MODULES_H
 
79
 
 
80
    are       compiled.       Their      default       values      being
 
81
    <freetype/config/ftoption.h>  and  <freetype/config/ftmodule.h>, you
 
82
    can do something like:
 
83
 
 
84
       custom/
 
85
         freetype/
 
86
           config/
 
87
             ftoption.h    => custom options header
 
88
             ftmodule.h    => custom modules list
 
89
             
 
90
       include/            => normal FreeType 2 include
 
91
         freetype/
 
92
           ...
 
93
 
 
94
    then change the  C include path to always give  the path to "custom"
 
95
    before the FreeType 2 "include".
 
96
 
 
97
 
 
98
  2. Re-defining FT_CONFIG_OPTIONS_H and FT_CONFIG_MODULES_H
 
99
  
 
100
    Another way to  do the same thing is to redefine  the macros used to
 
101
    name  the  configuration headers.   To  do  so,  you need  a  custom
 
102
    "ft2build.h" whose content can be as simple as:
 
103
   
 
104
      #ifndef __FT2_BUILD_MY_PLATFORM_H__
 
105
      #define __FT2_BUILD_MY_PLATFORM_H__
 
106
 
 
107
      #define FT_CONFIG_OPTIONS_H  <custom/my-ftoption.h>
 
108
      #define FT_CONFIG_MODULES_H  <custom/my-ftmodule.h>
 
109
 
 
110
      #include <freetype/config/ftheader.h>
 
111
 
 
112
      #endif /* __FT2_BUILD_MY_PLATFORM_H__ */
 
113
   
 
114
    Place those files in a separate directory, e.g.:
 
115
   
 
116
      custom/
 
117
        ft2build.h           => custom version described above
 
118
        my-ftoption.h        => custom options header
 
119
        my-ftmodule.h        => custom modules list header
 
120
 
 
121
    and  change the C  include path  to ensure  that "custom"  is always
 
122
    placed before the FT2 "include" during compilation.
 
123
 
 
124
 
 
125
--- end of CUSTOMIZE ---