src/ttf.h

/* [<][>]
[^][v][top][bottom][index][help] */

FUNCTIONS

This source file includes following functions.

   1 /*
   2  * ttf.h - a heder file for TrueType driver with FreeType.
   3  * by Hirotsugu Kakugawa
   4  *
   5  */
   6 /*
   7  * Copyright (C) 1996-1998 Hirotsugu Kakugawa. 
   8  * All rights reserved.
   9  *
  10  * This file is part of the VFlib Library.  This library is free
  11  * software; you can redistribute it and/or modify it under the terms of
  12  * the GNU Library General Public License as published by the Free
  13  * Software Foundation; either version 2 of the License, or (at your
  14  * option) any later version.  This library is distributed in the hope
  15  * that it will be useful, but WITHOUT ANY WARRANTY; without even the
  16  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  17  * PURPOSE.  See the GNU Library General Public License for more details.
  18  * You should have received a copy of the GNU Library General Public
  19  * License along with this library; if not, write to the Free Software
  20  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21  */
  22 
  23 #ifndef __VFLIB_TTF_H__
  24 
  25 #define __VFLIB_TTF_H__
  26 
  27 
  28 #define FONTCLASS_NAME                "truetype"
  29 
  30 #define VF_CAPE_TTF_FONT_NUMBER       "font-number"
  31 #define VF_CAPE_TTF_PLATFORM_ID       "platform-id"
  32 #define VF_CAPE_TTF_ENCODING_ID       "encoding-id"
  33 #define VF_CAPE_TTF_MAPPING_ID        "mapping-id"
  34 #define VF_CAPE_TTF_ENCODING_FORCE    "encoding-force"
  35 #define VF_CAPE_TTF_HINTING           "hinting"
  36 #define VF_CAPE_TTF_JISX0212_R47ES    "jisx0212-row47-empty-sjis"
  37 
  38 #define TTF_ENV_FONT_DIR            "VFLIB_TTF_FONTS"
  39 
  40 #ifndef  DEFAULT_EXTENSIONS
  41 #  define   DEFAULT_EXTENSIONS      ".ttf, .ttc"
  42 #endif
  43 
  44 #define   POINTS_PER_INCH          72.27
  45 
  46 #define   DEFAULT_POINT_SIZE       12.0
  47 #define   DEFAULT_PIXEL_SIZE       24
  48 #define   DEFAULT_DIRECTION        'H'  /* horizontal */
  49 
  50 
  51 
  52 #define TTF_OL_ONCURVE                0x01
  53 #define TTF_OL_X_BYTE                 0x02
  54 #define TTF_OL_Y_BYTE                 0x04
  55 #define TTF_OL_REPEAT_FLAGS           0x08
  56 #define TTF_OL_SHORT_X_IS_POSITIVE    0x10
  57 #define TTF_OL_NEXT_X_IS_ZERO         0x10
  58 #define TTF_OL_SHORT_Y_IS_POSITIVE    0x20
  59 #define TTF_OL_NEXT_Y_IS_ZERO         0x20
  60 
  61 #define TTF_OL_COMP_ARG1_AND_2_ARE_WORDS      (1<<0)
  62 #define TTF_OL_COMP_ARGS_ARE_XY_VALUES        (1<<1)
  63 #define TTF_OL_COMP_ROUND_XY_TO_GRID          (1<<2)
  64 #define TTF_OL_COMP_WE_HAVE_A_SCALE           (1<<3)
  65 #define TTF_OL_COMP_RESERVED                  (1<<4)
  66 #define TTF_OL_COMP_MORE_COMPONENTS           (1<<5)
  67 #define TTF_OL_COMP_WE_HAVE_AN_X_AND_Y_SCALE  (1<<6)
  68 #define TTF_OL_COMP_WE_HAVE_A_TWO_BY_TWO      (1<<7)
  69 #define TTF_OL_COMP_WE_HAVE_INSTRUCTIONS      (1<<8)
  70 #define TTF_OL_COMP_USE_MY_METRICS            (1<<9)
  71 
  72 #define TT_MAP_ID_SEARCH      -1
  73 
  74 #define TT_PLAT_ID_ANY         -1
  75 #define TT_PLAT_ID_APPLE       0
  76 #define TT_PLAT_ID_MACINTOSH   1
  77 #define TT_PLAT_ID_ISO         2
  78 #define TT_PLAT_ID_MICROSOFT   3
  79 
  80 #define TT_ENC_ID_ANY                     -1
  81 #define TT_ENC_ID_ISO_ASCII                0
  82 #define TT_ENC_ID_ISO_10646                1                
  83 #define TT_ENC_ID_ISO_8859_1               2
  84 
  85 #define TT_ENC_ID_MS_SYMBOL                0
  86 #define TT_ENC_ID_MS_UNICODE               1
  87 #define TT_ENC_ID_MS_SHIFT_JIS             2
  88 #define TT_ENC_ID_MS_BIG5                  3
  89 #define TT_ENC_ID_MS_RPC                   4
  90 #define TT_ENC_ID_MS_WANSUNG               5
  91 #define TT_ENC_ID_MS_JOHAB                 6   
  92 #define TT_ENC_ID_APPLE_DEFAULT            0
  93 #define TT_ENC_ID_APPLE_UNICODE_1_1        1
  94 #define TT_ENC_ID_APPLE_ISO_10646          2
  95 #define TT_ENC_ID_APPLE_UNICODE_2_0        3
  96 #define TT_ENC_ID_MAC_ROMAN                0
  97 #define TT_ENC_ID_MAC_JAPANESE             1
  98 #define TT_ENC_ID_MAC_TRADITIONAL_CHINESE  2
  99 #define TT_ENC_ID_MAC_KOREAN               3
 100 #define TT_ENC_ID_MAC_ARABIC               4
 101 #define TT_ENC_ID_MAC_HEBREW               5
 102 #define TT_ENC_ID_MAC_GREEK                6
 103 #define TT_ENC_ID_MAC_RUSSIAN              7
 104 #define TT_ENC_ID_MAC_RSYMBOL              8
 105 #define TT_ENC_ID_MAC_DEVANAGARI           9
 106 #define TT_ENC_ID_MAC_GURMUKHI             10
 107 #define TT_ENC_ID_MAC_GUJARATI             11
 108 #define TT_ENC_ID_MAC_ORIYA                12
 109 #define TT_ENC_ID_MAC_BENGALI              13
 110 #define TT_ENC_ID_MAC_TAMIL                14
 111 #define TT_ENC_ID_MAC_TELUGU               15
 112 #define TT_ENC_ID_MAC_KANNADA              16
 113 #define TT_ENC_ID_MAC_MALAYALAM            17
 114 #define TT_ENC_ID_MAC_SINHALESE            18
 115 #define TT_ENC_ID_MAC_BURMESE              19
 116 #define TT_ENC_ID_MAC_KHMER                20
 117 #define TT_ENC_ID_MAC_THAI                 21
 118 #define TT_ENC_ID_MAC_LAOTIAN              22
 119 #define TT_ENC_ID_MAC_GEORGIAN             23
 120 #define TT_ENC_ID_MAC_ARMENIAN             24
 121 #define TT_ENC_ID_MAC_MALDIVIAN            25
 122 #define TT_ENC_ID_MAC_SIMPLIFIED_CHINESE   25
 123 #define TT_ENC_ID_MAC_TIBETAN              26
 124 #define TT_ENC_ID_MAC_MONGOLIAN            27
 125 #define TT_ENC_ID_MAC_GEEZ                 28
 126 #define TT_ENC_ID_MAC_SLAVIC               29
 127 #define TT_ENC_ID_MAC_VIETNAMESE           30
 128 #define TT_ENC_ID_MAC_SINDHI               31
 129 #define TT_ENC_ID_MAC_UNINTERP             32
 130 
 131 
 132 /* 
 133  * TTF outlune
 134  */
 135 typedef unsigned char   ttf_byte;
 136 typedef char            ttf_char;
 137 typedef unsigned short  ttf_ushort;
 138 typedef short           ttf_short;
 139 typedef unsigned long   ttf_ulong;
 140 typedef long            ttf_long;
 141 typedef long            ttf_fixed;
 142 typedef short           ttf_funit;
 143 typedef short           ttf_fword;
 144 typedef unsigned short  ttf_ufword;
 145 typedef short           ttf_f2dot14;
 146 
 147 typedef struct {
 148   ttf_ufword advanceWidth;
 149   ttf_fword  lsb;
 150 } ttf_hor_metrics;
 151 typedef struct {
 152   ttf_ushort advanceHeight;
 153   ttf_short  tsb;
 154 } ttf_ver_metrics;
 155 
 156 typedef struct
 157 {
 158   int            n_cts;
 159   int            xMin, yMin, xMax, yMax;
 160   ttf_hor_metrics  h_met;
 161   ttf_ver_metrics  v_met;
 162   int            n_pts;
 163   unsigned int   *end_points;
 164   int            n_instructions;
 165   unsigned char  *instructions;
 166   unsigned int   *flags;
 167   int            *xlist;
 168   int            *ylist;
 169 } ttf_outline;
 170 typedef ttf_outline *TTF_OUTLINE;
 171 
 172 
 173 #endif /*__VFLIB_TTF_H__*/
 174 
 175 /*EOF*/

/* [<][>][^][v][top][bottom][index][help] */