php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #71672
Patch 0001-haru.c-HPDF_UseUTFEncodings.patch revision 2016-02-26 18:16 UTC by bdmanning at ucsd dot edu
Patch configure.in.diff revision 2011-10-08 23:46 UTC by php-bugs-2011 at ryandesign dot com

Patch 0001-haru.c-HPDF_UseUTFEncodings.patch for haru Bug #71672

Patch version 2016-02-26 18:16 UTC

Return to Bug #71672 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: bdmanning@ucsd.edu

From 30665ee4924fb7b96aa44ff7979a6479931c6477 Mon Sep 17 00:00:00 2001
From: Brian Manning <bdmanning@ucsd.edu>
Date: Thu, 28 Jan 2016 15:30:45 -0800
Subject: [PATCH] haru.c: added support for HPDF_UseUTFEncodings()

---
 haru.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/haru.c b/haru.c
index 531b12f..d6b6acb 100644
--- a/haru.c
+++ b/haru.c
@@ -2066,6 +2066,25 @@ static PHP_METHOD(HaruDoc, useCNTEncodings)
 }
 /* }}} */
 
+/* {{{ proto bool HaruDoc::useUTFEncodings()
+ Enable Unicode encodings */
+static PHP_METHOD(HaruDoc, useUTFEncodings)
+{
+	php_harudoc *doc = (php_harudoc *)zend_object_store_get_object(getThis() TSRMLS_CC);
+	HPDF_STATUS status;
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
+		return;
+	}
+
+	status = HPDF_UseUTFEncodings(doc->h);
+
+	if (php_haru_status_to_exception(status TSRMLS_CC)) {
+		return;
+	}
+	RETURN_TRUE;
+}
+
 /* }}} */
 
 /* HaruPage methods {{{ */
@@ -5683,6 +5702,7 @@ static zend_function_entry harudoc_methods[] = { /* {{{ */
 	PHP_ME(HaruDoc, useCNSEncodings, 		arginfo_harudoc___void, 				ZEND_ACC_PUBLIC)
 	PHP_ME(HaruDoc, useCNTFonts, 			arginfo_harudoc___void, 				ZEND_ACC_PUBLIC)
 	PHP_ME(HaruDoc, useCNTEncodings, 		arginfo_harudoc___void, 				ZEND_ACC_PUBLIC)
+	PHP_ME(HaruDoc, useUTFEncodings, 		arginfo_harudoc___void, 				ZEND_ACC_PUBLIC)
 	{NULL, NULL, NULL}
 };
 
-- 
2.7.0

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC