- /*
- * fontfam.h
- *
- * Font Family class.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: fontfam.h,v $
- * Revision 1.8 1999/03/10 03:49:51 robertj
- * More documentation adjustments.
- *
- * Revision 1.7 1999/03/09 08:01:48 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.6 1999/02/16 08:08:45 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.5 1998/09/23 06:23:39 robertj
- * Added open source copyright license.
- *
- * Revision 1.4 1995/06/17 11:12:37 robertj
- * Documentation update.
- *
- * Revision 1.3 1995/03/14 12:41:28 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.2 1995/01/27 11:07:52 robertj
- * Changed face name strings to be caseless.
- *
- * Revision 1.1 1995/01/07 12:44:42 robertj
- * Initial revision
- *
- */
- #define _PFONTFAMILY
- #ifdef __GNUC__
- #pragma interface
- #endif
- class PFontFamily;
- PSORTED_LIST(PFontFamilyList, PFontFamily);
- /**This class describes a font family. A font family are all variations of a
- particular face name eg {it Times italic 9 point} and {it Times bold 16
- point} are two fonts of the {it Times} font family.
- This describes all of the variations that are possible with the font in a
- given device. This must be created using a canvas.
- */
- class PFontFamily : public PObject
- {
- PCLASSINFO(PFontFamily, PObject);
- public:
- /**Construct an empty font family. This constructor only sets the face
- name for the font family the other fields are meaningless.
- The other contents of the font family are set by friend functions as
- fonts are enumerated by a canvas.
- The user should never directly create instances of this class, except
- when an object for comparison in searches is required. For example to
- find the "Courier" family in the PFontFamilyList returned by a
- Ref{PCanvas} instance a PFontFamily instance must be created for the
- Ref{PCollection::GetValuesIndex()} function.
- */
- PFontFamily(
- const PCaselessString & face /// Name of font face.
- );
- /**@name Overrides from class PInteractor */
- /**Determine if the two font families are the same. That is they have the
- same face name. This is equivalent to call compare on the face name
- string.
- @return
- #EqualTo# if fonts the same, #GreaterThan# if
- different.
- */
- virtual Comparison Compare(
- const PObject & obj /// Other font to compare against.
- ) const;
- /**@name New methods for class */
- /**Get the face name of the font family eg "Courier".
- @return
- string for the font face.
- */
- const PCaselessString & GetFacename() const;
- /**Determine if the font is scalable in size. This is true for Adobe Type 1
- and True Type fonts. Old style bitmap fonts are not scalable and a list
- of the sizes that are present is provided by the Ref{GetSizes()}
- function.
- @return
- TRUE if font size is fully scalable.
- */
- BOOL IsScalable() const;
- /**Get a list of all the sizes for bitmap versions of the font. If the font
- is scalable this list may be empty as only if there are bitmap fonts of
- the same face name are sizes returned.
- @return
- array of physical font sizes for the font family.
- */
- const PWORDArray & GetSizes() const;
- /**Get all of the style combinations that are physically present in the
- canvas. For example there may be a bold font and an italic font but no
- bold italic font.
- Other font style combinations than the ones in this list may be possible
- for particular canvases but are synthesized by the system.
- @return
- array of physical style combinations in a font family.
- */
- const PWORDArray & GetStyles() const;
- /**Get the names for each of the style combinations that are physically
- present in the canvas. There is a one to one correspondence between the
- string in this array and the bit masks returned by the
- Ref{GetStyles()} funtion.
- @return
- array of names for the physical style combinations in a font family.
- */
- const PStringArray & GetStyleNames() const;
- protected:
- /** Face name string for the font family. */
- PCaselessString facename;
- /** The size of the font is scalable. */
- BOOL scalable;
- /** Array of possible size for font family. */
- PWORDArray sizes;
- /** Array of possible style combinations for font family. */
- PWORDArray styles;
- /** Array of names for possible style combinations for font family. */
- PStringArray styleNames;
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////