home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / wv2 / fonts.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-08-07  |  2.1 KB  |  70 lines

  1. /* This file is part of the wvWare 2 project
  2.    Copyright (C) 2002-2003 Werner Trobin <trobin@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16.    Boston, MA 02111-1307, USA.
  17. */
  18.  
  19. #ifndef FONTS_H
  20. #define FONTS_H
  21.  
  22. #include "global.h"
  23. #include <vector>
  24.  
  25. namespace wvWare
  26. {
  27.     class OLEStreamReader;
  28.     namespace Word97
  29.     {
  30.         struct FIB;
  31.         struct FFN;
  32.     }
  33.  
  34.     /**
  35.      * The FontCollection can be used to map ftc (font code) values to font names.
  36.      */
  37.     class FontCollection
  38.     {
  39.     public:
  40.         /**
  41.          * You shouldn't construct such objects yourself, the Parser interface
  42.          * provides accesst to the internal font collection.
  43.          * @param reader is either a table or a document stream (97+ / older versions)
  44.          */
  45.         FontCollection( OLEStreamReader* reader, const Word97::FIB& fib );
  46.         ~FontCollection();
  47.  
  48.         /**
  49.          * Returns the matching FFN structure for the given font code. If no matching
  50.          * FFN is found, a fallback defaulting to "Helvetica" is returned.
  51.          */
  52.         const Word97::FFN& font( S16 ftc ) const;
  53.  
  54.         /**
  55.          * Dump all the font information, used for debugging.
  56.          */
  57.         void dump() const;
  58.  
  59.     private:
  60.         FontCollection( const FontCollection& rhs );
  61.         FontCollection& operator=( const FontCollection& rhs );
  62.  
  63.         std::vector<Word97::FFN*> m_fonts;
  64.         Word97::FFN* m_fallbackFont;
  65.     };
  66.  
  67. } // namespace wvWare
  68.  
  69. #endif // FONTS_H
  70.