summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
authorDarkFreedman <misterdark@mail.ru>2019-10-04 12:14:19 +0300
committerDarkFreedman <misterdark@mail.ru>2019-10-04 12:14:19 +0300
commit4c9d4cde86495128201e05dfdcee37db69f23659 (patch)
treebcc51f0f0b585ced9b68f1003972847db619e402 /util.go
parent4ca1a43173413971a6bb92c78be31a71b29b416b (diff)
Update to latest version
Diffstat (limited to 'util.go')
-rw-r--r--util.go24
1 files changed, 17 insertions, 7 deletions
diff --git a/util.go b/util.go
index e96cdd8..351d319 100644
--- a/util.go
+++ b/util.go
@@ -344,7 +344,7 @@ func (pa *untypedKeyMap) getIndex(key interface{}) int {
//Put key=>value in PHP Array
func (pa *untypedKeyMap) put(key interface{}, value int) {
if key == nil {
- i := 0
+ var i int
for n := 0; ; n++ {
i = pa.getIndex(n)
if i < 0 {
@@ -419,14 +419,8 @@ func arrayMerge(arr1, arr2 *untypedKeyMap) *untypedKeyMap {
answer.valueSet = arr1.valueSet[:]
for i := 0; i < len(arr2.keySet); i++ {
if arr2.keySet[i] == "interval" {
- u := 0
- u = u + 1
if arr1.getIndex("interval") < 0 {
answer.put("interval", arr2.valueSet[i])
- } else {
-
- u := 0
- u = u + 1
}
} else {
answer.put(nil, arr2.valueSet[i])
@@ -450,3 +444,19 @@ func remove(arr []int, key int) []int {
}
return append(arr[:n], arr[n+1:]...)
}
+
+func isChinese(rune2 rune) bool {
+ // chinese unicode: 4e00-9fa5
+ if rune2 >= rune(0x4e00) && rune2 <= rune(0x9fa5) {
+ return true
+ }
+ return false
+}
+
+// Condition font family string to PDF name compliance. See section 5.3 (Names)
+// in https://resources.infosecinstitute.com/pdf-file-format-basic-structure/
+func fontFamilyEscape(familyStr string) (escStr string) {
+ escStr = strings.Replace(familyStr, " ", "#20", -1)
+ // Additional replacements can take place here
+ return
+}