return new DrawableTextDecoration(*this);
}
+// DrawableTextDirection
+Magick::DrawableTextDirection::DrawableTextDirection(
+ DirectionType direction_)
+ : _direction(direction_)
+{
+}
+
+Magick::DrawableTextDirection::~DrawableTextDirection(void)
+{
+}
+
+void Magick::DrawableTextDirection::operator()(
+ MagickCore::DrawingWand *context_) const
+{
+ DrawSetTextDirection(context_,_direction);
+}
+
+void Magick::DrawableTextDirection::direction(DirectionType direction_)
+{
+ _direction=direction_;
+}
+
+Magick::DirectionType Magick::DrawableTextDirection::direction(void) const
+{
+ return(_direction);
+}
+
+Magick::DrawableBase *Magick::DrawableTextDirection::copy() const
+{
+ return new DrawableTextDirection(*this);
+}
+
// DrawableTextInterlineSpacing
Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
double spacing_)
DecorationType _decoration;
};
+ // Render text right-to-left or left-to-right.
+ class MagickPPExport DrawableTextDirection : public DrawableBase
+ {
+ public:
+
+ DrawableTextDirection(DirectionType direction_);
+
+ ~DrawableTextDirection(void);
+
+ void operator()(MagickCore::DrawingWand *context_) const;
+
+ void direction(DirectionType direction_);
+ DirectionType direction(void) const;
+
+ DrawableBase* copy() const;
+
+ private:
+ DirectionType _direction;
+ };
+
// Specify text inter-line spacing
class MagickPPExport DrawableTextInterlineSpacing : public DrawableBase
{
graphic_context[n]->decorate=(DecorationType) decorate;
break;
}
+ if (LocaleCompare("direction",keyword) == 0)
+ {
+ ssize_t
+ direction;
+
+ GetMagickToken(q,&q,token);
+ direction=ParseCommandOption(MagickDirectionOptions,MagickFalse,
+ token);
+ if (direction == -1)
+ status=MagickFalse;
+ else
+ graphic_context[n]->direction=(DirectionType) direction;
+ break;
+ }
status=MagickFalse;
break;
}
% %
% %
% %
+% D r a w G e t T e x t D i r e c t i o n %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DrawGetTextDirection() returns the direction that will be used when
+% annotating with text.
+%
+% The format of the DrawGetTextDirection method is:
+%
+% DirectionType DrawGetTextDirection(const DrawingWand *wand)
+%
+% A description of each parameter follows:
+%
+% o wand: the drawing wand.
+%
+*/
+WandExport DirectionType DrawGetTextDirection(const DrawingWand *wand)
+{
+ assert(wand != (const DrawingWand *) NULL);
+ assert(wand->signature == WandSignature);
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ return(CurrentContext->direction);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% D r a w G e t T e x t E n c o d i n g %
% %
% %
MagickDecorateOptions,(ssize_t) decoration));
}
}
-\f
+
+\f/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+% D r a w S e t T e x t D i r e c t i o n %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DrawSetTextDirection() specifies the direction to be used when
+% annotating with text.
+%
+% The format of the DrawSetTextDirection method is:
+%
+% void DrawSetTextDirection(DrawingWand *wand,
+% const DirectionType direction)
+%
+% A description of each parameter follows:
+%
+% o wand: the drawing wand.
+%
+% o direction: text direction. One of RightToLeftDirection,
+% LeftToRightDirection
+%
+*/
+WandExport void DrawSetTextDirection(DrawingWand *wand,
+ const DirectionType direction)
+{
+ assert(wand != (DrawingWand *) NULL);
+ assert(wand->signature == WandSignature);
+
+ if (wand->debug != MagickFalse)
+ (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+ if ((wand->filter_off != MagickFalse) ||
+ (CurrentContext->direction != direction))
+ {
+ CurrentContext->direction=direction;
+ (void) MvgPrintf(wand,"direction '%s'\n",CommandOptionToMnemonic(
+ MagickDirectionOptions,(ssize_t) direction));
+ }
+}
+
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
extern WandExport DecorationType
DrawGetTextDecoration(const DrawingWand *);
+extern WandExport DirectionType
+ DrawGetTextDirection(const DrawingWand *);
+
extern WandExport double
DrawGetFillAlpha(const DrawingWand *),
DrawGetFontSize(const DrawingWand *),
DrawSetTextAlignment(DrawingWand *,const AlignType),
DrawSetTextAntialias(DrawingWand *,const MagickBooleanType),
DrawSetTextDecoration(DrawingWand *,const DecorationType),
+ DrawSetTextDirection(DrawingWand *,const DirectionType),
DrawSetTextEncoding(DrawingWand *,const char *),
DrawSetTextUnderColor(DrawingWand *,const PixelWand *),
DrawSetViewbox(DrawingWand *,const double,const double,const double,