ccpanose.cpp

Go to the documentation of this file.
00001 // $Id: ccpanose.cpp 836 2006-04-18 16:06:15Z gerry $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 /********************************************************************************************
00099 
00100 >   CCPanose.cpp
00101 
00102     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00103     Created:    24/05/06
00104     SeeAlso:    <???>
00105 
00106 ********************************************************************************************/
00107 
00108 #include "camtypes.h"
00109 #include "ccpanose.h"
00110 
00111 CC_IMPLEMENT_DYNCREATE( CCPanose, CCObject )
00112 
00113 /********************************************************************************************
00114 
00115 >   CCPanose::CCPanose()
00116 
00117     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00118     Created:    24/05/96
00119     Inputs:     -
00120     Returns:    -
00121     Purpose:    Default constructor for class CCPanose
00122 
00123 ********************************************************************************************/
00124 
00125 CCPanose::CCPanose()
00126 {
00127     SetAllToAny();
00128 }
00129 
00130 /********************************************************************************************
00131 
00132 >   CCPanose::CCPanose(const PANOSE &PanoseNumber)
00133 
00134     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00135     Created:    15/08/96
00136     Inputs:     PanoseNumber    - panose number to copy
00137     Returns:    -
00138     Purpose:    Constructor
00139 
00140 ********************************************************************************************/
00141 
00142 CCPanose::CCPanose(const PANOSE &PanoseNumber)
00143 {
00144     mFamilyType         = PanoseNumber.bFamilyType;
00145     mSerifStyle         = PanoseNumber.bSerifStyle; 
00146     mWeight             = PanoseNumber.bWeight; 
00147     mProportion         = PanoseNumber.bProportion; 
00148     mContrast           = PanoseNumber.bContrast;
00149     mStrokeVariation    = PanoseNumber.bStrokeVariation; 
00150     mArmStyle           = PanoseNumber.bArmStyle; 
00151     mLetterform         = PanoseNumber.bLetterform; 
00152     mMidline            = PanoseNumber.bMidline; 
00153     mXHeight            = PanoseNumber.bXHeight;    
00154 }
00155 
00156 /********************************************************************************************
00157 
00158 >   void CCPanose::SetAllToAny()
00159 
00160     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00161     Created:    24/07/96
00162     Inputs:     -
00163     Returns:    -
00164     Purpose:    Sets all 10 components of the Panose number to PAN_ANY
00165 
00166 ********************************************************************************************/
00167 
00168 void CCPanose::SetAllToAny()
00169 {
00170     SetAll(PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY, PAN_ANY);
00171 }
00172 
00173 /********************************************************************************************
00174 
00175 >   void CCPanose::SetAll(
00176             BYTE FamilyType,
00177             BYTE SerifStyle,
00178             BYTE Weight,
00179             BYTE Proportion,
00180             BYTE Contrast,
00181             BYTE StrokeVariation,
00182             BYTE ArmStyle,
00183             BYTE LetterForm,
00184             BYTE Midline,
00185             BYTE XHeight);
00186 
00187     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00188     Created:    24/07/96
00189     Inputs:     Obvious really - the 10 components of the Panose number
00190     Returns:    -
00191     Purpose:    Sets the components of the Panose number to those given
00192 
00193 ********************************************************************************************/
00194 
00195 void CCPanose::SetAll(
00196         BYTE FamilyType,
00197         BYTE SerifStyle,
00198         BYTE Weight,
00199         BYTE Proportion,
00200         BYTE Contrast,
00201         BYTE StrokeVariation,
00202         BYTE ArmStyle,
00203         BYTE LetterForm,
00204         BYTE Midline,
00205         BYTE XHeight)
00206 {
00207     mFamilyType         = FamilyType;
00208     mSerifStyle         = SerifStyle; 
00209     mWeight             = Weight; 
00210     mProportion         = Proportion; 
00211     mContrast           = Contrast;
00212     mStrokeVariation    = StrokeVariation; 
00213     mArmStyle           = ArmStyle; 
00214     mLetterform         = LetterForm; 
00215     mMidline            = Midline; 
00216     mXHeight            = XHeight; 
00217 }
00218 
00219 /********************************************************************************************
00220 
00221 >   void CCPanose::operator=(const CCPanose & x)
00222 
00223     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00224     Created:    24/07/96
00225     Inputs:     x - another CCPanose object to copy
00226     Returns:    -
00227     Purpose:    Copies a CCPanose object
00228 
00229 ********************************************************************************************/
00230 
00231 void CCPanose::operator=(const CCPanose & x)
00232 {
00233     this->mFamilyType = x.mFamilyType;
00234     this->mSerifStyle = x.mSerifStyle; 
00235     this->mWeight = x.mWeight; 
00236     this->mProportion = x.mProportion; 
00237     this->mContrast = x.mContrast; 
00238     this->mStrokeVariation = x.mStrokeVariation; 
00239     this->mArmStyle = x.mArmStyle; 
00240     this->mLetterform = x.mLetterform; 
00241     this->mMidline = x.mMidline; 
00242     this->mXHeight = x.mXHeight; 
00243 }
00244 
00245 /********************************************************************************************
00246 
00247 >   BOOL CCPanose::BodgeCCPanose(CCPanose *pCCPanose, BOOL Bold, BOOL Italic)
00248 
00249     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00250     Created:    26/07/96
00251     Inputs:     Bold    - Bold flag to bodge in
00252                 Italic  - Italic flag to bodge in
00253     Returns:    TRUE if successful, FALSE otherwise
00254     Purpose:    Bodges the bold and italic flags into the Weight and Letterform components.
00255 
00256 ********************************************************************************************/
00257 
00258 BOOL CCPanose::BodgePanoseNumber(BOOL IsBold, BOOL IsItalic)
00259 {
00260     if (mFamilyType != PAN_FAMILY_PICTORIAL)
00261     {
00262         // only do this if we're not a symbol font
00263 
00264         if (IsBold==FALSE)
00265         {
00266             // regular font
00267             if (mWeight==PAN_ANY || mWeight==PAN_NO_FIT || mWeight>PAN_WEIGHT_MEDIUM)
00268             {
00269                 mWeight=PAN_WEIGHT_MEDIUM;
00270             }
00271         }
00272         else
00273         {
00274             // bold font
00275             if (mWeight==PAN_ANY || mWeight==PAN_NO_FIT || mWeight<PAN_WEIGHT_BOLD)
00276             {
00277                 mWeight=PAN_WEIGHT_BOLD;
00278             }
00279         }
00280 
00281         if (IsItalic==FALSE)
00282         {
00283             // upright font
00284             if (mLetterform==PAN_ANY || mLetterform==PAN_NO_FIT)
00285             {
00286                 mLetterform=PAN_LETT_NORMAL_CONTACT;
00287             }
00288             else if (mLetterform>=PAN_LETT_OBLIQUE_CONTACT && mLetterform<=PAN_LETT_OBLIQUE_SQUARE)
00289             {
00290                 mLetterform=mLetterform-7;      // !!HACK!!
00291             }
00292         }
00293         else
00294         {
00295             // italic font
00296             if (mLetterform==PAN_ANY || mLetterform==PAN_NO_FIT)
00297             {
00298                 mLetterform=PAN_LETT_OBLIQUE_CONTACT;
00299             }
00300             else if (mLetterform>=PAN_LETT_NORMAL_CONTACT && mLetterform<=PAN_LETT_NORMAL_SQUARE)
00301             {
00302                 mLetterform=mLetterform+7;      // !!HACK!!
00303             }
00304         }
00305 
00306     }
00307     
00308     return TRUE;    // we have succeeded, haven't we?
00309 }
00310 
00311 /********************************************************************************************
00312 
00313 >   BOOL CCPanose::BodgeToNormal()
00314 
00315     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00316     Created:    19/08/96
00317     Inputs:     -
00318     Returns:    TRUE if successful, FALSE otherwise
00319     Purpose:    Bodges the Panose number to normalise it, i.e. regular weight, non-italic.
00320     See Also:   CCPanose::BodgePanoseNumber
00321 
00322 ********************************************************************************************/
00323 
00324 BOOL CCPanose::BodgeToNormal()
00325 {
00326     return BodgePanoseNumber(FALSE, FALSE);
00327 }
00328 
00329 /********************************************************************************************
00330 
00331 >   UINT32 CCPanose::Distance(const CCPanose &x, const CCPanose &y)
00332     UINT32 CCPanose::DistanceFamilyType(BYTE x, BYTE y);
00333     UINT32 CCPanose::DistanceSerifStyle(BYTE x, BYTE y);
00334     UINT32 CCPanose::DistanceWeight(BYTE x, BYTE y);
00335     UINT32 CCPanose::DistanceProportion(BYTE x, BYTE y);
00336     UINT32 CCPanose::DistanceContrast(BYTE x, BYTE y);
00337     UINT32 CCPanose::DistanceStrokeVariation(BYTE x, BYTE y);
00338     UINT32 CCPanose::DistanceArmStyle(BYTE x, BYTE y);
00339     UINT32 CCPanose::DistanceLetterform(BYTE x, BYTE y);
00340     UINT32 CCPanose::DistanceMidline(BYTE x, BYTE y);
00341     UINT32 CCPanose::DistanceXHeighte(BYTE x, BYTE y);
00342 
00343     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00344     Created:    19/08/96
00345     Inputs:     x, y    - CCPanose objects to determine the distance between
00346     Returns:    distance between x and y, as a CCPanoseDistance object
00347     Purpose:    Calculates the distance between x and y
00348     See Also:   class CCPanose
00349 
00350 ********************************************************************************************/
00351 
00352 UINT32 CCPanose::Distance(const CCPanose &x, const CCPanose &y)
00353 {
00354     UINT32 Distance = 0;
00355 
00356     Distance += DistanceFamilyType(x.mFamilyType, y.mFamilyType);
00357     Distance += DistanceSerifStyle(x.mSerifStyle, y.mSerifStyle);
00358     Distance += DistanceWeight(x.mWeight, y.mWeight);
00359     Distance += DistanceProportion(x.mProportion, y.mProportion);
00360     Distance += DistanceContrast(x.mContrast, y.mContrast);
00361     Distance += DistanceStrokeVariation(x.mStrokeVariation, y.mStrokeVariation);
00362     Distance += DistanceArmStyle(x.mArmStyle, y.mArmStyle);
00363     Distance += DistanceLetterform(x.mLetterform, y.mLetterform);
00364     Distance += DistanceMidline(x.mMidline, y.mMidline);
00365     Distance += DistanceXHeight(x.mXHeight, y.mXHeight);
00366     
00367     return Distance;
00368 }
00369 
00370 UINT32 CCPanose::DistanceFamilyType(BYTE x, BYTE y)
00371 {
00372     //  Specifies the font family.
00373     //  
00374     //  Value   Meaning
00375     //  
00376     //      0   Any
00377     //      1   No fit
00378     //      2   Text and display
00379     //      3   Script
00380     //      4   Decorative
00381     //      5   Pictorial
00382     //  
00383     //  High weightings, since we _really_ want a font from the same family.
00384     
00385     const static UINT32 Metric[6][6] = {
00386         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00387         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00388         {0x00001000, 0x01000000, 0x00000000, 0x000000ff, 0x000000ff, 0x000000ff},
00389         {0x00001000, 0x01000000, 0x000000ff, 0x00000000, 0x000000ff, 0x000000ff},
00390         {0x00001000, 0x01000000, 0x000000ff, 0x000000ff, 0x00000000, 0x000000ff},
00391         {0x00001000, 0x01000000, 0x000000ff, 0x000000ff, 0x000000ff, 0x00000000}};
00392 
00393     if ( x>5) x = 1;
00394     if ( y>5) y = 1;
00395 
00396     return Metric[x][y];
00397 }
00398 
00399 UINT32 CCPanose::DistanceSerifStyle(BYTE x, BYTE y)
00400 {
00401     const static UINT32 Metric[16][16] = {
00402         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00403         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00404         {0x00001000, 0x01000000, 0x00000000, 0x00000004, 0x00000004, 0x00000004, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000010},
00405         {0x00001000, 0x01000000, 0x00000004, 0x00000000, 0x00000004, 0x00000004, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000010},
00406         {0x00001000, 0x01000000, 0x00000004, 0x00000004, 0x00000000, 0x00000004, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000010},
00407         {0x00001000, 0x01000000, 0x00000004, 0x00000004, 0x00000004, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000010},
00408         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020},
00409         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020},
00410         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020},
00411         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020},
00412         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020},
00413         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000000, 0x00000010, 0x00000010, 0x00000040, 0x00000040},
00414         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000000, 0x00000010, 0x00000040, 0x00000040},
00415         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000010, 0x00000000, 0x00000040, 0x00000040},
00416         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000000, 0x00000020},
00417         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000000}};
00418 
00419     if ( x>15) x = 1;
00420     if ( y>15) y = 1;
00421 
00422     return Metric[x][y];
00423 }
00424 
00425 UINT32 CCPanose::DistanceWeight(BYTE x, BYTE y)
00426 {
00427     const static UINT32 Metric[12][12] = {
00428         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00429         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00430         {0x00001000, 0x01000000, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019, 0x00000024, 0x00000031, 0x00000040, 0x00000051},
00431         {0x00001000, 0x01000000, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019, 0x00000024, 0x00000031, 0x00000040},
00432         {0x00001000, 0x01000000, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019, 0x00000024, 0x00000031},
00433         {0x00001000, 0x01000000, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019, 0x00000024},
00434         {0x00001000, 0x01000000, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019},
00435         {0x00001000, 0x01000000, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010},
00436         {0x00001000, 0x01000000, 0x00000024, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009},
00437         {0x00001000, 0x01000000, 0x00000031, 0x00000024, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004},
00438         {0x00001000, 0x01000000, 0x00000040, 0x00000031, 0x00000024, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001},
00439         {0x00001000, 0x01000000, 0x00000051, 0x00000040, 0x00000031, 0x00000024, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000}};
00440 
00441     if ( x>11) x = 1;
00442     if ( y>11) y = 1;
00443 
00444     return Metric[x][y];
00445 }
00446 
00447 UINT32 CCPanose::DistanceProportion(BYTE x, BYTE y)
00448 {
00449     const static UINT32 Metric[10][10] = {
00450         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00451         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00452         {0x00001000, 0x01000000, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00453         {0x00001000, 0x01000000, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00454         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00455         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000040, 0x00000004, 0x00000080, 0x00000040},
00456         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000000, 0x00000080, 0x00000004, 0x00000040},
00457         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000004, 0x00000080, 0x00000000, 0x000000c0, 0x00000080},
00458         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000080, 0x00000004, 0x000000c0, 0x00000000, 0x00000080},
00459         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000080, 0x00000080, 0x00000000}};
00460 
00461     if ( x>9) x = 1;
00462     if ( y>9) y = 1;
00463 
00464     return Metric[x][y];
00465 }
00466 
00467 UINT32 CCPanose::DistanceContrast(BYTE x, BYTE y)
00468 {
00469     const static UINT32 Metric[10][10] = {
00470         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00471         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00472         {0x00001000, 0x01000000, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019, 0x00000024, 0x00000031},
00473         {0x00001000, 0x01000000, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019, 0x00000024},
00474         {0x00001000, 0x01000000, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010, 0x00000019},
00475         {0x00001000, 0x01000000, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009, 0x00000010},
00476         {0x00001000, 0x01000000, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004, 0x00000009},
00477         {0x00001000, 0x01000000, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001, 0x00000004},
00478         {0x00001000, 0x01000000, 0x00000024, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000, 0x00000001},
00479         {0x00001000, 0x01000000, 0x00000031, 0x00000024, 0x00000019, 0x00000010, 0x00000009, 0x00000004, 0x00000001, 0x00000000}};
00480 
00481     if ( x>9) x = 1;
00482     if ( y>9) y = 1;
00483 
00484     return Metric[x][y];
00485 }
00486 
00487 UINT32 CCPanose::DistanceStrokeVariation(BYTE x, BYTE y)
00488 {
00489     const static UINT32 Metric[9][9] = {
00490         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00491         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00492         {0x00001000, 0x01000000, 0x00000000, 0x00000010, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000040},
00493         {0x00001000, 0x01000000, 0x00000010, 0x00000000, 0x00000010, 0x00000010, 0x00000020, 0x00000020, 0x00000040},
00494         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000000, 0x00000010, 0x00000020, 0x00000020, 0x00000040},
00495         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000010, 0x00000000, 0x00000020, 0x00000020, 0x00000040},
00496         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000010, 0x00000020},
00497         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000010, 0x00000000, 0x00000020},
00498         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020, 0x00000000}};
00499 
00500     if ( x>8) x = 1;
00501     if ( y>8) y = 1;
00502 
00503     return Metric[x][y];
00504 }
00505 
00506 UINT32 CCPanose::DistanceArmStyle(BYTE x, BYTE y)
00507 {
00508     const static UINT32 Metric[12][12] = {
00509         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00510         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00511         {0x00001000, 0x01000000, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040},
00512         {0x00001000, 0x01000000, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040},
00513         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040},
00514         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040},
00515         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010},
00516         {0x00001000, 0x01000000, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00517         {0x00001000, 0x01000000, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020},
00518         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020},
00519         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020},
00520         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000}};
00521 
00522     if ( x>11) x = 1;
00523     if ( y>11) y = 1;
00524 
00525     return Metric[x][y];
00526 }
00527 
00528 UINT32 CCPanose::DistanceLetterform(BYTE x, BYTE y)
00529 {
00530     const static UINT32 Metric[16][16] = {
00531         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00532         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00533         {0x00001000, 0x01000000, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040},
00534         {0x00001000, 0x01000000, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040},
00535         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040},
00536         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040},
00537         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040},
00538         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040},
00539         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010},
00540         {0x00001000, 0x01000000, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00541         {0x00001000, 0x01000000, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00542         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020, 0x00000020},
00543         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000040, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020, 0x00000020},
00544         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000040, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020, 0x00000020},
00545         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000040, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000, 0x00000020},
00546         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000040, 0x00000010, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000020, 0x00000000}};
00547 
00548     if ( x>15) x = 1;
00549     if ( y>15) y = 1;
00550 
00551     return Metric[x][y];
00552 }
00553 
00554 UINT32 CCPanose::DistanceMidline(BYTE x, BYTE y)
00555 {
00556     const static UINT32 Metric[14][14] = {
00557         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00558         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00559         {0x00001000, 0x01000000, 0x00000000, 0x00000010, 0x00000010, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040},
00560         {0x00001000, 0x01000000, 0x00000010, 0x00000000, 0x00000010, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040},
00561         {0x00001000, 0x01000000, 0x00000010, 0x00000010, 0x00000000, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020},
00562         {0x00001000, 0x01000000, 0x00000020, 0x00000040, 0x00000040, 0x00000000, 0x00000010, 0x00000010, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040},
00563         {0x00001000, 0x01000000, 0x00000040, 0x00000020, 0x00000040, 0x00000010, 0x00000000, 0x00000010, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040},
00564         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000020, 0x00000010, 0x00000010, 0x00000000, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020},
00565         {0x00001000, 0x01000000, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000000, 0x00000010, 0x00000010, 0x00000020, 0x00000040, 0x00000040},
00566         {0x00001000, 0x01000000, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000010, 0x00000000, 0x00000010, 0x00000040, 0x00000020, 0x00000040},
00567         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000010, 0x00000010, 0x00000000, 0x00000040, 0x00000040, 0x00000020},
00568         {0x00001000, 0x01000000, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000000, 0x00000010, 0x00000010},
00569         {0x00001000, 0x01000000, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000010, 0x00000000, 0x00000010},
00570         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000040, 0x00000040, 0x00000020, 0x00000010, 0x00000010, 0x00000000}};
00571 
00572     if ( x>13) x = 1;
00573     if ( y>13) y = 1;
00574 
00575     return Metric[x][y];
00576 }
00577 
00578 UINT32 CCPanose::DistanceXHeight(BYTE x, BYTE y)
00579 {
00580     const static UINT32 Metric[8][8] = {
00581         {0x00010000, 0x00100000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000, 0x00001000},
00582         {0x00100000, 0x10000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000, 0x01000000},
00583         {0x00001000, 0x01000000, 0x00000000, 0x00000020, 0x00000020, 0x00000010, 0x00000040, 0x00000040},
00584         {0x00001000, 0x01000000, 0x00000020, 0x00000000, 0x00000020, 0x00000040, 0x00000010, 0x00000040},
00585         {0x00001000, 0x01000000, 0x00000020, 0x00000020, 0x00000000, 0x00000040, 0x00000040, 0x00000010},
00586         {0x00001000, 0x01000000, 0x00000010, 0x00000040, 0x00000040, 0x00000000, 0x00000020, 0x00000020},
00587         {0x00001000, 0x01000000, 0x00000040, 0x00000010, 0x00000040, 0x00000020, 0x00000000, 0x00000020},
00588         {0x00001000, 0x01000000, 0x00000040, 0x00000040, 0x00000010, 0x00000020, 0x00000020, 0x00000000}};
00589 
00590     if ( x>7) x = 1;
00591     if ( y>7) y = 1;
00592 
00593     return Metric[x][y];
00594 }
00595 
00596 /********************************************************************************************
00597 
00598 >   void CCPanose::GetDebugDetails(StringBase * Str)
00599 
00600     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00601     Created:    24/05/96
00602     Inputs:     Pointer to a StringBase
00603     Returns:    -
00604     Purpose:    Adds to PANOSE debug information to (*Str)
00605 
00606 ********************************************************************************************/
00607 
00608 void CCPanose::GetDebugDetails(StringBase *pStr)
00609 {
00610     TCHAR               s[256], t[256];
00611 
00612     camSnprintf( s, 256, _T("\r\nPANOSE information\r\n\r\n") );
00613     (*pStr) += s;
00614     
00615     switch (mFamilyType)
00616     {
00617         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00618         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00619         case PAN_FAMILY_TEXT_DISPLAY        : camSnprintf( t, 256, _T("Text and display") ); break;
00620         case PAN_FAMILY_SCRIPT              : camSnprintf( t, 256, _T("Script") ); break;
00621         case PAN_FAMILY_DECORATIVE          : camSnprintf( t, 256, _T("Decorative") ); break;
00622         case PAN_FAMILY_PICTORIAL           : camSnprintf( t, 256, _T("Pictorial") ); break;
00623         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00624     }
00625 
00626     camSnprintf( s, 256, _T("Family Type\t= (%d) %s\r\n") , mFamilyType, t);
00627     (*pStr) += s;
00628 
00629     switch (mSerifStyle)
00630     {
00631         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00632         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00633         case PAN_SERIF_COVE                 : camSnprintf( t, 256, _T("Cove") ); break;
00634         case PAN_SERIF_OBTUSE_COVE          : camSnprintf( t, 256, _T("Obtuse cove") ); break;
00635         case PAN_SERIF_SQUARE_COVE          : camSnprintf( t, 256, _T("Square cove") ); break;
00636         case PAN_SERIF_OBTUSE_SQUARE_COVE   : camSnprintf( t, 256, _T("Obtuse square cove") ); break;
00637         case PAN_SERIF_SQUARE               : camSnprintf( t, 256, _T("Square   ") ); break;
00638         case PAN_SERIF_THIN                 : camSnprintf( t, 256, _T("Thin") ); break;
00639         case PAN_SERIF_BONE                 : camSnprintf( t, 256, _T("Bone") ); break;
00640         case PAN_SERIF_EXAGGERATED          : camSnprintf( t, 256, _T("Exaggerated") ); break;
00641         case PAN_SERIF_TRIANGLE             : camSnprintf( t, 256, _T("Triangle") ); break;
00642         case PAN_SERIF_NORMAL_SANS          : camSnprintf( t, 256, _T("Normal sans serif") ); break;
00643         case PAN_SERIF_OBTUSE_SANS          : camSnprintf( t, 256, _T("Obtuse sans serif") ); break;
00644         case PAN_SERIF_PERP_SANS            : camSnprintf( t, 256, _T("Perp sans serif") ); break;
00645         case PAN_SERIF_FLARED               : camSnprintf( t, 256, _T("Flared") ); break;
00646         case PAN_SERIF_ROUNDED              : camSnprintf( t, 256, _T("Rounded") ); break;
00647         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00648     }
00649 
00650     camSnprintf( s, 256, _T("Serif Style\t\t= (%d) %s\r\n") , mSerifStyle, t);
00651     (*pStr) += s;
00652     
00653     switch (mWeight)
00654     {
00655         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00656         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00657         case PAN_WEIGHT_VERY_LIGHT          : camSnprintf( t, 256, _T("Very light") ); break;
00658         case PAN_WEIGHT_LIGHT               : camSnprintf( t, 256, _T("Light") ); break;
00659         case PAN_WEIGHT_THIN                : camSnprintf( t, 256, _T("Thin") ); break;
00660         case PAN_WEIGHT_BOOK                : camSnprintf( t, 256, _T("Book") ); break;
00661         case PAN_WEIGHT_MEDIUM              : camSnprintf( t, 256, _T("Medium") ); break;
00662         case PAN_WEIGHT_DEMI                : camSnprintf( t, 256, _T("Demibold") ); break;
00663         case PAN_WEIGHT_BOLD                : camSnprintf( t, 256, _T("Bold") ); break;
00664         case PAN_WEIGHT_HEAVY               : camSnprintf( t, 256, _T("Heavy") ); break;
00665         case PAN_WEIGHT_BLACK               : camSnprintf( t, 256, _T("Black") ); break;
00666         case PAN_WEIGHT_NORD                : camSnprintf( t, 256, _T("Nord") ); break;
00667         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00668     }
00669 
00670     camSnprintf( s, 256, _T("Weight\t\t= (%d) %s\r\n") , mWeight, t);
00671     (*pStr) += s;
00672 
00673     switch (mProportion)
00674     {
00675         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00676         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00677         case PAN_PROP_OLD_STYLE             : camSnprintf( t, 256, _T("Old style") ); break;
00678         case PAN_PROP_MODERN                : camSnprintf( t, 256, _T("Modern") ); break;
00679         case PAN_PROP_EVEN_WIDTH            : camSnprintf( t, 256, _T("Even width") ); break;
00680         case PAN_PROP_EXPANDED              : camSnprintf( t, 256, _T("Expanded") ); break;
00681         case PAN_PROP_CONDENSED             : camSnprintf( t, 256, _T("Condensed") ); break;
00682         case PAN_PROP_VERY_EXPANDED         : camSnprintf( t, 256, _T("Very expanded") ); break;
00683         case PAN_PROP_VERY_CONDENSED        : camSnprintf( t, 256, _T("Very condensed") ); break;
00684         case PAN_PROP_MONOSPACED            : camSnprintf( t, 256, _T("Monospaced") ); break;
00685         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00686     }
00687 
00688     camSnprintf( s, 256, _T("Proportion\t= (%d) %s\r\n") , mProportion, t);
00689     (*pStr) += s;
00690     
00691     switch (mContrast)
00692     {
00693         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00694         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00695         case PAN_CONTRAST_NONE              : camSnprintf( t, 256, _T("None") ); break;
00696         case PAN_CONTRAST_VERY_LOW          : camSnprintf( t, 256, _T("Very low") ); break;
00697         case PAN_CONTRAST_LOW               : camSnprintf( t, 256, _T("Low") ); break;
00698         case PAN_CONTRAST_MEDIUM_LOW        : camSnprintf( t, 256, _T("Medium low") ); break;
00699         case PAN_CONTRAST_MEDIUM            : camSnprintf( t, 256, _T("Medium") ); break;
00700         case PAN_CONTRAST_MEDIUM_HIGH       : camSnprintf( t, 256, _T("Medium high") ); break;
00701         case PAN_CONTRAST_HIGH              : camSnprintf( t, 256, _T("High") ); break;
00702         case PAN_CONTRAST_VERY_HIGH         : camSnprintf( t, 256, _T("Very high") ); break;
00703         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00704     }
00705 
00706     camSnprintf( s, 256, _T("Contrast\t\t= (%d) %s\r\n") , mContrast, t);
00707     (*pStr) += s;
00708     
00709     switch (mStrokeVariation)
00710     {
00711         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00712         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00713         case PAN_STROKE_GRADUAL_DIAG        : camSnprintf( t, 256, _T("Gradual/diagonal") ); break;
00714         case PAN_STROKE_GRADUAL_TRAN        : camSnprintf( t, 256, _T("Gradual/transitional") ); break;
00715         case PAN_STROKE_GRADUAL_VERT        : camSnprintf( t, 256, _T("Gradual/vertical") ); break;
00716         case PAN_STROKE_GRADUAL_HORZ        : camSnprintf( t, 256, _T("Gradual/horizontal") ); break;
00717         case PAN_STROKE_RAPID_VERT          : camSnprintf( t, 256, _T("Rapid/vertical") ); break;
00718         case PAN_STROKE_RAPID_HORZ          : camSnprintf( t, 256, _T("Rapid/horizontal") ); break;
00719         case PAN_STROKE_INSTANT_VERT        : camSnprintf( t, 256, _T("Instant/vertical") ); break;
00720         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00721     }
00722 
00723     camSnprintf( s, 256, _T("Stroke Variation\t= (%d) %s\r\n") , mStrokeVariation, t);
00724     (*pStr) += s;
00725     
00726     switch (mArmStyle)
00727     {
00728         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00729         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00730         case PAN_STRAIGHT_ARMS_HORZ         : camSnprintf( t, 256, _T("Straight arms/horizontal") ); break;
00731         case PAN_STRAIGHT_ARMS_WEDGE        : camSnprintf( t, 256, _T("Straight arms/wedge") ); break;
00732         case PAN_STRAIGHT_ARMS_VERT         : camSnprintf( t, 256, _T("traight arms/vertical") ); break;
00733         case PAN_STRAIGHT_ARMS_SINGLE_SERIF : camSnprintf( t, 256, _T("Straight arms/single-serif") ); break;
00734         case PAN_STRAIGHT_ARMS_DOUBLE_SERIF : camSnprintf( t, 256, _T("Straight arms/double-serif") ); break;
00735         case PAN_BENT_ARMS_HORZ             : camSnprintf( t, 256, _T("Non-straight arms/horizontal") ); break;
00736         case PAN_BENT_ARMS_WEDGE            : camSnprintf( t, 256, _T("Non-straight arms/wedge") ); break;
00737         case PAN_BENT_ARMS_VERT             : camSnprintf( t, 256, _T("Non-straight arms/vertical") ); break;
00738         case PAN_BENT_ARMS_SINGLE_SERIF     : camSnprintf( t, 256, _T("Non-straight arms/single-serif") ); break;
00739         case PAN_BENT_ARMS_DOUBLE_SERIF     : camSnprintf( t, 256, _T("Non-straight arms/double-serif") ); break;
00740         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00741     }
00742 
00743     camSnprintf( s, 256, _T("Arm Style\t\t= (%d) %s\r\n") , mArmStyle, t);
00744     (*pStr) += s;
00745     
00746     switch (mLetterform)
00747     {
00748         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00749         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00750         case PAN_LETT_NORMAL_CONTACT        : camSnprintf( t, 256, _T("Normal/contact") ); break;
00751         case PAN_LETT_NORMAL_WEIGHTED       : camSnprintf( t, 256, _T("Normal/weighted") ); break;
00752         case PAN_LETT_NORMAL_BOXED          : camSnprintf( t, 256, _T("Normal/boxed") ); break;
00753         case PAN_LETT_NORMAL_FLATTENED      : camSnprintf( t, 256, _T("Normal/flattened") ); break;
00754         case PAN_LETT_NORMAL_ROUNDED        : camSnprintf( t, 256, _T("Normal/rounded") ); break;
00755         case PAN_LETT_NORMAL_OFF_CENTER     : camSnprintf( t, 256, _T("Normal/off center") ); break;
00756         case PAN_LETT_NORMAL_SQUARE         : camSnprintf( t, 256, _T("Normal/square") ); break;
00757         case PAN_LETT_OBLIQUE_CONTACT       : camSnprintf( t, 256, _T("Oblique/contact") ); break;
00758         case PAN_LETT_OBLIQUE_WEIGHTED      : camSnprintf( t, 256, _T("Oblique/weighted") ); break;
00759         case PAN_LETT_OBLIQUE_BOXED         : camSnprintf( t, 256, _T("Oblique/boxed") ); break;
00760         case PAN_LETT_OBLIQUE_FLATTENED     : camSnprintf( t, 256, _T("Oblique/flattened") ); break;
00761         case PAN_LETT_OBLIQUE_ROUNDED       : camSnprintf( t, 256, _T("Oblique/rounded") ); break;
00762         case PAN_LETT_OBLIQUE_OFF_CENTER    : camSnprintf( t, 256, _T("Oblique/off center") ); break;
00763         case PAN_LETT_OBLIQUE_SQUARE        : camSnprintf( t, 256, _T("Oblique/square") ); break;
00764         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00765     }
00766 
00767     camSnprintf( s, 256, _T("Letter Form\t= (%d) %s\r\n") , mLetterform, t);
00768     (*pStr) += s;
00769 
00770     switch (mMidline)
00771     {
00772         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00773         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00774         case PAN_MIDLINE_STANDARD_TRIMMED   : camSnprintf( t, 256, _T("Standard/trimmed") ); break;
00775         case PAN_MIDLINE_STANDARD_POINTED   : camSnprintf( t, 256, _T("Standard/pointed") ); break;
00776         case PAN_MIDLINE_STANDARD_SERIFED   : camSnprintf( t, 256, _T("Standard/serifed") ); break;
00777         case PAN_MIDLINE_HIGH_TRIMMED       : camSnprintf( t, 256, _T("High/trimmed") ); break;
00778         case PAN_MIDLINE_HIGH_POINTED       : camSnprintf( t, 256, _T("High/pointed") ); break;
00779         case PAN_MIDLINE_HIGH_SERIFED       : camSnprintf( t, 256, _T("High/serifed") ); break;
00780         case PAN_MIDLINE_CONSTANT_TRIMMED   : camSnprintf( t, 256, _T("Constant/trimmed") ); break;
00781         case PAN_MIDLINE_CONSTANT_POINTED   : camSnprintf( t, 256, _T("Constant/pointed") ); break;
00782         case PAN_MIDLINE_CONSTANT_SERIFED   : camSnprintf( t, 256, _T("Constant/serifed") ); break;
00783         case PAN_MIDLINE_LOW_TRIMMED        : camSnprintf( t, 256, _T("Low/trimmed") ); break;
00784         case PAN_MIDLINE_LOW_POINTED        : camSnprintf( t, 256, _T("Low/pointed") ); break;
00785         case PAN_MIDLINE_LOW_SERIFED        : camSnprintf( t, 256, _T("Low/serifed") ); break;
00786         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00787     }
00788 
00789     camSnprintf( s, 256, _T("Midline\t\t= (%d) %s\r\n") , mMidline, t);
00790     (*pStr) += s;
00791 
00792     switch (mXHeight)
00793     {
00794         case PAN_ANY                        : camSnprintf( t, 256, _T("Any") ); break;
00795         case PAN_NO_FIT                     : camSnprintf( t, 256, _T("No fit") ); break;
00796         case PAN_XHEIGHT_CONSTANT_SMALL     : camSnprintf( t, 256, _T("Constant/small") ); break;
00797         case PAN_XHEIGHT_CONSTANT_STD       : camSnprintf( t, 256, _T("Constant/standard") ); break;
00798         case PAN_XHEIGHT_CONSTANT_LARGE     : camSnprintf( t, 256, _T("Constant/large") ); break;
00799         case PAN_XHEIGHT_DUCKING_SMALL      : camSnprintf( t, 256, _T("Ducking/small") ); break;
00800         case PAN_XHEIGHT_DUCKING_STD        : camSnprintf( t, 256, _T("Ducking/standard") ); break;
00801         case PAN_XHEIGHT_DUCKING_LARGE      : camSnprintf( t, 256, _T("Ducking/large") ); break;
00802         default                             : camSnprintf( t, 256, _T("!! Unknown !! (tell Andy)") ); break;
00803     }
00804 
00805     camSnprintf( s, 256, _T("XHeight\t\t= (%d) %s\r\n") , mXHeight, t);
00806     (*pStr) += s;
00807 }

Generated on Sat Nov 10 03:44:39 2007 for Camelot by  doxygen 1.4.4