00001 // Filename: pkFontFile.h 00002 // Created by: drose (18Feb01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef PKFONTFILE_H 00020 #define PKFONTFILE_H 00021 00022 #include <pandatoolbase.h> 00023 00024 #include "fontFile.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : PkFontFile 00028 // Description : A specialization on FontFile for reading TeX-style 00029 // .pk fonts. 00030 //////////////////////////////////////////////////////////////////// 00031 class PkFontFile : public FontFile { 00032 public: 00033 PkFontFile(); 00034 00035 virtual bool read(const Filename &filename, 00036 bool extract_all, const string &extract_only); 00037 00038 private: 00039 unsigned int fetch_nibble(); 00040 unsigned int fetch_packed_int(); 00041 unsigned int fetch_byte(); 00042 unsigned int fetch_int(int n = 4); 00043 int fetch_signed_int(int n = 4); 00044 bool do_character(int flag_byte); 00045 void do_xxx(int num_bytes); 00046 void do_yyy(); 00047 void do_post(); 00048 void do_pre(); 00049 bool read_pk(); 00050 00051 bool _post; 00052 bool _post_warning; 00053 int _p; 00054 bool _high; 00055 int _dyn_f; 00056 int _repeat_count; 00057 00058 bool _extract_all; 00059 string _extract_only; 00060 00061 pvector<unsigned char> _pk; 00062 }; 00063 00064 #endif