oaFont.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaFont.h
00004 //
00005 // This file contains the definition for the oaFont class. This class implements
00006 // an enumerated font type. It also implements methods for calculating the bBox
00007 // of any text string in a specified font with a specified set of attributes.
00008 //
00009 // *****************************************************************************
00010 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00011 // Integration Initiative, this material may not be copied, modified,
00012 // re-published, uploaded, executed, or distributed in any way, in any medium,
00013 // in whole or in part, without prior written permission from Cadence.
00014 //
00015 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00016 //                           All Rights Reserved.
00017 //
00018 //  $Author: icftcm $
00019 //  $Revision: #1 $
00020 //  $Date: 2010/08/09 $
00021 //  $State: Exp $
00022 // *****************************************************************************
00023 // *****************************************************************************
00024 
00025 
00026 
00027 #if !defined(oaFont_P)
00028 #define oaFont_P
00029 
00030 
00031 
00032 // *****************************************************************************
00033 // Nested includes
00034 // *****************************************************************************
00035 #include "oaOrient.h"
00036 #include "oaBox.h"
00037 #include "oaTextAlign.h"
00038 
00039 
00040 
00041 // *****************************************************************************
00042 // Declare and define types in the OpenAccess namespace.
00043 // *****************************************************************************
00044 BEGIN_OA_NAMESPACE
00045 
00046 
00047 
00048 // *****************************************************************************
00049 // oaFontEnum
00050 // *****************************************************************************
00051 #define oavNumFonts 9
00052 
00053 enum oaFontEnum {
00054     oacEuroStyleFont    = 0,
00055     oacGothicFont       = 1,
00056     oacMathFont         = 2,
00057     oacRomanFont        = 3,
00058     oacScriptFont       = 4,
00059     oacStickFont        = 5,
00060     oacFixedFont        = 6,
00061     oacSwedishFont      = 7,
00062     oacMilSpecFont      = 8
00063 };
00064 
00065 
00066 
00067 // *****************************************************************************
00068 // oaFont
00069 // *****************************************************************************
00070 class OA_DESIGN_DLL_API oaFont {
00071 public:
00072                             oaFont();
00073                             oaFont(oaFontEnum valueIn);
00074                             oaFont(const oaString &name);
00075                             ~oaFont();
00076 
00077     void                    calcBBox(const oaPoint  &origin,
00078                                      const oaString &text,
00079                                      oaDist         height,
00080                                      oaTextAlign    textAlign,
00081                                      oaOrient       orient,
00082                                      oaBoolean      hasOverbar,
00083                                      oaBox          &bBox);
00084     void                    calcBBox(const oaPoint  &origin,
00085                                      const oaChar   *text,
00086                                      oaDist         height,
00087                                      oaTextAlign    textAlign,
00088                                      oaOrient       orient,
00089                                      oaBoolean      hasOverbar,
00090                                      oaBox          &bBox);
00091 
00092     const oaString          &getName() const;
00093 
00094                             operator                oaFontEnum() const;
00095 
00096 private:
00097     oaFontEnum              value;
00098 
00099     static const oaUInt4    overbarAdjust;
00100     static const oaUInt4    widthAdjust;
00101     static const oaUInt4    heightAdjust;
00102     static const oaUInt4    tabColumns;
00103     static const oaByte     tabWidthCharIndex;
00104     static const oaString   names[];
00105 };
00106 
00107 
00108 
00109 END_OA_NAMESPACE
00110 
00111 #endif

Return to top of page