InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICompositeFont.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: mjessett
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 __ICompositeFont__
25 #define __ICompositeFont__
26 
27 
28 #include "IPMUnknown.h"
29 #include "CompositeFontMgrID.h"
30 
31 #include "K2Vector.h"
32 #include "IPMStream.h"
33 #include "IDocument.h"
34 #include "UIDList.h"
35 
36 class WideString;
37 //----------------------------------------------------------------------------------------
38 // character classes for Composite Font
39 //----------------------------------------------------------------------------------------
40 #define kCompFontString_Kanji "Kanji" // Kanji
41 #define kCompFontString_Kana "Kana" // Kana
42 #define kCompFontString_FullPunctuation "Punctuation" // Full width punctuation
43 #define kCompFontString_FullSymbols "Symbols" // Full symbols, alphabet and numbers
44 #define kCompFontString_HalfSymbols "Alphabetic" // Half symbols and aphabet
45 #define kCompFontString_HalfNumbers "Numbers" // Half numbers
46 #define kCompFontString_Hangul "Hangul" // Korean Hangul
47 
48 
55 public:
56  typedef base_type data_type;
65  void SetRange(UTF32TextChar firstChar, UTF32TextChar lastChar, UTF32TextChar destChar, int32 script = -1)
66  { fFirstChar = firstChar; fLastChar = lastChar; fDestChar = destChar; }
71  bool16 SetFirstAndDest(UTF32TextChar firstChar)
72  { if (firstChar > fLastChar) return kFalse;
73  UTF32TextChar destChar = GetRemappedChar(firstChar);
74  fDestChar = destChar;
75  fFirstChar = firstChar;
76  return kTrue; }
81  bool16 SetLast(UTF32TextChar lastChar)
82  { if (lastChar < fFirstChar) return kFalse; fLastChar = lastChar; return kTrue; }
86  void SetDest(UTF32TextChar destChar)
87  { fDestChar = destChar; }
92  { return fFirstChar; }
97  { return fLastChar; }
102  { return fDestChar; }
107  { return fDestChar.GetValue()+originalChar.GetValue()-fFirstChar.GetValue(); }
108 
113  {
114  fFirstChar.ReadWriteUTF16(s);
115  fLastChar.ReadWriteUTF16(s);
116  fDestChar.ReadWriteUTF16(s);
117  }
118 
119  // BP: comparison operators are required by K2Vector<CharacterRange>
122  inline bool16 operator==( const CharacterRange &charRange ) const
123  {
124  return fFirstChar == charRange.fFirstChar &&
125  fLastChar == charRange.fLastChar &&
126  fDestChar == charRange.fDestChar;
127  }
128 
129 
132  void SetRange(PlatformChar firstChar, PlatformChar lastChar, PlatformChar destChar, int32 script = -1)
133  { fFirstChar = firstChar.GetValue(); fLastChar = lastChar.GetValue(); fDestChar = destChar.GetValue(); }
136  int32 GetScript() const
137  { ASSERT_FAIL("GetScript - Obsolete"); return -1; }
138 
139 
140 private:
141  UTF32TextChar fFirstChar;
142  UTF32TextChar fLastChar;
143  UTF32TextChar fDestChar;
144 };
145 
146 
148 
149 
156 public:
157  uint16 GetHorizontalAdjustmentFlag()
158  { return fHorizontalFlags; };
159  void SetHorizontalAdjustmentFlag(uint16 horizontalFlag)
160  { fHorizontalFlags = horizontalFlag; };
161 
162  uint16 GetHorizontalGlyphCentering()
163  { return fHorizontalGlyphCentering; };
164  void SetHorizontalGlyphCentering(uint16 horizontalGlyphCentering)
165  { fHorizontalGlyphCentering = horizontalGlyphCentering; };
166 
167  uint16 GetVerticalAdjustmentFlag()
168  { return fVerticalFlags; };
169  void SetVerticalAdjustmentFlag(uint16 verticalFlag)
170  { fVerticalFlags = verticalFlag; };
171 
172  uint16 GetVerticalGlyphCentering()
173  { return fVerticalGlyphCentering; };
174  void SetVerticalGlyphCentering(uint16 verticalGlyphCentering)
175  { fVerticalGlyphCentering = verticalGlyphCentering; };
176 
177  void ReadWrite(IPMStream *s)
178  {
179  s->XferInt16((short&)fHorizontalFlags);
180  s->XferInt16((short&)fHorizontalGlyphCentering);
181  s->XferInt16((short&)fVerticalFlags);
182  s->XferInt16((short&)fVerticalGlyphCentering);
183  }
184 
185 private:
186  uint16 fHorizontalFlags; /* */
187  uint16 fHorizontalGlyphCentering; /* */
188  uint16 fVerticalFlags; /* */
189  uint16 fVerticalGlyphCentering; /* */
190 
191 
192 };
193 
194 
199 {
200  public:
201  enum { kDefaultIID = IID_ICOMPFONTDATASETTINGS };
202 
205  virtual void ClearRanges() = 0;
206 
209  virtual void SetDefault() = 0;
210 
211 
215  virtual void SetName(const PMString& s) = 0;
216 
222  virtual void SetName(const PMString& s, bool16 translatable) = 0;
223 
227  virtual const PMString &GetName() const = 0;
228 
229 
233  virtual void SetFontUID( const UID& nUID ) = 0;
234 
238  virtual UID GetFontUID() const = 0;
239 
240 
244  virtual void SetFontStyle( const PMString& nFontStyle ) = 0;
245 
249  virtual PMString GetFontStyle() const = 0;
250 
251 
255  virtual void SetSizeValue( const PMReal nSize ) = 0;
256 
260  virtual PMReal GetSizeValue() const = 0;
261 
262 
266  virtual void SetBaselineValue( const PMReal nBaseline ) = 0;
267 
271  virtual PMReal GetBaselineValue() const = 0;
272 
273 
277  virtual void SetHScaleValue( const PMReal nScale ) = 0;
278 
282  virtual PMReal GetHScaleValue() const = 0;
283 
284 
288  virtual void SetVScaleValue( const PMReal nScale ) = 0;
289 
293  virtual PMReal GetVScaleValue() const = 0;
294 
300  virtual void SetLocked( const bool16 locked ) = 0;
301 
307  virtual bool16 IsLocked() const = 0;
308 
309 
313  virtual void SetCharRanges(const CharRangeCollection ranges) = 0;
314 
318  virtual CharRangeCollection GetCharRanges() const = 0;
319 
327 
333  virtual bool16 ConvertToUnicode() = 0;
334 
343  virtual void AddRemapRange(UTF32TextChar firstChar, UTF32TextChar lastChar, UTF32TextChar destChar, int32 script = -1) = 0;
344 
352  virtual void AddRange(UTF32TextChar firstChar, UTF32TextChar lastChar, int32 script = -1) = 0;
353 
354 
358  virtual WideString GetRangeAsWideString() const = 0;
359 
363  virtual PMString GetRangeAsString() const = 0;
364 
369  virtual void SetRangeFromWideString( WideString setWString, int32 script = -1 ) = 0;
370 
374  virtual void SetRangeFromString( PMString setString ) = 0;
375 
376 
382  virtual bool16 SupportsScript( int32 script ) const = 0;
383 
384 
388  virtual void CopyCompFontSetting(ICompFontDataSettings *from) = 0;
389 
390 
395  virtual void ReadWrite(IPMStream *s, ImplementationID id) = 0;
396 
402  virtual bool16 FindCharInRange( UTF32TextChar findChar, UTF32TextChar &remapChar ) const = 0;
403 
404 
407  virtual void ClearScaleAdjustment() = 0;
408 
412  virtual ScaleAdjustment GetScaleAdjustment() const = 0;
413 
419  virtual bool16 GetScaleOption() = 0;
420 
425  virtual void SetScaleOption(bool16 scaleOption) = 0;
426 
427 };
428 
429 
435 {
436  public:
437  enum { kDefaultIID = IID_ICOMPOSITEFONT };
438 
439 
443  virtual UID GetBasedOn() const = 0;
444 
450  virtual PMString GetFontFamilyName() const = 0;
451 
455  virtual const PMString &GetNativeFontFamilyName() const = 0;
456 
457 
461  virtual void SetBasedOn(const UID& base) = 0;
462 
466  virtual void SetName(const PMString& s) = 0;
467 
468 
472  virtual const PMString& GetNameStyle() const = 0;
473 
477  virtual void SetNameStyle(const PMString& s) = 0;
478 
479 
483  virtual PMString GetPostScriptName() = 0;
484 
488  virtual void SetPostScriptName(const PMString& s) = 0;
489 
490 
494  virtual const PMString& GetCMapFileName() const = 0;
495 
499  virtual void SetCMapFileName(const PMString& s) = 0;
500 
501 
505  virtual int32 GetCharClassLength() = 0;
506 
511  virtual ICompFontDataSettings* GetCharClass(int32 index) const = 0;
512 
519  virtual ICompFontDataSettings* GetCharClass(const PMString &nameString) const = 0;
520 
528  virtual ICompFontDataSettings* GetCharClass(UTF32TextChar findChar, UTF32TextChar *remapChar = nil) const = 0;
529 
536  virtual UID GetCharClassUID(int32 index) const = 0;
537 
544  virtual int32 GetCharClassIndex(const PMString &nameString) const = 0;
545 
546 
550  virtual ICompFontDataSettings* CreateCharClass() = 0;
551 
555  virtual void AppendCharClass(const UID newSetting) = 0;
556 
560  virtual void AppendCharClass(ICompFontDataSettings* newSetting) = 0;
561 
565  virtual void RemoveCharClass(int32 nIndex) = 0;
566 
570  virtual void UnRemoveCharClass(UID nUID) = 0;
571 
572 
576  virtual void CopyCompositeFontData(ICompositeFont *from) = 0;
577 
583  virtual void CopyAndConvertCompositeFontData(ICompositeFont *from, IDataBase* sourceDB,
584  IDataBase* destDB) = 0;
585 
592  virtual const PMString GetPSFontName(const int32 nCharClass, bool16 fEncoding = kTrue) const = 0;
593 
598  virtual bool16 CompareCompositeFontData(ICompositeFont *srcData) = 0;
599 
602  virtual void DeleteCompositeFontData() = 0;
603 
604 
608  virtual bool16 IsDirty() = 0;
609 
612  virtual boost::shared_ptr<CmdUtils::AutoUndoSequencePtr> DoDirty() = 0;
613 
620  virtual void SetLocked( const bool16 locked ) = 0;
621 
627  virtual bool16 IsLocked() const = 0;
628 
629 
633  virtual void SetFontMatrixAdjustment(const uint16 verticalBaselineShift) = 0;
634 
638  virtual uint16 GetFontMatrixAdjustment() const = 0;
639 
640 
645  virtual void ReadWrite(IPMStream *s, ImplementationID id) = 0;
646 
651  virtual ErrorCode ReadWriteRffFile(IPMStream *s) = 0;
652 
653 
659  virtual IDocument* GetDocument() const = 0;
660 
666  virtual void SetDocument(IDocument* theDocWS) = 0;
667 };
668 
669 #endif // __ICompositeFont__