⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 t1tokens.h

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 H
📖 第 1 页 / 共 2 页
字号:
  typedef  struct  T1_TokenParser_  {    FT_Memory   memory;    FT_Stream   stream;    T1_Bool     in_pfb;      /* true if PFB file, PFA otherwise */    T1_Bool     in_private;  /* true if in private dictionary   */    T1_Byte*    base;        /* base address of current read buffer */    T1_Long     cursor;      /* current position in read buffer     */    T1_Long     limit;       /* limit of current read buffer        */    T1_Long     max;         /* maximum size of read buffer         */    T1_Error    error;       /* last error                          */    T1_Token    token;       /* last token read                     */  } T1_TokenParser; /*************************************************************************/ /*                                                                       */ /*  <Type> T1_Tokenizer                                                  */ /*                                                                       */ /*  <Description>                                                        */ /*     A handle to an object used to extract tokens from the input.      */ /*     The object is able to perform PFA/PFB recognition, eexec          */ /*     decryption of the private dictionary, as well as eexec decryption */ /*     of the charstrings..                                              */ /*                                                                       */  typedef  T1_TokenParser*    T1_Tokenizer; /*************************************************************************/ /*                                                                       */ /*  <Function> New_Tokenizer                                             */ /*                                                                       */ /*  <Description>                                                        */ /*     Creates a new tokenizer from a given input stream. This function  */ /*     automatically recognizes "pfa" or "pfb" files. The function       */ /*     "Read_Token" can then be used to extract successive tokens from   */ /*     the stream..                                                      */ /*                                                                       */ /*  <Input>                                                              */ /*     stream  :: input stream                                           */ /*                                                                       */ /*  <Output>                                                             */ /*     tokenizer :: handle to new tokenizer object..                     */ /*                                                                       */ /*  <Return>                                                             */ /*     Type1 error code. 0 means success..                               */ /*                                                                       */ /*  <Note>                                                               */ /*     This function copies the stream handle within the object. Callers */ /*     should not discard "stream". This is done by the Done_Tokenizer   */ /*     function..                                                        */ /*                                                                       */ LOCAL_DEF T1_Error  New_Tokenizer( FT_Stream      stream,                          T1_Tokenizer*  tokenizer ); /*************************************************************************/ /*                                                                       */ /*  <Function> Done_Tokenizer                                            */ /*                                                                       */ /*  <Description>                                                        */ /*     Closes a given tokenizer. This function will also close the       */ /*     stream embedded in the object..                                   */ /*                                                                       */ /*  <Input>                                                              */ /*     tokenizer :: target tokenizer object                              */ /*                                                                       */ /*  <Return>                                                             */ /*     Type1 error code. 0 means success..                               */ /*                                                                       */ LOCAL_DEF T1_Error  Done_Tokenizer( T1_Tokenizer  tokenizer ); /*************************************************************************/ /*                                                                       */ /*  <Function> Open_PrivateDict                                          */ /*                                                                       */ /*  <Description>                                                        */ /*     This function must be called to set the tokenizer to the private  */ /*     section of the Type1 file. It recognizes automatically the        */ /*     the kind of eexec encryption used (ascii or binary)..             */ /*                                                                       */ /*  <Input>                                                              */ /*     tokenizer :: target tokenizer object                              */ /*     lenIV     :: value of the "lenIV" variable..                      */ /*                                                                       */ /*  <Return>                                                             */ /*     Type1 error code. 0 means success..                               */ /*                                                                       */ LOCAL_DEF T1_Error  Open_PrivateDict( T1_Tokenizer  tokenizer ); /*************************************************************************/ /*                                                                       */ /*  <Function> Read_Token                                                */ /*                                                                       */ /*  <Description>                                                        */ /*     Read a new token from the current input stream. This function     */ /*     extracts a token from the font program until "Open_PrivateDict"   */ /*     has been called. After this, it returns tokens from the           */ /*     (eexec-encrypted) private dictionnary..                           */ /*                                                                       */ /*  <Input>                                                              */ /*     tokenizer :: target tokenizer object                              */ /*                                                                       */ /*  <Return>                                                             */ /*     Type1 error code. 0 means success..                               */ /*                                                                       */ /*  <Note>                                                               */ /*     One should use the function Read_CharStrings to read the binary   */ /*     charstrings from the private dict..                               */ /*                                                                       */ LOCAL_DEF T1_Error  Read_Token( T1_Tokenizer  tokenizer );#if 0 /*************************************************************************/ /*                                                                       */ /*  <Function> Read_CharStrings                                          */ /*                                                                       */ /*  <Description>                                                        */ /*     Read a charstrings from the current input stream. These are       */ /*     binary bytes that encode each individual glyph outline.           */ /*                                                                       */ /*  <Input>                                                              */ /*     tokenizer :: target tokenizer object                              */ /*     num_chars :: number of binary bytes to read                       */ /*                                                                       */ /*  <Output>                                                             */ /*     buffer    :: target array of bytes. These are eexec-decrypted..   */ /*                                                                       */ /*  <Return>                                                             */ /*     Type1 error code. 0 means success..                               */ /*                                                                       */ /*  <Note>                                                               */ /*     One should use the function Read_CharStrings to read the binary   */ /*     charstrings from the private dict..                               */ /*                                                                       */ LOCAL_DEF T1_Error  Read_CharStrings( T1_Tokenizer  tokenizer,                             T1_Int        num_chars,                             T1_Byte*      buffer );#endif /*************************************************************************/ /*                                                                       */ /*  <Function> t1_decrypt                                                */ /*                                                                       */ /*  <Description>                                                        */ /*     Performs the Type 1 charstring decryption process..               */ /*                                                                       */ /*  <Input>                                                              */ /*     buffer  :: base address of data to decrypt                        */ /*     length  :: number of bytes to decrypt from base address           */ /*     seed    :: ecnryption seed (4330 for charstrings).                */ /*                                                                       */  LOCAL_DEF  void  t1_decrypt( T1_Byte*   buffer,                    T1_Int     length,                    T1_UShort  seed );#endif /* T1TOKENS_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -