The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
But text can be only a pointer to a char array, which limits the charset to ASCII I think.
Is there something similar for unicode strings?
Or has MagickWand to be extended first?
As far as I know you can use Unicode charecters with convert etc...
#include <windows.h>
#include <wand/magick_wand.h>
void test_wand(LPTSTR lpCmdLine)
{
MagickWand *mw = NULL;
DrawingWand *dw = NULL;
unsigned char *str = "Hello Magicians \xc4\x9a\xc5\x90\xc4\x9c \x61\xc4\x85\x63\xc4\x87\x65\xc4\x99\x6c\xc5\x82\x6e\xc5\x84\x6f\xc3\xb3\x73\xc5\x9b\x7a\xc5\xbc\x78\xc5\xba\x00";
double *fm = NULL;
MagickWandGenesis();
mw = NewMagickWand();
dw = NewDrawingWand();
// Start with an empty image
MagickReadImage(mw,"xc:");
// Set the font information in the drawing wand
DrawSetFontSize(dw,72);
DrawSetFont(dw,"Times-New-Roman");
fm = MagickQueryFontMetrics(mw, dw, str);
// extend the size of the image - I think this is the right one to use
// but works for me in this case
MagickExtentImage(mw,(unsigned long)fm[4],(unsigned long)fm[5],0,0);
// Annotate the image - Note the calculation of the y value which is
// because the font metrics use an origin in the lower left whereas IM has
// its origin at top left
// The fontmetrics origin is the *bottom* left of the text and the Y axis
// is the baseline. Therefore, the bounding box can have a negative Y value
// if the text contains any descenders which go below the baseline
MagickAnnotateImage(mw,dw, 0 ,(unsigned int)(fm[8]+ fm[5]), 0.0 ,str);
// Now write the magickwand image
MagickWriteImage(mw,"metric.gif");
if(mw)mw = DestroyMagickWand(mw);
if(dw)dw = DestroyDrawingWand(dw);
if(fm)RelinquishMagickMemory(fm);
MagickWandTerminus();
}
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Yeah, thats clear.
But a real unicode has a 16-Bit length with a possibility of 65535 different characters.
Its hard to save them into a char array.
On the attached Picture you can see which chars Im able to print.
But the font has much more chracters on different codepages.
My aim is to access all characters on all codepages.
Each pair of bytes in the string is a 16-bit character. For example, the first part is \xc4\x9a\xc5\x90\xc4\x9c which is 3 unicode characters - 0xc49a, 0xc590 and 0xc49c which produce the EOG with accents.
Its hard to save them into a char array
Why?
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.