SGTTFItem Class Reference

A DisplayTree node for TrueType fonts in the Fonts SuperGallery. More...

#include <sgfonts.h>

Inheritance diagram for SGTTFItem:

SGDisplayPreviewFonts SGDisplayItem SGDisplayNode CCObject SimpleCCObject List of all members.

Public Member Functions

 SGTTFItem ()
 ~SGTTFItem ()
 SGTTFItem (KernelBitmap *PreviewFontsToDisplay, String_64 *Name, INT32 IL=0, PLOGFONT lpelf=NULL, UINT32 TheID=0)
 Constructor for installed truetype font gallery item.
virtual void GetFullInfoText (String_256 *Result)
 Returns the full-info text for this item, to support simple searching operations, and redraw methods for font items. Notes:.
virtual BOOL CreateThumbnail (KernelBitmap **Bitmap)
 Creates a bitmap for this font We assume the item contains a valid logfont structure.

Private Member Functions

 CC_DECLARE_DYNAMIC (SGTTFItem)

Detailed Description

A DisplayTree node for TrueType fonts in the Fonts SuperGallery.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/95
See also:
FontsSGallery; SuperGallery; SGDisplayItem

Definition at line 276 of file sgfonts.h.


Constructor & Destructor Documentation

SGTTFItem::SGTTFItem  ) 
 

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/95 Notes: DON'T call this constructor. It ERROR3's. Call the other constructor

Definition at line 1779 of file sgfonts.cpp.

01780 {
01781     ERROR3("Illegal call on default SGTTFItem constructor - call the other one!");
01782     CachedLogFont = NULL;
01783     IntLeading = 0;
01784     Type = FC_TRUETYPE;
01785 }

SGTTFItem::~SGTTFItem  ) 
 

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/10/95

Definition at line 1796 of file sgfonts.cpp.

01797 {
01798     if(CachedLogFont != NULL)
01799     {
01800         delete CachedLogFont;
01801         CachedLogFont = NULL;
01802     }
01803 }

SGTTFItem::SGTTFItem KernelBitmap PreviewFontsToDisplay,
String_64 FontName,
INT32  IL = 0,
PLOGFONT  lplf = NULL,
UINT32  TheID = 0
 

Constructor for installed truetype font gallery item.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/1/95
Parameters:
PreviewFontsToDisplay - A pointer to a kernel bitmap which will be used [INPUTS] by this item on redraws. FontName - Pointer to a description to place alongside the preview in the gallery IL - Internal leading value required by preview generation code - saves passing an entire newtextmetric about lplf - a pointer to a log font structure which corresponds to this item. We need to allocate memory and store the entire structure for each item at the moment so we can generate thumbnails later on. This needs sorting out at some point ! TheID - ID to associate item with... This is only really used for the filenames for saving at present.

Definition at line 1827 of file sgfonts.cpp.

01828 {
01829     // This should now be NULL since the font bitmaps are handled by the thumb cache
01830     ERROR3IF(PreviewFontsToDisplay != NULL, "SGTTFItem::SGTTFItem PreviewFontsToDisplay - This should now be NULL since the font bitmaps are handled by the thumb cache");
01831     
01832     FontBitmap = NULL; //PreviewFontsToDisplay;
01833     
01834     if(FontName != NULL)
01835         FontDescription = *FontName;
01836 
01837     CachedLogFont = NULL;
01838     if(lplf != NULL)
01839         CachedLogFont = new LOGFONT;
01840     if(CachedLogFont != NULL)
01841         *CachedLogFont = *lplf;
01842 
01843     ID = TheID;
01844     IntLeading = IL;
01845     Type = FC_TRUETYPE;
01846     Invalid = FALSE;
01847 }


Member Function Documentation

SGTTFItem::CC_DECLARE_DYNAMIC SGTTFItem   )  [private]
 

BOOL SGTTFItem::CreateThumbnail KernelBitmap **  Bitmap  )  [virtual]
 

Creates a bitmap for this font We assume the item contains a valid logfont structure.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/2/95
Parameters:
- [INPUTS]
*Bitmap contains the bitmap on exit [OUTPUTS]
Returns:
TRUE if the bmp was created successfully FALSE if it was not
If you are I (Richard) then this function can be told to save the thumbnail to disk... This is for generating the library thumbs...

Notes: Only works with 8 and 32 bpp bmps at the mo.

Reimplemented from SGDisplayPreviewFonts.

Definition at line 2013 of file sgfonts.cpp.

void SGTTFItem::GetFullInfoText String_256 Result  )  [virtual]
 

Returns the full-info text for this item, to support simple searching operations, and redraw methods for font items. Notes:.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/3/95
Parameters:
[INPUTS] 
Result - String to place resulting text in [OUTPUTS]
See also:

Reimplemented from SGDisplayPreviewFonts.

Definition at line 1867 of file sgfonts.cpp.

01868 {
01869     ERROR3IF(Result == NULL, "SGTTFItem::GetFullInfoText given null ptr");
01870 
01871     *Result = (String_256)FontDescription;
01872 
01873 #ifdef SGFONTS_FULLINFO_FOR_INSTALLED_FONTS
01874 
01875     PathName FOTFile;
01876     GetFOTNameFromRegistry(FontDescription, &FOTFile);
01877 
01878     *Result += " '"; // Debug
01879     *Result += TEXT(FOTFile.GetPath());
01880     *Result += "' - "; // Debug
01881 
01882     switch((CachedLogFont->lfPitchAndFamily & 0xf0))
01883     {
01884         case FF_DONTCARE:
01885             *Result += String_64(_R(IDS_FONTS_FF_DONTCARE)); // "Not classified"
01886             break;
01887         case FF_MODERN:
01888             *Result += String_64(_R(IDS_FONTS_FF_MODERN)); // "Modern"
01889             break;
01890         case FF_ROMAN:
01891             *Result += String_64(_R(IDS_FONTS_FF_ROMAN)); // "Roman"
01892             break;
01893         case FF_SCRIPT:
01894             *Result += String_64(_R(IDS_FONTS_FF_SCRIPT)); // "Script"
01895             break;
01896         case FF_SWISS:
01897             *Result += String_64(_R(IDS_FONTS_FF_SWISS)); // "Swiss"
01898             break;
01899         case FF_DECORATIVE:
01900             *Result += String_64(_R(IDS_FONTS_FF_DECORATIVE)); // "Decorative"
01901             break;
01902         default:
01903             *Result += String_64(_R(IDS_FONTS_UNRECOGNISED)); // "Unrecognised"
01904             break;
01905     }
01906 
01907     *Result += " - "; // Debug
01908 
01909     switch((CachedLogFont->lfPitchAndFamily & 0x0f))
01910     {
01911         case DEFAULT_PITCH:
01912             *Result += String_64(_R(IDS_FONTS_DEFAULT_PITCH)); // "Default pitch"
01913             break;
01914         case FIXED_PITCH:
01915             *Result += String_64(_R(IDS_FONTS_FIXED_PITCH)); // "Fixed pitch"
01916             break;
01917         case VARIABLE_PITCH:
01918             *Result += String_64(_R(IDS_FONTS_VARIABLE_PITCH)); // "Variable pitch"
01919             break;
01920     }
01921 
01922     *Result += " - "; // Debug
01923 
01924     switch(CachedLogFont->lfWeight)
01925     {
01926         case FW_DONTCARE:
01927             *Result += String_64(_R(IDS_FONTS_FW_DONTCARE)); // "No Weight"
01928             break;
01929         case FW_THIN:
01930             *Result += String_64(_R(IDS_FONTS_FW_THIN)); // "Thin"
01931             break;
01932         case FW_EXTRALIGHT:
01933             *Result += String_64(_R(IDS_FONTS_FW_EXTRALIGHT)); // "Extra Light"
01934             break;
01935         case FW_LIGHT:
01936             *Result += String_64(_R(IDS_FONTS_FW_LIGHT)); // "Light"
01937             break;
01938         case FW_NORMAL:
01939             *Result += String_64(_R(IDS_FONTS_FW_NORMAL)); // "Normal"
01940             break;
01941         case FW_MEDIUM:
01942             *Result += String_64(_R(IDS_FONTS_FW_MEDIUM)); // "Medium"
01943             break;
01944         case FW_SEMIBOLD:
01945             *Result += String_64(_R(IDS_FONTS_FW_SEMIBOLD)); // "Semi Bold"
01946             break;
01947         case FW_BOLD:
01948             *Result += String_64(_R(IDS_FONTS_FW_BOLD)); // "Bold"
01949             break;
01950         case FW_EXTRABOLD:
01951             *Result += String_64(_R(IDS_FONTS_FW_EXTRABOLD)); // "Extra Bold"
01952             break;
01953         case FW_HEAVY:
01954             *Result += String_64(_R(IDS_FONTS_FW_HEAVY)); // "Heavy"
01955             break;
01956     }
01957 
01958     *Result += " - ";// Debug
01959 
01960     switch((CachedLogFont->lfCharSet))
01961     {
01962         case ANSI_CHARSET:
01963             *Result += String_64(_R(IDS_FONTS_ANSI_CHARSET)); // "ANSI"
01964             break;
01965         case DEFAULT_CHARSET:
01966             *Result += String_64(_R(IDS_FONTS_DEFAULT_CHARSET)); // "Default"
01967             break;
01968         case SYMBOL_CHARSET:
01969             *Result += String_64(_R(IDS_FONTS_SYMBOL_CHARSET)); // "Symbol"
01970             break;
01971         case SHIFTJIS_CHARSET:
01972             *Result += String_64(_R(IDS_FONTS_SHIFTJIS_CHARSET)); // "ShiftJIS"
01973             break;
01974         case HANGEUL_CHARSET:
01975             *Result += String_64(_R(IDS_FONTS_HANGEUL_CHARSET)); // "Hangeul"
01976             break;
01977         case GB2312_CHARSET:
01978             *Result += String_64(_R(IDS_FONTS_GB2312_CHARSET)); // "GB2312"
01979             break;
01980         case CHINESEBIG5_CHARSET:
01981             *Result += String_64(_R(IDS_FONTS_CHINESEBIG5_CHARSET)); // "Chinese"
01982             break;
01983         case OEM_CHARSET:
01984             *Result += String_64(_R(IDS_FONTS_OEM_CHARSET)); // "OEM"
01985             break;
01986     }
01987 #endif
01988 
01989 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:12 2007 for Camelot by  doxygen 1.4.4