Aspose.Tasks for C++
FontSettings.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="FontSettings.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/array.h>
9 
10 #include "aspose.tasks.cpp/Saving/FontResolveCallbackDelegate.h"
11 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
12 
13 namespace Aspose
14 {
15 namespace Tasks
16 {
17 class FontResolveEventArgs;
18 namespace Saving
19 {
20 class HtmlSaveOptions;
21 class ImageSaveOptions;
22 class PdfSaveOptions;
23 } // namespace Saving
24 namespace Visualization
25 {
26 class FontManager;
27 } // namespace Visualization
28 } // namespace Tasks
29 } // namespace Aspose
30 
31 namespace Aspose {
32 
33 namespace Tasks {
34 
35 /// <summary>
36 /// Specifies font settings used when rendering project's view.
37 /// </summary>
38 class ASPOSE_TASKS_SHARED_CLASS FontSettings final : public System::Object
39 {
40  typedef FontSettings ThisType;
41  typedef System::Object BaseType;
42 
43  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
44  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
45 
49  friend class Aspose::Tasks::Visualization::FontManager;
50 
51 public:
52 
53  /// <summary>
54  /// Gets the default (or fallback) font for rendering.
55  /// </summary>
56  ASPOSE_TASKS_SHARED_API System::String get_DefaultFontName() const;
57  /// <summary>
58  /// Sets the default (or fallback) font for rendering.
59  /// </summary>
60  ASPOSE_TASKS_SHARED_API void set_DefaultFontName(const System::String& value);
61  /// <summary>
62  /// Gets a value indicating whether the default font must be used for rendering.
63  /// </summary>
64  /// <remarks>When the value is False and DefaultFontName is specified, the rendering engine will utilize the font specified by DefaultFontName as a fallback font.
65  /// Otherwise 'Arial' (if installed) or 'Generic Sans Serif' fonts are used as a fallback font.
66  /// The fallback font is utilized during the rendering of project view when a text style references a font that is not installed on the current operating system.
67  /// For greater control over font resolution you can use <see cref="FontResolveCallback"></see> callback.</remarks>
68  ASPOSE_TASKS_SHARED_API bool get_UseProjectDefaultFont() const;
69  /// <summary>
70  /// Sets a value indicating whether the default font must be used for rendering.
71  /// </summary>
72  /// <remarks>When the value is False and DefaultFontName is specified, the rendering engine will utilize the font specified by DefaultFontName as a fallback font.
73  /// Otherwise 'Arial' (if installed) or 'Generic Sans Serif' fonts are used as a fallback font.
74  /// The fallback font is utilized during the rendering of project view when a text style references a font that is not installed on the current operating system.
75  /// For greater control over font resolution you can use <see cref="FontResolveCallback"></see> callback.</remarks>
76  ASPOSE_TASKS_SHARED_API void set_UseProjectDefaultFont(bool value);
77  /// <summary>
78  /// Gets a callback which can be used to customize resolved fonts.
79  /// </summary>
80  ASPOSE_TASKS_SHARED_API FontResolveCallbackDelegate get_FontResolveCallback() const;
81  /// <summary>
82  /// Sets a callback which can be used to customize resolved fonts.
83  /// </summary>
84  ASPOSE_TASKS_SHARED_API void set_FontResolveCallback(FontResolveCallbackDelegate value);
85 
86  /// <summary>
87  /// Sets the folders where Aspose.Tasks looks for TrueType fonts when rendering project's view.
88  /// </summary>
89  /// <param name="fontFolders">An array of folders that contain TrueType fonts.</param>
90  /// <param name="recursive">If true the specified folders will be scanned recursively.</param>
91  ASPOSE_TASKS_SHARED_API void SetFontFolders(const System::ArrayPtr<System::String>& fontFolders, bool recursive);
92 
93  ASPOSE_TASKS_SHARED_API FontSettings();
94 
95 protected:
96 
97  ASPOSE_TASKS_SHARED_API const System::ArrayPtr<System::String>& get_FontFolders() const;
98  ASPOSE_TASKS_SHARED_API void set_FontFolders(const System::ArrayPtr<System::String>& value);
99  ASPOSE_TASKS_SHARED_API bool get_Recursive() const;
100  ASPOSE_TASKS_SHARED_API void set_Recursive(bool value);
101 
102  ASPOSE_TASKS_SHARED_API System::SharedPtr<FontSettings> Clone();
103  #ifdef ASPOSE_GET_SHARED_MEMBERS
104  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
105  #endif
106 
107 
108 private:
109 
110  System::ArrayPtr<System::String> pr_FontFolders;
111  bool pr_Recursive;
112  System::String pr_DefaultFontName;
113  bool pr_UseProjectDefaultFont;
114  FontResolveCallbackDelegate pr_FontResolveCallback;
115 
116 };
117 
118 } // namespace Tasks
119 } // namespace Aspose
120 
121 
Specifies font settings used when rendering project's view.
Definition: FontSettings.h:39
bool get_UseProjectDefaultFont() const
Gets a value indicating whether the default font must be used for rendering.
void set_FontResolveCallback(FontResolveCallbackDelegate value)
Sets a callback which can be used to customize resolved fonts.
void set_DefaultFontName(const System::String &value)
Sets the default (or fallback) font for rendering.
System::String get_DefaultFontName() const
Gets the default (or fallback) font for rendering.
FontResolveCallbackDelegate get_FontResolveCallback() const
Gets a callback which can be used to customize resolved fonts.
void set_UseProjectDefaultFont(bool value)
Sets a value indicating whether the default font must be used for rendering.
void SetFontFolders(const System::ArrayPtr< System::String > &fontFolders, bool recursive)
Sets the folders where Aspose.Tasks looks for TrueType fonts when rendering project's view.
Allows to specify additional options when rendering project pages to HTML.
Definition: HtmlSaveOptions.h:67
Allows to specify additional options when rendering project pages to images.
Definition: ImageSaveOptions.h:58
Allows to specify additional options when rendering project pages to PDF.
Definition: PdfSaveOptions.h:62
Definition: Asn.h:13