AWS Thinkbox Discussion Forums

Draft - Type.xml

RuntimeError: Magick: UnableToOpenConfigureFile `type.xml' @ warning/configure.c/GetConfigureOptions/589

Still broken in beta 3.

Ugh. I was really hoping the changes I made to the Draft plugin would have fixed that. Back to the drawing board I guess.

Out of curiosity, when you re-create the file as a work-around to get it going again, how long does it typically work for before breaking again?

Kind of random. It might have something to do with eclipse or IDLE. I don’t get this error on the farm.

I see. Does it only happen when you’re running Draft scripts outside of Deadline, then? If so, can you try creating an environment variable called “MAGICK_CONFIGURE_PATH”, containing the path to the Draft folder on your machine (which should contain the type.xml file)? That should ensure that ImageMagick (which Draft is using) can always find the type.xml file, which I think is what the problem is here…

It’s working now. Whether or not it’ll keep working, I’ll have to wait and see.

Hi, I am using Draft Beta 10, when i tried to annotate, I get the following error:

********* error:
Magick: UnableToReadFont Times-New-Roman' @ warning/annotate.c/RenderType/866. Magick: UnableToReadFontTimes-New-Roman’ @ error/annotate.c/RenderFreetype/1115.
Magick: UnableToOpenConfigureFile delegates.xml' @ warning/configure.c/GetConfigureOptions/589. Magick: UnableToReadFontTimes-New-Roman’ @ warning/annotate.c/RenderType/866.
Magick: UnableToReadFont Times-New-Roman' @ error/annotate.c/RenderFreetype/1115. Magick: UnableToReadFontTimes-New-Roman’ @ warning/annotate.c/RenderType/866.
Magick: UnableToReadFont Times-New-Roman' @ error/annotate.c/RenderFreetype/1115. Magick: UnableToReadFontTimes-New-Roman’ @ warning/annotate.c/RenderType/866.
Magick: UnableToReadFont Times-New-Roman' @ error/annotate.c/RenderFreetype/1115. Magick: UnableToReadFontTimes-New-Roman’ @ warning/annotate.c/RenderType/866.

********* here is the code:

for index in range(frame_in, frame_out, 1):
frame_img = Draft.Image.ReadFromFile( source % index )
#print dir(frame_img)

frame_img.Resize(out_width, out_height)
#encoder.EncodeNextFrame(frame_img)

#Annotation info used for burn ins
annotationInfo = Draft.AnnotationInfo()
annotationInfo.FontType = "Times-New-Roman"
annotationInfo.PointSize = 12
annotationInfo.Color = Draft.ColorRGBA( 1.0, 1.0, 1.0, 1.0 )


annotation = Draft.Image.CreateAnnotation( "HELLO WORLD: ", annotationInfo )
frame_img.CompositeWithPositionAndGravity( annotation, 
                                       100, 
                                       100, 
                                       Draft.PositionalGravity.CenterGravity, Draft.CompositeOperator.OverCompositeOp )

encoder.EncodeNextFrame(frame_img)
framesAnnotation = Draft.Image.CreateAnnotation( "%04d" % index, annotationInfo )

I assume you’re using Linux? Could you please try changing “Times-New-Roman” to a different font such as “Times-Roman” or “Helvetica”?

Alternatively, you can simply remove the annotationInfo.FontType = “Times-New-Roman” line from your script. Then it will default to Arial or Helvetica depending on your platform.

If you want to use a different font, you could try generating a type.xml file for your system, by using the imagick_type_gen script linked from here: http://forums.thinkboxsoftware.com/viewtopic.php?f=125&t=6892#p27831. On my system I ran: ./imagick_type_gen > type.xml I opened the resulting type.xml file to see what non-default fonts were available. One of the fonts was name=“BitstreamCharter”. I changed the font in the Draft script to “BitstreamCharter”. Next I copied type.xml into the Draft folder. Finally I ran the script using Draft and it worked as expected.

Thanks that seem to have done the trick.

Are there any docs on how Draft.AnnotationInfo.FontMetric?

for example, to find out the width of “hello, world” using a certain font settings.

Here is an example (including sample output) that you can use for working with the Font Metric structure. I have found that the horizontal distances are less reliable than the vertical distances, but this should get you started. I will also make sure that this topic makes it into the cookbook as a couple of recipes.

-i
Text_Example_Simple.zip (247 KB)

Privacy | Site terms | Cookie preferences