summaryrefslogtreecommitdiff
path: root/def.go
diff options
context:
space:
mode:
authorDarkFreedman <misterdark@mail.ru>2019-04-19 17:00:39 +0300
committerDarkFreedman <misterdark@mail.ru>2019-04-19 17:00:39 +0300
commit0d6a38d49d631da305a6f17704f06f35c36cbddc (patch)
tree343d52bffa64a5055f4d90abf23a3aafbf4b69ce /def.go
parent5262aa851a9a9faf10c562b221986ac190099efc (diff)
Added full support for UTF-8 font. With MIT license.
Diffstat (limited to 'def.go')
-rw-r--r--def.go34
1 files changed, 19 insertions, 15 deletions
diff --git a/def.go b/def.go
index fcc9237..4c46d03 100644
--- a/def.go
+++ b/def.go
@@ -266,6 +266,7 @@ type fontFileType struct {
n int
embedded bool
content []byte
+ fontType string
}
type linkType struct {
@@ -495,6 +496,7 @@ type PageBox struct {
// Fpdf is the principal structure for creating a single PDF document
type Fpdf struct {
+ isCurrentUTF8 bool // is current font used in utf-8 mode
page int // current page number
n int // current object number
offsets []int // array of object offsets
@@ -682,20 +684,22 @@ type FontDescType struct {
}
type fontDefType struct {
- Tp string // "Core", "TrueType", ...
- Name string // "Courier-Bold", ...
- Desc FontDescType // Font descriptor
- Up int // Underline position
- Ut int // Underline thickness
- Cw [256]int // Character width by ordinal
- Enc string // "cp1252", ...
- Diff string // Differences from reference encoding
- File string // "Redressed.z"
- Size1, Size2 int // Type1 values
- OriginalSize int // Size of uncompressed font file
- N int // Set by font loader
- DiffN int // Position of diff in app array, set by font loader
- i string // 1-based position in font list, set by font loader, not this program
+ Tp string // "Core", "TrueType", ...
+ Name string // "Courier-Bold", ...
+ Desc FontDescType // Font descriptor
+ Up int // Underline position
+ Ut int // Underline thickness
+ Cw []int // Character width by ordinal
+ Enc string // "cp1252", ...
+ Diff string // Differences from reference encoding
+ File string // "Redressed.z"
+ Size1, Size2 int // Type1 values
+ OriginalSize int // Size of uncompressed font file
+ N int // Set by font loader
+ DiffN int // Position of diff in app array, set by font loader
+ i string // 1-based position in font list, set by font loader, not this program
+ utf8File *utf8FontFile // UTF-8 font
+ usedRunes map[int]int // Array of used runes
}
// generateFontID generates a font Id from the font definition
@@ -715,7 +719,7 @@ type fontInfoType struct {
IsFixedPitch bool
UnderlineThickness int
UnderlinePosition int
- Widths [256]int
+ Widths []int
Size1, Size2 uint32
Desc FontDescType
}