InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IFontFamily.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: emenning
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IFontFamily__
25 #define __IFontFamily__
26 
27 #include "IPMUnknown.h"
28 #include "IPMFont.h"
29 #include "IFontMgr.h"
30 #include "IFontGroup.h"
31 #include <string>
32 
33 class IFontGroupId;
34 class PMString;
35 
36 class FontEntry
37 {
38  public:
39  FontEntry()
40  {
41  fFontType = IPMFont::kUnknownFontType;
42  fWritingScript = -1;
43  };
44  FontEntry(const PMString &fontStyleName, const PMString &postScriptName,
45  const PMString &fullName, const PMString &nativeStyleName,
46  const PMString &nativeFullName, IPMFont::FontType fontType,
47  const WideString &version, int32 writingScript)
48  {
49  fFontStyleName = fontStyleName;
50  fPostScriptName = postScriptName;
51  fFullName = fullName;
52  fNativeStyleName = nativeStyleName;
53  fNativeFullName = nativeFullName;
54  fFontType = fontType;
55  fVersion = version;
56  fWritingScript = writingScript;
57  };
58 
59  PMString fFontStyleName;
60  PMString fPostScriptName;
61  PMString fFullName;
62  PMString fNativeStyleName;
63  PMString fNativeFullName;
64  IPMFont::FontType fFontType;
65  WideString fVersion;
66  int32 fWritingScript;
67 
68 };
69 
70 
75 class IFontFamily : public IPMUnknown
76 {
77  public:
78  enum { kDefaultIID = IID_IFONTFAMILY };
79 
81  {
82  FontFaceMappingInfo() : fStyle(IFontMgr::kNormal), fScript(kDontKnowScript), fOS(IFontMgr::kOriginalUnknownOS) {};
83  typedef object_type data_type;
84  PMString fPlatformName;
85  PMString fFontFaceName;
86  IFontMgr::FontStyleBits fStyle;
87  int32 fScript;
88  IFontMgr::OriginalOS fOS;
89  };
90 
96  virtual void SetFamilyName( const PMString& familyName, const PMString& familyNameNative, bool16 missing, const FontEntry *fontEntry = nil) = 0;
97 
101  virtual PMString GetFamilyName() const = 0;
102 
107  virtual PMString GetFamilyNameNative() const = 0;
108 
114  virtual int32 GetWritingScript() const = 0;
115 
116 
122  virtual bool16 UpdateFontState(IUsedFontList *docFontList) = 0;
123 
124 
133  virtual int32 CountFontFaces(bool16 getForDysfunctional = kFalse) const = 0;
134 
139  virtual void AppendFontName(int32 i, PMString& s) const = 0;
140 
146  virtual void AppendFullName(int32 i, PMString& s) const = 0;
147 
152  virtual void AppendStyleName(int32 i, PMString& s) const = 0;
153 
162  virtual void AppendStyleNameNative(int32 i, PMString& s) const = 0;
163 
173  virtual void AppendFullNameNative(int32 i, PMString& s) const = 0;
174 
175 
176 
192  virtual int32 CorrectVariantIndex(const PMString& face) const = 0;
193 
202  virtual IPMFont* QueryFace(const PMString& face,
203  IFontMgr::FontStyleBits style = IFontMgr::kNormal,
204  PMReal smallcapscale = 0.7) = 0;
205 
214  virtual bool16 AttemptAutoActivation(const PMString& face,
215  IFontMgr::FontStyleBits style = IFontMgr::kNormal,
216  PMReal smallcapscale = 0.7) = 0;
217 
234  virtual bool16 IsFaceAvailable(const PMString& face,
235  IFontMgr::FontStyleBits style = IFontMgr::kNormal,
236  PMReal smallcapscale = 0.7,
237  int32 *oldTech = nil, int32 *newTech = nil, bool16 resetTechnology = kFalse) = 0;
238 
250  virtual bool16 IsDysfunctional() const = 0;
251 
262  virtual PMString GetFacePostscriptName(const PMString& face, bool16 getOnlyRealPSName = kFalse) const = 0;
263 
272  virtual PMString ToggleBoldItalic(const PMString& face,
273  IFontMgr::FontStyleBits toggle) = 0;
274 
283  virtual PMString GetFaceNativeName(const PMString& face,
284  IFontMgr::FontStyleBits style = IFontMgr::kNormal,
285  PMReal smallcapscale = 0.7) = 0;
286 
293  virtual PMString GetDisplayFullName( const PMString& faceName, PMString &fontString ) = 0;
294 
307  virtual const FontFaceMappingInfo& GetFontFaceMappingInfo(const PMString &faceName) const = 0;
314  virtual bool16 FontFaceMappingInfoIsSet(const PMString &faceName) const = 0;
315 
321  virtual UID GetDependentFamily() const = 0;
322 
328  virtual bool16 IsFlattened() const = 0;
329 
330 
334  virtual IFontGroupId *QueryFontGroupUniqueID() const = 0;
335 
339  virtual void SetFamilyWithFontGroupID( const IFontGroupId *fontGroupIDPtr ) = 0;
340 
349  virtual bool16 IsBadFont(const PMString &styleName, PMString &badFontPath) const = 0;
350 
357  virtual const PMString GetDisplayFamilyName() const = 0;
358 
364  virtual IPMFont::FontType GetFontType(const PMString &styleName) const = 0;
365 
374  virtual int32 GetDefaultStyleIndex() const = 0;
375 
381  virtual WideString GetFontVersion(const PMString &styleName) const = 0;
382 
388  virtual void UpdateFontVersions() = 0;
389 
406  virtual int32 GetVariantIndex(const PMString& face) const = 0;
407 
408  //----------DISCOURAGED ROUTINES---------------
409 
413  virtual void AddMissingFontEntry( const FontEntry &fontEntry ) = 0;
414 
420  virtual bool16 IsTypekitFont(const PMString &styleName) const = 0;
421 
427  virtual PMString GetTypekitFontID(const PMString &styleName) const = 0;
428 
434  virtual PMString GetStyleNameFromDesignAxes(const Fixed* designAxes, int32 numAxes, PMString parentStyleName) = 0;
435 
441  virtual Fixed* GetDesignAxesFromStyleName(const PMString& styleName, int32& numAxes) = 0;
442 
449  virtual bool16 IsVariableFont() = 0;
450 
457  virtual bool16 IsCustomVariableFont(const PMString& variant) = 0;
458 };
459 
460 #endif
461  //__IFontFamily__