"Fossies" - the Fresh Open Source Software Archive

Member "yudit-3.0.7/swindow/STTables.h" (2 Jun 2020, 11354 Bytes) of package /linux/misc/yudit-3.0.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "STTables.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.0.5_vs_3.0.7.

    1 /** 
    2  *  Yudit Unicode Editor Source File
    3  *
    4  *  GNU Copyright (C) 1997-2006  Gaspar Sinai <gaspar@yudit.org>  
    5  *
    6  *  This program is free software; you can redistribute it and/or modify
    7  *  it under the terms of the GNU General Public License, version 2,
    8  *  dated June 1991. See file COPYYING for details.
    9  *
   10  *  This program is distributed in the hope that it will be useful,
   11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  *  GNU General Public License for more details.
   14  *
   15  *  You should have received a copy of the GNU General Public License
   16  *  along with this program; if not, write to the Free Software
   17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18  */
   19 #ifndef  STTABLES_H
   20 #define  STTABLES_H
   21 /* 
   22  * TT_PLAT and TT_ENC from ttf.h from VFlib Library.
   23  * by Hirotsugu Kakugawa. Copyright: GNU.
   24  */
   25 
   26 #define TT_ENC_ID_ANY                     -1
   27 #define TT_ENC_ID_ISO_ASCII                0
   28 #define TT_ENC_ID_ISO_10646                1
   29 #define TT_ENC_ID_ISO_8859_1               2
   30 
   31 #define TT_ENC_ID_MS_SYMBOL                0
   32 #define TT_ENC_ID_MS_UNICODE               1
   33 #define TT_ENC_ID_MS_SHIFT_JIS             2
   34 #define TT_ENC_ID_MS_BIG5                  3
   35 #define TT_ENC_ID_MS_RPC                   4
   36 #define TT_ENC_ID_MS_WANSUNG               5
   37 #define TT_ENC_ID_MS_JOHAB                 6
   38 #define TT_ENC_ID_MS_SURROGATES            10
   39 
   40 #define TT_ENC_ID_APPLE_DEFAULT            0
   41 #define TT_ENC_ID_APPLE_UNICODE_1_1        1
   42 #define TT_ENC_ID_APPLE_ISO_10646          2
   43 #define TT_ENC_ID_APPLE_UNICODE_2_0        3
   44 
   45 #define TT_ENC_ID_MAC_ROMAN                0
   46 #define TT_ENC_ID_MAC_JAPANESE             1
   47 #define TT_ENC_ID_MAC_TRADITIONAL_CHINESE  2
   48 #define TT_ENC_ID_MAC_KOREAN               3
   49 #define TT_ENC_ID_MAC_ARABIC               4
   50 #define TT_ENC_ID_MAC_HEBREW               5
   51 #define TT_ENC_ID_MAC_GREEK                6
   52 #define TT_ENC_ID_MAC_RUSSIAN              7
   53 #define TT_ENC_ID_MAC_RSYMBOL              8
   54 #define TT_ENC_ID_MAC_DEVANAGARI           9
   55 #define TT_ENC_ID_MAC_GURMUKHI             10
   56 #define TT_ENC_ID_MAC_GUJARATI             11
   57 #define TT_ENC_ID_MAC_ORIYA                12
   58 #define TT_ENC_ID_MAC_BENGALI              13
   59 #define TT_ENC_ID_MAC_TAMIL                14
   60 #define TT_ENC_ID_MAC_TELUGU               15
   61 #define TT_ENC_ID_MAC_KANNADA              16
   62 #define TT_ENC_ID_MAC_MALAYALAM            17
   63 #define TT_ENC_ID_MAC_SINHALESE            18
   64 #define TT_ENC_ID_MAC_BURMESE              19
   65 #define TT_ENC_ID_MAC_KHMER                20
   66 #define TT_ENC_ID_MAC_THAI                 21
   67 #define TT_ENC_ID_MAC_LAOTIAN              22
   68 #define TT_ENC_ID_MAC_GEORGIAN             23
   69 #define TT_ENC_ID_MAC_ARMENIAN             24
   70 #define TT_ENC_ID_MAC_MALDIVIAN            25
   71 #define TT_ENC_ID_MAC_SIMPLIFIED_CHINESE   25
   72 #define TT_ENC_ID_MAC_TIBETAN              26
   73 #define TT_ENC_ID_MAC_MONGOLIAN            27
   74 #define TT_ENC_ID_MAC_GEEZ                 28
   75 #define TT_ENC_ID_MAC_SLAVIC               29
   76 #define TT_ENC_ID_MAC_VIETNAMESE           30
   77 #define TT_ENC_ID_MAC_SINDHI               31
   78 #define TT_ENC_ID_MAC_UNINTERP             32
   79 
   80 #define TT_PLAT_ID_ANY         -1
   81 #define TT_PLAT_ID_APPLE       0
   82 #define TT_PLAT_ID_MACINTOSH   1
   83 #define TT_PLAT_ID_ISO         2
   84 #define TT_PLAT_ID_MICROSOFT   3
   85 /*
   86  * The following definitions were derived from
   87  * Andrew Weeks's excellent font converter program.
   88  * Many thanks!
   89  */
   90 #define SD_BYTE unsigned char
   91 #define SD_CHAR signed char
   92 #define SD_USHORT unsigned short
   93 #define SD_SHORT signed short
   94 #define SD_ULONG unsigned int
   95 #define SD_LONG signed int
   96 #define SD_FWORD SD_SHORT
   97 #define SD_UFWORD SD_USHORT
   98 
   99 #define ONOROFF 0x01
  100 #define XSD_SHORT  0x02
  101 #define YSD_SHORT  0x04
  102 #define REPEAT  0x08
  103 #define XSAME   0x10
  104 #define YSAME   0x20
  105 #define ARG_1_AND_2_ARE_WORDS           0x0001
  106 #define ARGS_ARE_XY_VALUES                      0x0002
  107 #define XY_BOUND_TO_GRID                        0x0004
  108 #define WE_HAVE_A_SCALE                         0x0008
  109 #define MORE_COMPONENTS                         0x0020
  110 #define WE_HAVE_AN_X_AND_Y_SCALE        0x0040
  111 #define WE_HAVE_A_TWO_BY_TWO            0x0080
  112 #define WE_HAVE_INSTRUCTIONS            0x0100
  113 #define USE_MY_METRICS                          0x0200
  114 
  115 typedef struct longhormetric {
  116         SD_UFWORD  advanceWidth;
  117         SD_FWORD   lsb;
  118 } LONGHORMETRIC;
  119 
  120 typedef struct ttf_hhea {
  121         SD_BYTE    version[4];
  122         SD_SHORT   ascender, descender, lineGap;
  123         SD_USHORT  advnaceWidthMax;
  124         SD_SHORT   minLSB, minRSB, xMaxExtent;
  125         SD_SHORT   caretSlopeRise, caretSlopeRun;
  126         SD_SHORT   reserved[5];
  127         SD_SHORT   metricDataFormat;
  128         SD_USHORT  numberOfHMetrics;
  129 } TTF_HHEA;
  130 
  131 typedef struct ttf_dir_entry {
  132         char    tag[4];
  133         SD_ULONG   checksum;
  134         SD_ULONG   offset;
  135         SD_ULONG   length;
  136 } TTF_DIR_ENTRY ;
  137 
  138 typedef struct ttf_directory {
  139         SD_ULONG                   sfntVersion;
  140         SD_USHORT                  numTables;
  141         SD_USHORT                  searchRange;
  142         SD_USHORT                  entrySelector;
  143         SD_USHORT                  rangeShift;
  144         TTF_DIR_ENTRY   list;
  145 } TTF_DIRECTORY ;
  146 
  147 typedef struct ttf_name_rec {
  148         SD_USHORT  platformID;
  149         SD_USHORT  encodingID;
  150         SD_USHORT  languageID;
  151         SD_USHORT  nameID;
  152         SD_USHORT  stringLength;
  153         SD_USHORT  stringOffset;
  154 } TTF_NAME_REC;
  155 
  156 typedef struct ttf_name {
  157         SD_USHORT                  format;
  158         SD_USHORT                  numberOfNameRecords;
  159         SD_USHORT                  offset;
  160         TTF_NAME_REC    nameRecords;
  161 } TTF_NAME ;
  162 
  163 /*
  164  Flags is HEAD table - grossly ignored by yudit :)
  165 Bit 0: Baseline for font at y=0;
  166 Bit 1: Left sidebearing point at x=0;
  167 Bit 2: Instructions may depend on point size; 
  168 Bit 3: Force ppem to integer values for all internal scaler math;
  169 may use fractional ppem sizes if this bit is clear; 
  170 Bit 4: Instructions may alter advance width (the advance widths
  171 might not scale linearly); 
  172 Bits 5-10: These should be set according to Apple's specification
  173 . However, they are not implemented in OpenType. 
  174 Bit 11: Font data is 'lossless,' as a result of having been
  175 compressed and decompressed with the Agfa MicroType
  176 Express engine.
  177 Bit 12: Font converted (produce compatible metrics)
  178 Bit 13: Font optimised for ClearType
  179 Bit 14: Reserved, set to 0
  180 Bit 15: Reserved, set to 0 
  181 */
  182 typedef struct ttf_head {
  183         SD_ULONG   version;
  184         SD_ULONG   fontRevision;
  185         SD_ULONG   checksumAdjust;
  186         SD_ULONG   magicNo;
  187         SD_USHORT  flags;
  188         SD_USHORT  unitsPerEm;
  189         SD_BYTE    created[8];
  190         SD_BYTE    modified[8];
  191         SD_FWORD   xMin, yMin, xMax, yMax;
  192         SD_USHORT  macStyle, lowestRecPPEM;
  193         SD_SHORT   fontDirection, indexToLocFormat, glyphDataFormat;
  194 } TTF_HEAD ;
  195 
  196 
  197 typedef struct ttf_kern {
  198         SD_USHORT  version, nTables;
  199 } TTF_KERN ;
  200 
  201 typedef struct ttf_kern_sub {
  202         SD_USHORT version, length, coverage;
  203         SD_USHORT nPairs, searchRange, entrySelector, rangeShift;
  204 } TTF_KERN_SUB;
  205 
  206 typedef struct ttf_kern_entry {
  207         SD_USHORT  left, right;
  208         SD_FWORD   value;
  209 } TTF_KERN_ENTRY;
  210 
  211 typedef struct ttf_cmap_fmt0 {
  212         SD_USHORT  format;
  213         SD_USHORT  length;
  214         SD_USHORT  version;
  215         SD_BYTE    glyphIdArray[256];
  216 } TTF_CMAP_FMT0;
  217 
  218 typedef struct ttf_cmap_fmt2_subheader {
  219     SD_USHORT  firstCode;
  220     SD_USHORT  entryCount;
  221     SD_SHORT   idDelta;
  222     SD_USHORT  idRangeOffset;
  223 } TTF_CMAP_FMT2_SUBHEADER;
  224 
  225 typedef struct ttf_cmap_fmt2 {
  226         SD_USHORT  format;
  227         SD_USHORT  length;
  228         SD_USHORT  language;
  229         SD_USHORT  subHeaderKeys[256];
  230         TTF_CMAP_FMT2_SUBHEADER  subHeaders[1];
  231 } TTF_CMAP_FMT2;
  232 
  233 typedef struct ttf_cmap_fmt4 {
  234         SD_USHORT  format;
  235         SD_USHORT  length;
  236         SD_USHORT  version;
  237         SD_USHORT  segCountX2;
  238         SD_USHORT  searchRange;
  239         SD_USHORT  entrySelector;
  240         SD_USHORT  rangeShift;
  241 } TTF_CMAP_FMT4;
  242 
  243 typedef struct ttf_cmap_fmt12_entry {
  244         SD_ULONG  startCharCode;
  245         SD_ULONG  endCharCode;
  246         SD_ULONG  startGlyphCode;
  247 } TTF_CMAP_FMT12_ENTRY;
  248 
  249 typedef struct ttf_cmap_fmt12 {
  250         SD_ULONG  format;
  251         SD_ULONG  length;
  252         SD_ULONG  language;
  253         SD_ULONG  nGroups;
  254         TTF_CMAP_FMT12_ENTRY entry[1]; /* nGroups */
  255 } TTF_CMAP_FMT12;
  256 
  257 typedef struct ttf_cmap_entry {
  258         SD_USHORT  platformID;
  259         SD_USHORT  encodingID;
  260         SD_ULONG   offset;
  261 } TTF_CMAP_ENTRY;
  262 
  263 typedef struct ttf_cmap {
  264         SD_USHORT                  version;
  265         SD_USHORT                  numberOfEncodingTables;
  266         TTF_CMAP_ENTRY  encodingTable[1];
  267 } TTF_CMAP ;
  268 
  269 typedef struct ttf_glyf {
  270         SD_SHORT   numberOfContours;
  271         SD_FWORD   xMin, yMin, xMax, yMax;
  272 } TTF_GLYF ;
  273 
  274 typedef struct ttf_maxp {
  275         SD_ULONG   version;
  276         SD_USHORT  numGlyphs, maxPoints, maxContours;
  277         SD_USHORT  maxCompositePoints, maxCompositeContours;
  278         SD_USHORT  maxZones, maxTwilightPoints, maxStorage;
  279         SD_USHORT  maxFunctionDefs, maxInstructionsDefs;
  280         SD_USHORT  maxSizeOfInstructions, maxComponentElements;
  281         SD_USHORT  maxComponentDepth;
  282 } TTF_MAXP ;
  283 
  284 typedef struct short_2 {
  285         SD_SHORT   upper;
  286         SD_USHORT  lower;
  287 } SSFIX ;
  288 
  289 typedef struct ttf_post_head {
  290         SD_ULONG   formatType;
  291         SSFIX   italicAngle;
  292         SD_FWORD   underlinePosition;
  293         SD_FWORD   underlineThickness;
  294         SD_ULONG   isFixedPitch;
  295         SD_ULONG   minMemType42;
  296         SD_ULONG   maxMemType42;
  297         SD_ULONG   minMemType1;
  298         SD_ULONG   maxMemType1;
  299         SD_USHORT  numGlyphs;
  300         SD_USHORT  glyphNameIndex;
  301 } TTF_POST_HEAD ;
  302 
  303 typedef struct ttf_oss2 {
  304     SD_USHORT version; /* 0x0002 */
  305     SD_SHORT  xAvgCharWidth; 
  306     SD_USHORT usWeightClass; 
  307     SD_USHORT usWidthClass; 
  308     SD_USHORT fsType; 
  309     SD_SHORT  ySubscriptXSize; 
  310     SD_SHORT  ySubscriptYSize; 
  311     SD_SHORT  ySubscriptXOffset; 
  312     SD_SHORT  ySubscriptYOffset; 
  313     SD_SHORT  ySuperscriptXSize; 
  314     SD_SHORT  ySuperscriptYSize; 
  315     SD_SHORT  ySuperscriptXOffset; 
  316     SD_SHORT  ySuperscriptYOffset; 
  317     SD_SHORT  yStrikeoutSize; 
  318     SD_SHORT  yStrikeoutPosition; 
  319     SD_SHORT  sFamilyClass; 
  320     SD_BYTE   panose[10]; 
  321     SD_ULONG  ulUnicodeRange1; /* Bits 0-31 */
  322     SD_ULONG  ulUnicodeRange2; /* Bits 32-63 */
  323     SD_ULONG  ulUnicodeRange3; /* Bits 64-95 */
  324     SD_ULONG  ulUnicodeRange4; /* Bits 96-127 */
  325     SD_CHAR   achVendID[4]; 
  326     SD_USHORT fsSelection; 
  327     SD_USHORT usFirstCharIndex; 
  328     SD_USHORT usLastCharIndex; 
  329     SD_SHORT  sTypoAscender; 
  330     SD_SHORT  sTypoDescender; 
  331     SD_SHORT  sTypoLineGap; 
  332     SD_USHORT usWinAscent; 
  333     SD_USHORT usWinDescent; 
  334     SD_ULONG  ulCodePageRange1; /* Bits 0-31 */
  335     SD_ULONG  ulCodePageRange2; /* Bits 32-63 */
  336     SD_SHORT  sxHeight; 
  337     SD_SHORT  sCapHeight; 
  338     SD_USHORT usDefaultChar; 
  339     SD_USHORT usBreakChar; 
  340     SD_USHORT usMaxContext; 
  341 } TTF_OS2;
  342 
  343 typedef struct _SS_CFF_Header {
  344     SD_BYTE major; // major version
  345     SD_BYTE minor; // minor version
  346     SD_BYTE hsize; // header size NameIndex will follow.
  347     SD_BYTE osize; // offset unit in bytes, both relative and absolute. 
  348 } SS_CFF_Header;
  349 
  350 
  351 #endif  /*STTABLES_H*/