Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

LASiWrapper.h

Go to the documentation of this file.
00001 
00002 //
00003 // This file is part of the MADELINE 2 program 
00004 // written by Edward H. Trager, Ritu Khanna and Adrian Marrs
00005 // Copyright (c) 2005 by the
00006 // Regents of the University of Michigan.
00007 // All Rights Reserved.
00008 // 
00009 // The latest version of this program is available from:
00010 // 
00011 //   http://eyegene.ophthy.med.umich.edu/madeline/
00012 //   
00013 // Released under the GNU General Public License.
00014 // A copy of the GPL is included in the distribution
00015 // package of this software, or see:
00016 // 
00017 //   http://www.gnu.org/copyleft/
00018 //   
00019 // ... for licensing details.
00020 // 
00022 //
00023 // 2007.03.28.RK.
00024 //
00025 
00026 //
00027 // LASiWrapper.h
00028 //
00029 // -- Wraps LASi methods and postscript document giving the user the flexibility
00030 // to compile without LASi, Pango and Freetype2
00031 // 
00032 #ifndef LASiWrapper_INCLUDED
00033 #define LASiWrapper_INCLUDED
00034 
00035 #include <iostream>
00036 //
00037 // For font metrics
00038 // and Postscript output:
00039 // 
00040 #ifdef LASI
00041 #include <LASi.h>
00042 #endif
00043 #include "DrawingMetrics.h"
00044 
00045 class LASiWrapper{
00046         
00047 private: 
00048         #ifdef LASI
00049         LASi::PostscriptDocument _doc1;
00050         #endif
00051         double _yMaximum;
00052         double _yMinimum;
00053         double _lineHeight;
00054         double _avgCharWidth;
00055 public:
00056         LASiWrapper(){
00057                 // Set constant values for lineHeight, yMaximum and yMinimum if the application is compiled without LASi 
00058                 #ifndef LASI
00059                         _lineHeight = 13.75;
00060                         _yMinimum = -1.87184;
00061                         _yMaximum = 6.84582;
00062                         _avgCharWidth = 6.0;
00063                 #endif
00064         }
00065         
00066         void setFont(const char* font);
00067         void setFontSize(double fontSize);
00068         void getDimensions(std::string sampleString,double* lineHeight,double* xAdvance, double* yMinimum, double* yMaximum);
00069         
00070 };
00071 
00072 #endif

Generated on Fri Nov 18 16:24:39 2011 for MADELINE by  doxygen 1.4.4