Back to index

tetex-bin  3.0
writettf.h
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 1996-2002 Han The Thanh, <thanh@pdftex.org>
00003 
00004 This file is part of pdfTeX.
00005 
00006 pdfTeX is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 2 of the License, or
00009 (at your option) any later version.
00010 
00011 pdfTeX is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with pdfTeX; if not, write to the Free Software
00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020 $Id: //depot/Build/source.development/TeX/texk/web2c/pdftexdir/writettf.h#1 $
00021 */
00022 
00023 typedef signed char     TTF_CHAR;
00024 typedef unsigned char   TTF_BYTE;
00025 typedef signed short    TTF_SHORT;
00026 typedef unsigned short  TTF_USHORT;
00027 typedef signed long     TTF_LONG;
00028 typedef unsigned long   TTF_ULONG;
00029 typedef unsigned long   TTF_FIXED;
00030 typedef unsigned short  TTF_FUNIT;
00031 typedef signed short    TTF_FWORD;
00032 typedef unsigned short  TTF_UFWORD;
00033 typedef unsigned short  TTF_F2DOT14;
00034 
00035 #define TTF_CHAR_SIZE    1
00036 #define TTF_BYTE_SIZE    1
00037 #define TTF_SHORT_SIZE   2
00038 #define TTF_USHORT_SIZE  2
00039 #define TTF_LONG_SIZE    4
00040 #define TTF_ULONG_SIZE   4
00041 #define TTF_FIXED_SIZE   4
00042 #define TTF_FWORD_SIZE   2
00043 #define TTF_UFWORD_SIZE  2
00044 #define TTF_F2DOT14_SIZE 2
00045 
00046 #define ARG_1_AND_2_ARE_WORDS       (1<<0)
00047 #define ARGS_ARE_XY_VALUES          (1<<1)
00048 #define ROUND_XY_TO_GRID            (1<<2)
00049 #define WE_HAVE_A_SCALE             (1<<3)
00050 #define RESERVED                    (1<<4)
00051 #define MORE_COMPONENTS             (1<<5)
00052 #define WE_HAVE_AN_X_AND_Y_SCALE    (1<<6)
00053 #define WE_HAVE_A_TWO_BY_TWO        (1<<7)
00054 #define WE_HAVE_INSTRUCTIONS        (1<<8)
00055 #define USE_MY_METRICS              (1<<9)
00056 
00057 #define get_type(t)     ((t)ttf_getnum(t##_SIZE))
00058 #define ttf_skip(n)     ttf_getnum(n)
00059 
00060 #define get_byte()      get_type(TTF_BYTE)
00061 #define get_char()      get_type(TTF_CHAR)
00062 #define get_ushort()    get_type(TTF_USHORT)
00063 #define get_short()     get_type(TTF_SHORT)
00064 #define get_ulong()     get_type(TTF_ULONG)
00065 #define get_long()      get_type(TTF_LONG)
00066 #define get_fixed()     get_type(TTF_FIXED)
00067 #define get_funit()     get_type(TTF_FUNIT)
00068 #define get_fword()     get_type(TTF_FWORD)
00069 #define get_ufword()    get_type(TTF_UFWORD)
00070 #define get_f2dot14()   get_type(TTF_F2DOT14)
00071 
00072 #define put_num(t,n)    ((t)ttf_putnum(t##_SIZE, n))
00073 
00074 #define put_char(n)     put_num(TTF_CHAR, n)
00075 #define put_byte(n)     put_num(TTF_BYTE, n)
00076 #define put_short(n)    put_num(TTF_SHORT, n)
00077 #define put_ushort(n)   put_num(TTF_USHORT, n)
00078 #define put_long(n)     put_num(TTF_LONG, n)
00079 #define put_ulong(n)    put_num(TTF_ULONG, n)
00080 #define put_fixed(n)    put_num(TTF_FIXED, n)
00081 #define put_funit(n)    put_num(TTF_FUNIT, n)
00082 #define put_fword(n)    put_num(TTF_FWORD, n)
00083 #define put_ufword(n)   put_num(TTF_UFWORD, n)
00084 #define put_f2dot14(n)  put_num(TTF_F2DOT14, n)
00085 
00086 #define copy_byte()     put_byte(get_byte())
00087 #define copy_char()     put_char(get_char())
00088 #define copy_ushort()   put_ushort(get_ushort())
00089 #define copy_short()    put_short(get_short())
00090 #define copy_ulong()    put_ulong(get_ulong())
00091 #define copy_long()     put_long(get_long())
00092 #define copy_fixed()    put_fixed(get_fixed())
00093 #define copy_funit()    put_funit(get_funit())
00094 #define copy_fword()    put_fword(get_fword())
00095 #define copy_ufword()   put_ufword(get_ufword())
00096 #define copy_f2dot14()  put_f2dot14(get_f2dot14())
00097 
00098 #define is_unicode_mapping(e) \
00099     (e->platform_id == 0 || (e->platform_id == 3 || e->encoding_id == 1))
00100 
00101 
00102 #define NMACGLYPHS      258
00103 #define TABDIR_OFF      12
00104 #define ENC_BUF_SIZE    1024
00105 
00106 #define GLYPH_PREFIX_INDEX    "index"
00107 #define GLYPH_PREFIX_UNICODE  "uni"
00108 
00109 #define NOGLYPH_ASSIGNED_YET 0xFFFF /* indicating that no glyph is assigned to
00110                                        an unicode */
00111 typedef struct {
00112     char tag[4];
00113     TTF_ULONG checksum;
00114     TTF_ULONG offset;
00115     TTF_ULONG length;
00116 } dirtab_entry;
00117 
00118 typedef struct {
00119     TTF_USHORT platform_id;
00120     TTF_USHORT encoding_id;
00121     TTF_ULONG  offset;
00122     TTF_USHORT format;
00123 } cmap_entry;
00124 
00125 typedef struct {
00126     TTF_USHORT endCode;
00127     TTF_USHORT startCode;
00128     TTF_USHORT idDelta;
00129     TTF_USHORT idRangeOffset;
00130 } seg_entry;