forked from signintech/gopdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurrent.go
60 lines (46 loc) · 993 Bytes
/
current.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package gopdf
//CURRENT_FONT_TYPE_IFONT this font add by Gopdf.AddFont(...)
const CURRENT_FONT_TYPE_IFONT = 0
//CURRENT_FONT_TYPE_SUBSET this font add by Gopdf.AddTTFFont(...)
const CURRENT_FONT_TYPE_SUBSET = 1
type Current struct {
X float64
Y float64
//font
IndexOfFontObj int
CountOfFont int
CountOfL int
Font_Size int
Font_Style string
Font_FontCount int
Font_Type int // CURRENT_FONT_TYPE_IFONT or CURRENT_FONT_TYPE_SUBSET
Font_IFont IFont // depend on Font_Type
Font_ISubset ISubset // depend on Font_Type
//page
IndexOfPageObj int
//img
CountOfImg int
//cache of image in pdf file
ImgCaches []ImageCache
//text color
txtColor Rgb
//text grayscale
grayFill float64
//draw grayscale
grayStroke float64
}
func (c *Current) setTextColor(rgb Rgb) {
c.txtColor = rgb
}
func (c *Current) textColor() Rgb {
return c.txtColor
}
type ImageCache struct {
Path string
Index int
}
type Rgb struct {
r uint8
g uint8
b uint8
}