Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreAnnotate.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_ANNOTATE__
8#define __HDI_CORE_ANNOTATE__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include <vector>
13
14#include "hdicoreAngle.h"
15#include "hdicoreColor.h"
16#include "hdicoreRect.h"
17#include "hdicoreSegPoint.h"
18#include "hdicoreTypes.h"
19
20namespace hdi
21{
22 namespace core
23 {
24 class Font;
25 class SegPoint;
26
31 namespace annotate
32 {
33 typedef std::vector<Point> PointVector;
34 typedef std::vector<SegPoint> SegPointVector;
35
40 {
41 DefaultFont, // Mac: Lucida Grande Regular, 13pt; Win: Tahoma Regular, 12pt
42
43 DialogFont, // Mac: Lucida Grande Regular, 13pt; Win: Tahoma Regular, 12pt
44 BoldDialogFont, // Mac: Lucida Grande Bold, 13pt; Win: Tahoma Bold, 12pt
45 ItalicDialogFont, // Mac: Verdana Italic, 12.5pt; Win: Verdana Italic, 11.5pt
46 BoldItalicDialogFont, // Mac: Verdana Bold Italic, 12.5pt; Win: Verdana Bold Italic, 11.5pt
47
48 PanelFont, // Mac: Lucida Grande Regular, 9pt; Win: Tahoma Regular, 10.5pt
49 BoldPanelFont, // Mac: Lucida Grande Bold, 9pt; Win: Tahoma Bold, 10.5pt
50 ItalicPanelFont, // Mac: Verdana Italic, 8.5pt; Win: Verdana Italic, 9.5pt
51 BoldItalicPanelFont // Mac: Verdana Bold Italic, 8.5pt; Win: Verdana Bold Italic, 9.5pt
52 };
53
55 {
61
66
73
80
85 bool hasCJK;
86
87 TextConfig() :
88 justification(JustifyLeft),
91 rotationPin(MidCenterPinPoint),
92 hasCJK(false)
93 {}
94 };
95
105 bool line(const Point& start_, const Point& end_);
106
118 bool dashedLine(const Point& start_, const Point& end_, const double dash_, const double gap_);
119
129 bool rect(const Rect& rect_, const bool fill_ = false);
130
140 bool ellipse(const Rect& bounds_, const bool fill_ = false);
141
151 bool polygon(const PointVector& points_, const bool fill_ = false);
152
162 bool bezier(const SegPointVector& segPts_, const bool fill_ = false);
163
175 bool image(const int16_t imgID_, const Point& pt_);
176
187 bool image(const byte* const png_, const uint32_t pngSize_, const Point& pt_);
188
199 bool imageUnscaled(const byte* const png_, const uint32_t pngSize_, const Point& pt_);
200
212 bool text(const std::string& text_, const Point& pt_, const TextConfig& config_ = TextConfig());
213
222
230 void setColor(const Color& color_);
231
239 double lineWidth();
240
248 void setLineWidth(const double width_);
249
257 void setFont(const Font& font_);
258
266 void setFontSize(const double size_);
267
275 std::unique_ptr<Font> font();
276
284 double fontSize();
285
293 void setFontType(const FontType font_);
294
304 Size textSize(const std::string& text_, const TextConfig& config_ = TextConfig());
305
312 }
313 }
314}
315
316#endif
317// HDI_CORE_AIP_MODE
318
319#endif
320// __HDI_CORE_ANNOTATE__
Describes an angle, and allows for easy conversion between various units.
Definition: hdicoreAngle.h:26
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:32
Font class to allow for easy font manipulation.
Definition: hdicoreFont.h:183
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:25
Header file for describing angles.
Header file for describing plugin UI colors.
Header file for describing rectangles.
Header file for path segment point manipulation.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
BoundsPinPointType
These allow for simpler art transformation/bounds metadata access.
Definition: hdicoreTypes.h:794
ParagraphJustification
Indicates how text should be justified for a text art object.
Definition: hdicoreTypes.h:377
bool dashedLine(const Point &start_, const Point &end_, const double dash_, const double gap_)
Draws a dashed line with the given end points and dash specs.
bool rect(const Rect &rect_, const bool fill_=false)
Draws a rectangle with the given coordinates and fill.
bool image(const int16_t imgID_, const Point &pt_)
Draws an image at the given point.
Color color()
Gets the current annotation color.
bool imageUnscaled(const byte *const png_, const uint32_t pngSize_, const Point &pt_)
Draws an image from its raw PNG data at the given point, unscaled.
void setFontType(const FontType font_)
Sets the current font for annotation text art.
void setLineWidth(const double width_)
Sets the line width used when drawing paths or unfilled objects.
bool text(const std::string &text_, const Point &pt_, const TextConfig &config_=TextConfig())
Draws text with the current font and left justification.
bool polygon(const PointVector &points_, const bool fill_=false)
Draws a polygon constructed of the given points.
bool ellipse(const Rect &bounds_, const bool fill_=false)
Draws an ellipse within the given rectangular bounds.
FontType
Describes the type of font to use when annotating text; see also setFontType()
Definition: hdicoreAnnotate.h:40
void setColor(const Color &color_)
Sets the current annotation color.
void invalidateAll()
Loops through all views of the current document and invalidates their annotations.
double fontSize()
Gets the current font size for annotation text art.
void setFont(const Font &font_)
Sets the current font for annotation text art.
bool bezier(const SegPointVector &segPts_, const bool fill_=false)
Draws a bezier from the given segment points.
void setFontSize(const double size_)
Sets the current font size for annotation text art.
Size textSize(const std::string &text_, const TextConfig &config_=TextConfig())
Gets the bounds for the given text at the origin.
bool line(const Point &start_, const Point &end_)
Draws a line with the given end points.
double lineWidth()
Gets the line width used when drawing paths or unfilled objects.
std::unique_ptr< Font > font()
Gets the current font for annotation text art.
Definition: hdicoreAnnotate.h:55
Angle rotationAngle
When drawing text, used to specify the rotation angle (defaults to zero degrees)
Definition: hdicoreAnnotate.h:65
BoundsPinPointType rotationPin
When drawing text, used to specify the pin point of rotation (if rotationAngle is non-zero,...
Definition: hdicoreAnnotate.h:79
ParagraphJustification justification
When drawing text, used to specify the justification (can only be JustifyLeft, JustifyCenter,...
Definition: hdicoreAnnotate.h:60
bool hasCJK
Whether the text has any Chinese, Japanese, or Korean characters (which defaults to false and will af...
Definition: hdicoreAnnotate.h:85
Point rotationPoint
When drawing text, used to specify the x/y point of rotation (if rotationAngle is non-zero),...
Definition: hdicoreAnnotate.h:72