/* {{{ proto string GmagickDraw::getTextEncoding()
	Returns a null-terminated string which specifies the code set used for text annotations. The string must be freed by the user once it is no longer required.
*/
PHP_METHOD(gmagickdraw, gettextencoding)
{
	php_gmagickdraw_object *internd;
	char *encoding;
	
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
		return;
	}

	internd = (php_gmagickdraw_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
	encoding = DrawGetTextEncoding(internd->drawing_wand);

	if(encoding == (char *)NULL || *encoding == '\0') {
		RETURN_FALSE;
	} else {
		ZVAL_STRING(return_value, encoding, 1);
		GMAGICK_FREE_MEMORY(char *, encoding);
		return;
	}
}
Beispiel #2
0
static String HHVM_METHOD(ImagickDraw, getTextEncoding) {
  auto wand = getDrawingWandResource(Object{this_});
  return convertMagickString(DrawGetTextEncoding(wand->getWand()));
}