Definition at line 191 of file text.c.
192{
194
201 DestroyDrawingWand(s->
dw);
206
208
214
215
216 const char *color;
217 const char *color_outline;
218 const char *colorspace;
220 color = "#333333FF";
221 color_outline = "#FFFFFFFF";
222 colorspace = "rgba";
224 color = "#333333FF";
225 color_outline = "#FFFFFFFF";
226 colorspace = "rgb";
228 color = "#228080FF";
229 color_outline = "#EB8080FF";
230 colorspace = "UYVY";
231 } else {
233 return false;
234 }
235
236 s->
dw = NewDrawingWand();
238 MagickBooleanType
status = DrawSetFont(s->
dw,
"helvetica");
239 if(
status != MagickTrue) {
241 return false;
242 }
243 {
244 PixelWand *pw = NewPixelWand();
245 PixelSetColor(pw, color);
246 DrawSetFillColor(s->
dw, pw);
247 PixelSetColor(pw, color_outline);
248 DrawSetStrokeColor(s->
dw, pw);
249 DestroyPixelWand(pw);
250 }
251
256 if(
status != MagickTrue) {
258 return false;
259 }
260
261
264 assert(
status == MagickTrue &&
"[text vo_pp.] MagickSetDepth failed");
265
266 PixelWand *transparent_bg = NewPixelWand();
267
268 PixelSetColor(transparent_bg, "#00000000");
269
270
271 MagickNewImage(s->
wand_text, 1, 1, transparent_bg);
272
273
274 double *metrics = MagickQueryFontMetrics(s->
wand_text, s->
dw, s->
text);
275 if(!metrics) {
277 return false;
278 }
279 double descender = metrics[3];
282 free(metrics);
283
288 return false;
289 }
290
291 double x_off = 0;
293 double rot = 0;
297 "Perhaps the text contains invalid characters?\n");
298 return false;
299 }
300
301 DestroyPixelWand(transparent_bg);
302
303 return true;
304}
void bug_msg(int level, const char *format,...)
prints the error with the advice to report the bug
unsigned int width
width of every tile (!)
unsigned int height
height of every tile (!)
@ RGB
RGB 8-bit (packed into 24-bit word)
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
@ RGBA
RGBA 8-bit, big-endian.
References bug_msg(), video_desc::color_spec, desc, state_text::dw, video_desc::height, state_text::in, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, log_msg(), state_text::margin_x, MARGIN_X_DIV, state_text::margin_y, MARGIN_Y_DIV, MIN, state_text::req_h, state_text::req_x, state_text::req_y, RGB, RGBA, state, state_text::text, state_text::text_base_y, TEXT_H_DIV, state_text::text_height_pt, state_text::text_height_px, state_text::text_width_px, UYVY, vf_alloc_desc_data(), vf_free(), state_text::wand_bg, state_text::wand_text, state_text::width, and video_desc::width.
Referenced by cf_text_filter().