diff --git a/README.md b/README.md index 53a432c..a87d195 100644 --- a/README.md +++ b/README.md @@ -12,22 +12,20 @@ Sample import ( "fmt" - "gopdf" iconv "github.com/djimenez/iconv-go" - "gopdf/fonts" + "github.com/signintech/gopdf" + "github.com/signintech/gopdf/fonts" ) func main() { pdf := gopdf.GoPdf{} - pdf.Start(gopdf.Config{Unit: "pt", PageSize: gopdf.Rect{W: 595.28, H: 841.89}}) //595.28, 841.89 = A4 - pdf.AddFont("THSarabunPSK",new(fonts.THSarabun),"res/fonts/THSarabun.z") - pdf.AddFont("Loma",new(fonts.Loma),"res/fonts/Loma.z") - pdf.AddPage() - pdf.SetFont("THSarabunPSK", "B", 14) - pdf.Cell(nil, ToCp874("ทดสอบ")) - pdf.Cell(nil, ToCp874("Test")) - pdf.Br(28) + pdf.Start(gopdf.Config{Unit: "pt", PageSize: gopdf.Rect{W: 595.28, H: 841.89}}) //595.28, 841.89 = A4 + pdf.AddFont("THSarabunPSK",new(fonts.THSarabun),"THSarabun.z") + pdf.AddFont("Loma",new(fonts.Loma),"Loma.z") + pdf.AddPage() + pdf.SetFont("THSarabunPSK","B",14) + pdf.Cell(nil, ToCp874("Hello world = สวัสดี โลก in thai")) pdf.WritePdf("/var/www/fpdf17/output/x.pdf") fmt.Println("Done...") } diff --git a/src/gopdf/basic_obj.go b/basic_obj.go similarity index 100% rename from src/gopdf/basic_obj.go rename to basic_obj.go diff --git a/src/gopdf/catalog_obj.go b/catalog_obj.go similarity index 99% rename from src/gopdf/catalog_obj.go rename to catalog_obj.go index 754dd56..19f54fa 100644 --- a/src/gopdf/catalog_obj.go +++ b/catalog_obj.go @@ -1,7 +1,5 @@ package gopdf - - import ( "bytes" //"fmt" diff --git a/compile.sh b/compile.sh deleted file mode 100644 index 55aff9b..0000000 --- a/compile.sh +++ /dev/null @@ -1,7 +0,0 @@ -export GOPATH=$PWD -#go install github.com/gorilla/securecookie -#go install github.com/gorilla/sessions -#go install github.com/gorilla/context -#go install onex -#go install main -go build -o bin/gopdf gopdf diff --git a/config.go b/config.go new file mode 100644 index 0000000..124f9b8 --- /dev/null +++ b/config.go @@ -0,0 +1,16 @@ +package gopdf + +import ( + +) + + +type Config struct{ + //pt , mm , cm , in + Unit string + PageSize Rect + K float64 +} + + + diff --git a/src/gopdf/content_obj.go b/content_obj.go similarity index 100% rename from src/gopdf/content_obj.go rename to content_obj.go diff --git a/src/gopdf/current.go b/current.go similarity index 100% rename from src/gopdf/current.go rename to current.go diff --git a/debug.sh b/debug.sh deleted file mode 100644 index de0fa64..0000000 --- a/debug.sh +++ /dev/null @@ -1,4 +0,0 @@ -#source /data/RUN/go/src/pkg/runtime/runtime-gdb.py -rm -f ./bin/gopdf - . ./compile.sh -gdb ./bin/gopdf diff --git a/src/gopdf/embedfont_obj.go b/embedfont_obj.go similarity index 100% rename from src/gopdf/embedfont_obj.go rename to embedfont_obj.go diff --git a/src/gopdf/encoding_obj.go b/encoding_obj.go similarity index 100% rename from src/gopdf/encoding_obj.go rename to encoding_obj.go diff --git a/src/gopdf/font_obj.go b/font_obj.go similarity index 100% rename from src/gopdf/font_obj.go rename to font_obj.go diff --git a/src/gopdf/fontconverthelper.go b/fontconverthelper.go similarity index 100% rename from src/gopdf/fontconverthelper.go rename to fontconverthelper.go diff --git a/src/gopdf/fontdescriptor_obj.go b/fontdescriptor_obj.go similarity index 100% rename from src/gopdf/fontdescriptor_obj.go rename to fontdescriptor_obj.go diff --git a/fonts/Loma.font.go b/fonts/Loma.font.go new file mode 100644 index 0000000..cdceea3 --- /dev/null +++ b/fonts/Loma.font.go @@ -0,0 +1,322 @@ +package fonts +import ( + "github.com/signintech/gopdf" +) +type Loma struct { + family string + fonttype string + name string + desc []gopdf.FontDescItem + up int + ut int + cw gopdf.FontCw + enc string + diff string +} +func (me * Loma) Init(){ + me.cw = make(gopdf.FontCw) + me.cw[gopdf.Chr(0)]=750 + me.cw[gopdf.Chr(1)]=750 + me.cw[gopdf.Chr(2)]=750 + me.cw[gopdf.Chr(3)]=750 + me.cw[gopdf.Chr(4)]=750 + me.cw[gopdf.Chr(5)]=750 + me.cw[gopdf.Chr(6)]=750 + me.cw[gopdf.Chr(7)]=750 + me.cw[gopdf.Chr(8)]=750 + me.cw[gopdf.Chr(9)]=750 + me.cw[gopdf.Chr(10)]=750 + me.cw[gopdf.Chr(11)]=750 + me.cw[gopdf.Chr(12)]=750 + me.cw[gopdf.Chr(13)]=750 + me.cw[gopdf.Chr(14)]=750 + me.cw[gopdf.Chr(15)]=750 + me.cw[gopdf.Chr(16)]=750 + me.cw[gopdf.Chr(17)]=750 + me.cw[gopdf.Chr(18)]=750 + me.cw[gopdf.Chr(19)]=750 + me.cw[gopdf.Chr(20)]=750 + me.cw[gopdf.Chr(21)]=750 + me.cw[gopdf.Chr(22)]=750 + me.cw[gopdf.Chr(23)]=750 + me.cw[gopdf.Chr(24)]=750 + me.cw[gopdf.Chr(25)]=750 + me.cw[gopdf.Chr(26)]=750 + me.cw[gopdf.Chr(27)]=750 + me.cw[gopdf.Chr(28)]=750 + me.cw[gopdf.Chr(29)]=750 + me.cw[gopdf.Chr(30)]=750 + me.cw[gopdf.Chr(31)]=750 + me.cw[gopdf.ToByte(" ")]=500 + me.cw[gopdf.ToByte("!")]=278 + me.cw[gopdf.ToByte("\"")]=355 + me.cw[gopdf.ToByte("#")]=556 + me.cw[gopdf.ToByte("$")]=556 + me.cw[gopdf.ToByte("%")]=889 + me.cw[gopdf.ToByte("&")]=667 + me.cw[gopdf.ToByte("'")]=191 + me.cw[gopdf.ToByte("(")]=333 + me.cw[gopdf.ToByte(")")]=333 + me.cw[gopdf.ToByte("*")]=389 + me.cw[gopdf.ToByte("+")]=584 + me.cw[gopdf.ToByte(",")]=278 + me.cw[gopdf.ToByte("-")]=333 + me.cw[gopdf.ToByte(".")]=278 + me.cw[gopdf.ToByte("/")]=291 + me.cw[gopdf.ToByte("0")]=556 + me.cw[gopdf.ToByte("1")]=556 + me.cw[gopdf.ToByte("2")]=556 + me.cw[gopdf.ToByte("3")]=556 + me.cw[gopdf.ToByte("4")]=556 + me.cw[gopdf.ToByte("5")]=556 + me.cw[gopdf.ToByte("6")]=556 + me.cw[gopdf.ToByte("7")]=556 + me.cw[gopdf.ToByte("8")]=556 + me.cw[gopdf.ToByte("9")]=556 + me.cw[gopdf.ToByte(":")]=278 + me.cw[gopdf.ToByte(";")]=278 + me.cw[gopdf.ToByte("<")]=584 + me.cw[gopdf.ToByte("=")]=584 + me.cw[gopdf.ToByte(">")]=584 + me.cw[gopdf.ToByte("?")]=556 + me.cw[gopdf.ToByte("@")]=1015 + me.cw[gopdf.ToByte("A")]=667 + me.cw[gopdf.ToByte("B")]=667 + me.cw[gopdf.ToByte("C")]=722 + me.cw[gopdf.ToByte("D")]=722 + me.cw[gopdf.ToByte("E")]=667 + me.cw[gopdf.ToByte("F")]=611 + me.cw[gopdf.ToByte("G")]=722 + me.cw[gopdf.ToByte("H")]=722 + me.cw[gopdf.ToByte("I")]=317 + me.cw[gopdf.ToByte("J")]=500 + me.cw[gopdf.ToByte("K")]=667 + me.cw[gopdf.ToByte("L")]=556 + me.cw[gopdf.ToByte("M")]=833 + me.cw[gopdf.ToByte("N")]=722 + me.cw[gopdf.ToByte("O")]=778 + me.cw[gopdf.ToByte("P")]=667 + me.cw[gopdf.ToByte("Q")]=810 + me.cw[gopdf.ToByte("R")]=684 + me.cw[gopdf.ToByte("S")]=667 + me.cw[gopdf.ToByte("T")]=611 + me.cw[gopdf.ToByte("U")]=722 + me.cw[gopdf.ToByte("V")]=667 + me.cw[gopdf.ToByte("W")]=944 + me.cw[gopdf.ToByte("X")]=667 + me.cw[gopdf.ToByte("Y")]=667 + me.cw[gopdf.ToByte("Z")]=611 + me.cw[gopdf.ToByte("[")]=278 + me.cw[gopdf.ToByte("\\")]=278 + me.cw[gopdf.ToByte("]")]=278 + me.cw[gopdf.ToByte("^")]=469 + me.cw[gopdf.ToByte("_")]=556 + me.cw[gopdf.ToByte("`")]=333 + me.cw[gopdf.ToByte("a")]=556 + me.cw[gopdf.ToByte("b")]=556 + me.cw[gopdf.ToByte("c")]=500 + me.cw[gopdf.ToByte("d")]=556 + me.cw[gopdf.ToByte("e")]=556 + me.cw[gopdf.ToByte("f")]=278 + me.cw[gopdf.ToByte("g")]=556 + me.cw[gopdf.ToByte("h")]=556 + me.cw[gopdf.ToByte("i")]=222 + me.cw[gopdf.ToByte("j")]=222 + me.cw[gopdf.ToByte("k")]=500 + me.cw[gopdf.ToByte("l")]=222 + me.cw[gopdf.ToByte("m")]=833 + me.cw[gopdf.ToByte("n")]=556 + me.cw[gopdf.ToByte("o")]=556 + me.cw[gopdf.ToByte("p")]=556 + me.cw[gopdf.ToByte("q")]=556 + me.cw[gopdf.ToByte("r")]=333 + me.cw[gopdf.ToByte("s")]=500 + me.cw[gopdf.ToByte("t")]=278 + me.cw[gopdf.ToByte("u")]=556 + me.cw[gopdf.ToByte("v")]=500 + me.cw[gopdf.ToByte("w")]=722 + me.cw[gopdf.ToByte("x")]=500 + me.cw[gopdf.ToByte("y")]=500 + me.cw[gopdf.ToByte("z")]=500 + me.cw[gopdf.ToByte("{")]=334 + me.cw[gopdf.ToByte("|")]=260 + me.cw[gopdf.ToByte("}")]=334 + me.cw[gopdf.ToByte("~")]=584 + me.cw[gopdf.Chr(127)]=750 + me.cw[gopdf.Chr(128)]=750 + me.cw[gopdf.Chr(129)]=750 + me.cw[gopdf.Chr(130)]=750 + me.cw[gopdf.Chr(131)]=750 + me.cw[gopdf.Chr(132)]=750 + me.cw[gopdf.Chr(133)]=806 + me.cw[gopdf.Chr(134)]=750 + me.cw[gopdf.Chr(135)]=750 + me.cw[gopdf.Chr(136)]=750 + me.cw[gopdf.Chr(137)]=750 + me.cw[gopdf.Chr(138)]=750 + me.cw[gopdf.Chr(139)]=750 + me.cw[gopdf.Chr(140)]=750 + me.cw[gopdf.Chr(141)]=750 + me.cw[gopdf.Chr(142)]=750 + me.cw[gopdf.Chr(143)]=750 + me.cw[gopdf.Chr(144)]=750 + me.cw[gopdf.Chr(145)]=220 + me.cw[gopdf.Chr(146)]=283 + me.cw[gopdf.Chr(147)]=415 + me.cw[gopdf.Chr(148)]=488 + me.cw[gopdf.Chr(149)]=464 + me.cw[gopdf.Chr(150)]=549 + me.cw[gopdf.Chr(151)]=921 + me.cw[gopdf.Chr(152)]=750 + me.cw[gopdf.Chr(153)]=750 + me.cw[gopdf.Chr(154)]=750 + me.cw[gopdf.Chr(155)]=750 + me.cw[gopdf.Chr(156)]=750 + me.cw[gopdf.Chr(157)]=750 + me.cw[gopdf.Chr(158)]=750 + me.cw[gopdf.Chr(159)]=750 + me.cw[gopdf.Chr(160)]=278 + me.cw[gopdf.Chr(161)]=605 + me.cw[gopdf.Chr(162)]=684 + me.cw[gopdf.Chr(163)]=708 + me.cw[gopdf.Chr(164)]=669 + me.cw[gopdf.Chr(165)]=669 + me.cw[gopdf.Chr(166)]=742 + me.cw[gopdf.Chr(167)]=488 + me.cw[gopdf.Chr(168)]=586 + me.cw[gopdf.Chr(169)]=681 + me.cw[gopdf.Chr(170)]=679 + me.cw[gopdf.Chr(171)]=679 + me.cw[gopdf.Chr(172)]=854 + me.cw[gopdf.Chr(173)]=852 + me.cw[gopdf.Chr(174)]=671 + me.cw[gopdf.Chr(175)]=671 + me.cw[gopdf.Chr(176)]=552 + me.cw[gopdf.Chr(177)]=830 + me.cw[gopdf.Chr(178)]=903 + me.cw[gopdf.Chr(179)]=928 + me.cw[gopdf.Chr(180)]=649 + me.cw[gopdf.Chr(181)]=649 + me.cw[gopdf.Chr(182)]=605 + me.cw[gopdf.Chr(183)]=659 + me.cw[gopdf.Chr(184)]=610 + me.cw[gopdf.Chr(185)]=684 + me.cw[gopdf.Chr(186)]=635 + me.cw[gopdf.Chr(187)]=635 + me.cw[gopdf.Chr(188)]=586 + me.cw[gopdf.Chr(189)]=586 + me.cw[gopdf.Chr(190)]=659 + me.cw[gopdf.Chr(191)]=708 + me.cw[gopdf.Chr(192)]=659 + me.cw[gopdf.Chr(193)]=659 + me.cw[gopdf.Chr(194)]=586 + me.cw[gopdf.Chr(195)]=537 + me.cw[gopdf.Chr(196)]=605 + me.cw[gopdf.Chr(197)]=613 + me.cw[gopdf.Chr(198)]=659 + me.cw[gopdf.Chr(199)]=562 + me.cw[gopdf.Chr(200)]=635 + me.cw[gopdf.Chr(201)]=659 + me.cw[gopdf.Chr(202)]=610 + me.cw[gopdf.Chr(203)]=659 + me.cw[gopdf.Chr(204)]=684 + me.cw[gopdf.Chr(205)]=601 + me.cw[gopdf.Chr(206)]=610 + me.cw[gopdf.Chr(207)]=562 + me.cw[gopdf.Chr(208)]=537 + me.cw[gopdf.Chr(209)]=0 + me.cw[gopdf.Chr(210)]=562 + me.cw[gopdf.Chr(211)]=562 + me.cw[gopdf.Chr(212)]=0 + me.cw[gopdf.Chr(213)]=0 + me.cw[gopdf.Chr(214)]=0 + me.cw[gopdf.Chr(215)]=0 + me.cw[gopdf.Chr(216)]=0 + me.cw[gopdf.Chr(217)]=0 + me.cw[gopdf.Chr(218)]=0 + me.cw[gopdf.Chr(219)]=750 + me.cw[gopdf.Chr(220)]=750 + me.cw[gopdf.Chr(221)]=750 + me.cw[gopdf.Chr(222)]=750 + me.cw[gopdf.Chr(223)]=610 + me.cw[gopdf.Chr(224)]=342 + me.cw[gopdf.Chr(225)]=645 + me.cw[gopdf.Chr(226)]=537 + me.cw[gopdf.Chr(227)]=488 + me.cw[gopdf.Chr(228)]=503 + me.cw[gopdf.Chr(229)]=488 + me.cw[gopdf.Chr(230)]=537 + me.cw[gopdf.Chr(231)]=0 + me.cw[gopdf.Chr(232)]=0 + me.cw[gopdf.Chr(233)]=0 + me.cw[gopdf.Chr(234)]=0 + me.cw[gopdf.Chr(235)]=0 + me.cw[gopdf.Chr(236)]=0 + me.cw[gopdf.Chr(237)]=0 + me.cw[gopdf.Chr(238)]=0 + me.cw[gopdf.Chr(239)]=610 + me.cw[gopdf.Chr(240)]=610 + me.cw[gopdf.Chr(241)]=635 + me.cw[gopdf.Chr(242)]=659 + me.cw[gopdf.Chr(243)]=684 + me.cw[gopdf.Chr(244)]=757 + me.cw[gopdf.Chr(245)]=757 + me.cw[gopdf.Chr(246)]=635 + me.cw[gopdf.Chr(247)]=752 + me.cw[gopdf.Chr(248)]=771 + me.cw[gopdf.Chr(249)]=732 + me.cw[gopdf.Chr(250)]=684 + me.cw[gopdf.Chr(251)]=1157 + me.cw[gopdf.Chr(252)]=750 + me.cw[gopdf.Chr(253)]=750 + me.cw[gopdf.Chr(254)]=750 + me.cw[gopdf.Chr(255)]=750 + me.up = -88 + me.ut = 10 + me.fonttype = "TrueType" + me.name = "Loma" + me.enc = "cp874" + me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" + me.desc = make([]gopdf.FontDescItem,8) + me.desc[0] = gopdf.FontDescItem{ Key:"Ascent",Val : "800" } + me.desc[1] = gopdf.FontDescItem{ Key: "Descent", Val : "-200" } + me.desc[2] = gopdf.FontDescItem{ Key:"CapHeight", Val : "800" } + me.desc[3] = gopdf.FontDescItem{ Key: "Flags", Val : "32" } + me.desc[4] = gopdf.FontDescItem{ Key:"FontBBox", Val : "[-743 -440 1338 1146]" } + me.desc[5] = gopdf.FontDescItem{ Key:"ItalicAngle", Val : "0" } + me.desc[6] = gopdf.FontDescItem{ Key:"StemV", Val : "70" } + me.desc[7] = gopdf.FontDescItem{ Key:"MissingWidth", Val : "750" } + } +func (me * Loma)GetType() string{ + return me.fonttype +} +func (me * Loma)GetName() string{ + return me.name +} +func (me * Loma)GetDesc() []gopdf.FontDescItem{ + return me.desc +} +func (me * Loma)GetUp() int{ + return me.up +} +func (me * Loma)GetUt() int{ + return me.ut +} +func (me * Loma)GetCw() gopdf.FontCw{ + return me.cw +} +func (me * Loma)GetEnc() string{ + return me.enc +} +func (me * Loma)GetDiff() string { + return me.diff +} +func (me * Loma) GetOriginalsize() int{ + return 98764 +} +func (me * Loma) SetFamily(family string){ + me.family = family +} +func (me * Loma) GetFamily() string{ + return me.family +} diff --git a/fonts/THSarabun.font.go b/fonts/THSarabun.font.go new file mode 100644 index 0000000..f391872 --- /dev/null +++ b/fonts/THSarabun.font.go @@ -0,0 +1,322 @@ +package fonts +import ( + "github.com/signintech/gopdf" +) +type THSarabun struct { + family string + fonttype string + name string + desc []gopdf.FontDescItem + up int + ut int + cw gopdf.FontCw + enc string + diff string +} +func (me * THSarabun) Init(){ + me.cw = make(gopdf.FontCw) + me.cw[gopdf.Chr(0)]=692 + me.cw[gopdf.Chr(1)]=692 + me.cw[gopdf.Chr(2)]=692 + me.cw[gopdf.Chr(3)]=692 + me.cw[gopdf.Chr(4)]=692 + me.cw[gopdf.Chr(5)]=692 + me.cw[gopdf.Chr(6)]=692 + me.cw[gopdf.Chr(7)]=692 + me.cw[gopdf.Chr(8)]=692 + me.cw[gopdf.Chr(9)]=692 + me.cw[gopdf.Chr(10)]=692 + me.cw[gopdf.Chr(11)]=692 + me.cw[gopdf.Chr(12)]=692 + me.cw[gopdf.Chr(13)]=692 + me.cw[gopdf.Chr(14)]=692 + me.cw[gopdf.Chr(15)]=692 + me.cw[gopdf.Chr(16)]=692 + me.cw[gopdf.Chr(17)]=692 + me.cw[gopdf.Chr(18)]=692 + me.cw[gopdf.Chr(19)]=692 + me.cw[gopdf.Chr(20)]=692 + me.cw[gopdf.Chr(21)]=692 + me.cw[gopdf.Chr(22)]=692 + me.cw[gopdf.Chr(23)]=692 + me.cw[gopdf.Chr(24)]=692 + me.cw[gopdf.Chr(25)]=692 + me.cw[gopdf.Chr(26)]=692 + me.cw[gopdf.Chr(27)]=692 + me.cw[gopdf.Chr(28)]=692 + me.cw[gopdf.Chr(29)]=692 + me.cw[gopdf.Chr(30)]=692 + me.cw[gopdf.Chr(31)]=692 + me.cw[gopdf.ToByte(" ")]=216 + me.cw[gopdf.ToByte("!")]=147 + me.cw[gopdf.ToByte("\"")]=208 + me.cw[gopdf.ToByte("#")]=403 + me.cw[gopdf.ToByte("$")]=361 + me.cw[gopdf.ToByte("%")]=585 + me.cw[gopdf.ToByte("&")]=423 + me.cw[gopdf.ToByte("'")]=120 + me.cw[gopdf.ToByte("(")]=190 + me.cw[gopdf.ToByte(")")]=190 + me.cw[gopdf.ToByte("*")]=285 + me.cw[gopdf.ToByte("+")]=411 + me.cw[gopdf.ToByte(",")]=162 + me.cw[gopdf.ToByte("-")]=216 + me.cw[gopdf.ToByte(".")]=162 + me.cw[gopdf.ToByte("/")]=270 + me.cw[gopdf.ToByte("0")]=362 + me.cw[gopdf.ToByte("1")]=362 + me.cw[gopdf.ToByte("2")]=362 + me.cw[gopdf.ToByte("3")]=362 + me.cw[gopdf.ToByte("4")]=362 + me.cw[gopdf.ToByte("5")]=362 + me.cw[gopdf.ToByte("6")]=362 + me.cw[gopdf.ToByte("7")]=362 + me.cw[gopdf.ToByte("8")]=362 + me.cw[gopdf.ToByte("9")]=362 + me.cw[gopdf.ToByte(":")]=162 + me.cw[gopdf.ToByte(";")]=162 + me.cw[gopdf.ToByte("<")]=411 + me.cw[gopdf.ToByte("=")]=411 + me.cw[gopdf.ToByte(">")]=411 + me.cw[gopdf.ToByte("?")]=283 + me.cw[gopdf.ToByte("@")]=536 + me.cw[gopdf.ToByte("A")]=400 + me.cw[gopdf.ToByte("B")]=378 + me.cw[gopdf.ToByte("C")]=406 + me.cw[gopdf.ToByte("D")]=431 + me.cw[gopdf.ToByte("E")]=351 + me.cw[gopdf.ToByte("F")]=351 + me.cw[gopdf.ToByte("G")]=425 + me.cw[gopdf.ToByte("H")]=441 + me.cw[gopdf.ToByte("I")]=147 + me.cw[gopdf.ToByte("J")]=264 + me.cw[gopdf.ToByte("K")]=376 + me.cw[gopdf.ToByte("L")]=353 + me.cw[gopdf.ToByte("M")]=548 + me.cw[gopdf.ToByte("N")]=441 + me.cw[gopdf.ToByte("O")]=486 + me.cw[gopdf.ToByte("P")]=378 + me.cw[gopdf.ToByte("Q")]=487 + me.cw[gopdf.ToByte("R")]=379 + me.cw[gopdf.ToByte("S")]=352 + me.cw[gopdf.ToByte("T")]=379 + me.cw[gopdf.ToByte("U")]=466 + me.cw[gopdf.ToByte("V")]=390 + me.cw[gopdf.ToByte("W")]=588 + me.cw[gopdf.ToByte("X")]=418 + me.cw[gopdf.ToByte("Y")]=366 + me.cw[gopdf.ToByte("Z")]=424 + me.cw[gopdf.ToByte("[")]=196 + me.cw[gopdf.ToByte("\\")]=262 + me.cw[gopdf.ToByte("]")]=196 + me.cw[gopdf.ToByte("^")]=412 + me.cw[gopdf.ToByte("_")]=352 + me.cw[gopdf.ToByte("`")]=204 + me.cw[gopdf.ToByte("a")]=344 + me.cw[gopdf.ToByte("b")]=401 + me.cw[gopdf.ToByte("c")]=331 + me.cw[gopdf.ToByte("d")]=401 + me.cw[gopdf.ToByte("e")]=374 + me.cw[gopdf.ToByte("f")]=206 + me.cw[gopdf.ToByte("g")]=311 + me.cw[gopdf.ToByte("h")]=390 + me.cw[gopdf.ToByte("i")]=143 + me.cw[gopdf.ToByte("j")]=155 + me.cw[gopdf.ToByte("k")]=316 + me.cw[gopdf.ToByte("l")]=200 + me.cw[gopdf.ToByte("m")]=601 + me.cw[gopdf.ToByte("n")]=390 + me.cw[gopdf.ToByte("o")]=398 + me.cw[gopdf.ToByte("p")]=401 + me.cw[gopdf.ToByte("q")]=401 + me.cw[gopdf.ToByte("r")]=217 + me.cw[gopdf.ToByte("s")]=282 + me.cw[gopdf.ToByte("t")]=238 + me.cw[gopdf.ToByte("u")]=390 + me.cw[gopdf.ToByte("v")]=341 + me.cw[gopdf.ToByte("w")]=507 + me.cw[gopdf.ToByte("x")]=318 + me.cw[gopdf.ToByte("y")]=337 + me.cw[gopdf.ToByte("z")]=321 + me.cw[gopdf.ToByte("{")]=208 + me.cw[gopdf.ToByte("|")]=153 + me.cw[gopdf.ToByte("}")]=208 + me.cw[gopdf.ToByte("~")]=416 + me.cw[gopdf.Chr(127)]=692 + me.cw[gopdf.Chr(128)]=406 + me.cw[gopdf.Chr(129)]=692 + me.cw[gopdf.Chr(130)]=692 + me.cw[gopdf.Chr(131)]=692 + me.cw[gopdf.Chr(132)]=692 + me.cw[gopdf.Chr(133)]=479 + me.cw[gopdf.Chr(134)]=692 + me.cw[gopdf.Chr(135)]=692 + me.cw[gopdf.Chr(136)]=692 + me.cw[gopdf.Chr(137)]=692 + me.cw[gopdf.Chr(138)]=692 + me.cw[gopdf.Chr(139)]=692 + me.cw[gopdf.Chr(140)]=692 + me.cw[gopdf.Chr(141)]=692 + me.cw[gopdf.Chr(142)]=692 + me.cw[gopdf.Chr(143)]=692 + me.cw[gopdf.Chr(144)]=692 + me.cw[gopdf.Chr(145)]=247 + me.cw[gopdf.Chr(146)]=247 + me.cw[gopdf.Chr(147)]=370 + me.cw[gopdf.Chr(148)]=370 + me.cw[gopdf.Chr(149)]=216 + me.cw[gopdf.Chr(150)]=360 + me.cw[gopdf.Chr(151)]=720 + me.cw[gopdf.Chr(152)]=692 + me.cw[gopdf.Chr(153)]=692 + me.cw[gopdf.Chr(154)]=692 + me.cw[gopdf.Chr(155)]=692 + me.cw[gopdf.Chr(156)]=692 + me.cw[gopdf.Chr(157)]=692 + me.cw[gopdf.Chr(158)]=692 + me.cw[gopdf.Chr(159)]=692 + me.cw[gopdf.Chr(160)]=216 + me.cw[gopdf.Chr(161)]=386 + me.cw[gopdf.Chr(162)]=378 + me.cw[gopdf.Chr(163)]=382 + me.cw[gopdf.Chr(164)]=393 + me.cw[gopdf.Chr(165)]=393 + me.cw[gopdf.Chr(166)]=408 + me.cw[gopdf.Chr(167)]=294 + me.cw[gopdf.Chr(168)]=367 + me.cw[gopdf.Chr(169)]=377 + me.cw[gopdf.Chr(170)]=380 + me.cw[gopdf.Chr(171)]=384 + me.cw[gopdf.Chr(172)]=519 + me.cw[gopdf.Chr(173)]=519 + me.cw[gopdf.Chr(174)]=425 + me.cw[gopdf.Chr(175)]=425 + me.cw[gopdf.Chr(176)]=343 + me.cw[gopdf.Chr(177)]=461 + me.cw[gopdf.Chr(178)]=532 + me.cw[gopdf.Chr(179)]=543 + me.cw[gopdf.Chr(180)]=391 + me.cw[gopdf.Chr(181)]=391 + me.cw[gopdf.Chr(182)]=378 + me.cw[gopdf.Chr(183)]=430 + me.cw[gopdf.Chr(184)]=335 + me.cw[gopdf.Chr(185)]=420 + me.cw[gopdf.Chr(186)]=428 + me.cw[gopdf.Chr(187)]=428 + me.cw[gopdf.Chr(188)]=381 + me.cw[gopdf.Chr(189)]=381 + me.cw[gopdf.Chr(190)]=447 + me.cw[gopdf.Chr(191)]=447 + me.cw[gopdf.Chr(192)]=425 + me.cw[gopdf.Chr(193)]=400 + me.cw[gopdf.Chr(194)]=375 + me.cw[gopdf.Chr(195)]=322 + me.cw[gopdf.Chr(196)]=378 + me.cw[gopdf.Chr(197)]=381 + me.cw[gopdf.Chr(198)]=425 + me.cw[gopdf.Chr(199)]=335 + me.cw[gopdf.Chr(200)]=393 + me.cw[gopdf.Chr(201)]=438 + me.cw[gopdf.Chr(202)]=381 + me.cw[gopdf.Chr(203)]=427 + me.cw[gopdf.Chr(204)]=454 + me.cw[gopdf.Chr(205)]=387 + me.cw[gopdf.Chr(206)]=372 + me.cw[gopdf.Chr(207)]=391 + me.cw[gopdf.Chr(208)]=357 + me.cw[gopdf.Chr(209)]=0 + me.cw[gopdf.Chr(210)]=316 + me.cw[gopdf.Chr(211)]=316 + me.cw[gopdf.Chr(212)]=0 + me.cw[gopdf.Chr(213)]=0 + me.cw[gopdf.Chr(214)]=0 + me.cw[gopdf.Chr(215)]=0 + me.cw[gopdf.Chr(216)]=0 + me.cw[gopdf.Chr(217)]=0 + me.cw[gopdf.Chr(218)]=0 + me.cw[gopdf.Chr(219)]=692 + me.cw[gopdf.Chr(220)]=692 + me.cw[gopdf.Chr(221)]=692 + me.cw[gopdf.Chr(222)]=692 + me.cw[gopdf.Chr(223)]=411 + me.cw[gopdf.Chr(224)]=203 + me.cw[gopdf.Chr(225)]=377 + me.cw[gopdf.Chr(226)]=237 + me.cw[gopdf.Chr(227)]=242 + me.cw[gopdf.Chr(228)]=244 + me.cw[gopdf.Chr(229)]=205 + me.cw[gopdf.Chr(230)]=399 + me.cw[gopdf.Chr(231)]=0 + me.cw[gopdf.Chr(232)]=0 + me.cw[gopdf.Chr(233)]=0 + me.cw[gopdf.Chr(234)]=0 + me.cw[gopdf.Chr(235)]=0 + me.cw[gopdf.Chr(236)]=0 + me.cw[gopdf.Chr(237)]=0 + me.cw[gopdf.Chr(238)]=0 + me.cw[gopdf.Chr(239)]=450 + me.cw[gopdf.Chr(240)]=449 + me.cw[gopdf.Chr(241)]=449 + me.cw[gopdf.Chr(242)]=449 + me.cw[gopdf.Chr(243)]=449 + me.cw[gopdf.Chr(244)]=449 + me.cw[gopdf.Chr(245)]=449 + me.cw[gopdf.Chr(246)]=449 + me.cw[gopdf.Chr(247)]=449 + me.cw[gopdf.Chr(248)]=449 + me.cw[gopdf.Chr(249)]=449 + me.cw[gopdf.Chr(250)]=522 + me.cw[gopdf.Chr(251)]=697 + me.cw[gopdf.Chr(252)]=692 + me.cw[gopdf.Chr(253)]=692 + me.cw[gopdf.Chr(254)]=692 + me.cw[gopdf.Chr(255)]=692 + me.up = -35 + me.ut = 30 + me.fonttype = "TrueType" + me.name = "THSarabunPSK" + me.enc = "cp874" + me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" + me.desc = make([]gopdf.FontDescItem,8) + me.desc[0] = gopdf.FontDescItem{ Key:"Ascent",Val : "850" } + me.desc[1] = gopdf.FontDescItem{ Key: "Descent", Val : "-250" } + me.desc[2] = gopdf.FontDescItem{ Key:"CapHeight", Val : "476" } + me.desc[3] = gopdf.FontDescItem{ Key: "Flags", Val : "32" } + me.desc[4] = gopdf.FontDescItem{ Key:"FontBBox", Val : "[-427 -421 947 836]" } + me.desc[5] = gopdf.FontDescItem{ Key:"ItalicAngle", Val : "0" } + me.desc[6] = gopdf.FontDescItem{ Key:"StemV", Val : "70" } + me.desc[7] = gopdf.FontDescItem{ Key:"MissingWidth", Val : "692" } + } +func (me * THSarabun)GetType() string{ + return me.fonttype +} +func (me * THSarabun)GetName() string{ + return me.name +} +func (me * THSarabun)GetDesc() []gopdf.FontDescItem{ + return me.desc +} +func (me * THSarabun)GetUp() int{ + return me.up +} +func (me * THSarabun)GetUt() int{ + return me.ut +} +func (me * THSarabun)GetCw() gopdf.FontCw{ + return me.cw +} +func (me * THSarabun)GetEnc() string{ + return me.enc +} +func (me * THSarabun)GetDiff() string { + return me.diff +} +func (me * THSarabun) GetOriginalsize() int{ + return 98764 +} +func (me * THSarabun) SetFamily(family string){ + me.family = family +} +func (me * THSarabun) GetFamily() string{ + return me.family +} diff --git a/fonts/THSarabunNew.font.go b/fonts/THSarabunNew.font.go new file mode 100755 index 0000000..d667de6 --- /dev/null +++ b/fonts/THSarabunNew.font.go @@ -0,0 +1,322 @@ +package fonts +import ( + "github.com/signintech/gopdf" +) +type THSarabunNew struct { + family string + fonttype string + name string + desc []gopdf.FontDescItem + up int + ut int + cw gopdf.FontCw + enc string + diff string +} +func (me * THSarabunNew) Init(){ + me.cw = make(gopdf.FontCw) + me.cw[gopdf.Chr(0)]=692 + me.cw[gopdf.Chr(1)]=692 + me.cw[gopdf.Chr(2)]=692 + me.cw[gopdf.Chr(3)]=692 + me.cw[gopdf.Chr(4)]=692 + me.cw[gopdf.Chr(5)]=692 + me.cw[gopdf.Chr(6)]=692 + me.cw[gopdf.Chr(7)]=692 + me.cw[gopdf.Chr(8)]=692 + me.cw[gopdf.Chr(9)]=692 + me.cw[gopdf.Chr(10)]=692 + me.cw[gopdf.Chr(11)]=692 + me.cw[gopdf.Chr(12)]=692 + me.cw[gopdf.Chr(13)]=692 + me.cw[gopdf.Chr(14)]=692 + me.cw[gopdf.Chr(15)]=692 + me.cw[gopdf.Chr(16)]=692 + me.cw[gopdf.Chr(17)]=692 + me.cw[gopdf.Chr(18)]=692 + me.cw[gopdf.Chr(19)]=692 + me.cw[gopdf.Chr(20)]=692 + me.cw[gopdf.Chr(21)]=692 + me.cw[gopdf.Chr(22)]=692 + me.cw[gopdf.Chr(23)]=692 + me.cw[gopdf.Chr(24)]=692 + me.cw[gopdf.Chr(25)]=692 + me.cw[gopdf.Chr(26)]=692 + me.cw[gopdf.Chr(27)]=692 + me.cw[gopdf.Chr(28)]=692 + me.cw[gopdf.Chr(29)]=692 + me.cw[gopdf.Chr(30)]=692 + me.cw[gopdf.Chr(31)]=692 + me.cw[gopdf.ToByte(" ")]=216 + me.cw[gopdf.ToByte("!")]=147 + me.cw[gopdf.ToByte("\"")]=208 + me.cw[gopdf.ToByte("#")]=403 + me.cw[gopdf.ToByte("$")]=361 + me.cw[gopdf.ToByte("%")]=585 + me.cw[gopdf.ToByte("&")]=423 + me.cw[gopdf.ToByte("'")]=120 + me.cw[gopdf.ToByte("(")]=190 + me.cw[gopdf.ToByte(")")]=190 + me.cw[gopdf.ToByte("*")]=285 + me.cw[gopdf.ToByte("+")]=411 + me.cw[gopdf.ToByte(",")]=162 + me.cw[gopdf.ToByte("-")]=216 + me.cw[gopdf.ToByte(".")]=162 + me.cw[gopdf.ToByte("/")]=270 + me.cw[gopdf.ToByte("0")]=362 + me.cw[gopdf.ToByte("1")]=362 + me.cw[gopdf.ToByte("2")]=362 + me.cw[gopdf.ToByte("3")]=362 + me.cw[gopdf.ToByte("4")]=362 + me.cw[gopdf.ToByte("5")]=362 + me.cw[gopdf.ToByte("6")]=362 + me.cw[gopdf.ToByte("7")]=362 + me.cw[gopdf.ToByte("8")]=362 + me.cw[gopdf.ToByte("9")]=362 + me.cw[gopdf.ToByte(":")]=162 + me.cw[gopdf.ToByte(";")]=162 + me.cw[gopdf.ToByte("<")]=411 + me.cw[gopdf.ToByte("=")]=411 + me.cw[gopdf.ToByte(">")]=411 + me.cw[gopdf.ToByte("?")]=283 + me.cw[gopdf.ToByte("@")]=536 + me.cw[gopdf.ToByte("A")]=400 + me.cw[gopdf.ToByte("B")]=378 + me.cw[gopdf.ToByte("C")]=406 + me.cw[gopdf.ToByte("D")]=431 + me.cw[gopdf.ToByte("E")]=351 + me.cw[gopdf.ToByte("F")]=351 + me.cw[gopdf.ToByte("G")]=425 + me.cw[gopdf.ToByte("H")]=441 + me.cw[gopdf.ToByte("I")]=147 + me.cw[gopdf.ToByte("J")]=264 + me.cw[gopdf.ToByte("K")]=376 + me.cw[gopdf.ToByte("L")]=353 + me.cw[gopdf.ToByte("M")]=548 + me.cw[gopdf.ToByte("N")]=441 + me.cw[gopdf.ToByte("O")]=486 + me.cw[gopdf.ToByte("P")]=378 + me.cw[gopdf.ToByte("Q")]=487 + me.cw[gopdf.ToByte("R")]=379 + me.cw[gopdf.ToByte("S")]=352 + me.cw[gopdf.ToByte("T")]=379 + me.cw[gopdf.ToByte("U")]=466 + me.cw[gopdf.ToByte("V")]=390 + me.cw[gopdf.ToByte("W")]=588 + me.cw[gopdf.ToByte("X")]=418 + me.cw[gopdf.ToByte("Y")]=366 + me.cw[gopdf.ToByte("Z")]=424 + me.cw[gopdf.ToByte("[")]=196 + me.cw[gopdf.ToByte("\\")]=262 + me.cw[gopdf.ToByte("]")]=196 + me.cw[gopdf.ToByte("^")]=412 + me.cw[gopdf.ToByte("_")]=352 + me.cw[gopdf.ToByte("`")]=204 + me.cw[gopdf.ToByte("a")]=344 + me.cw[gopdf.ToByte("b")]=401 + me.cw[gopdf.ToByte("c")]=331 + me.cw[gopdf.ToByte("d")]=401 + me.cw[gopdf.ToByte("e")]=374 + me.cw[gopdf.ToByte("f")]=206 + me.cw[gopdf.ToByte("g")]=311 + me.cw[gopdf.ToByte("h")]=390 + me.cw[gopdf.ToByte("i")]=143 + me.cw[gopdf.ToByte("j")]=155 + me.cw[gopdf.ToByte("k")]=316 + me.cw[gopdf.ToByte("l")]=200 + me.cw[gopdf.ToByte("m")]=601 + me.cw[gopdf.ToByte("n")]=390 + me.cw[gopdf.ToByte("o")]=398 + me.cw[gopdf.ToByte("p")]=401 + me.cw[gopdf.ToByte("q")]=401 + me.cw[gopdf.ToByte("r")]=217 + me.cw[gopdf.ToByte("s")]=282 + me.cw[gopdf.ToByte("t")]=238 + me.cw[gopdf.ToByte("u")]=390 + me.cw[gopdf.ToByte("v")]=341 + me.cw[gopdf.ToByte("w")]=507 + me.cw[gopdf.ToByte("x")]=318 + me.cw[gopdf.ToByte("y")]=337 + me.cw[gopdf.ToByte("z")]=321 + me.cw[gopdf.ToByte("{")]=208 + me.cw[gopdf.ToByte("|")]=153 + me.cw[gopdf.ToByte("}")]=208 + me.cw[gopdf.ToByte("~")]=416 + me.cw[gopdf.Chr(127)]=692 + me.cw[gopdf.Chr(128)]=406 + me.cw[gopdf.Chr(129)]=692 + me.cw[gopdf.Chr(130)]=692 + me.cw[gopdf.Chr(131)]=692 + me.cw[gopdf.Chr(132)]=692 + me.cw[gopdf.Chr(133)]=479 + me.cw[gopdf.Chr(134)]=692 + me.cw[gopdf.Chr(135)]=692 + me.cw[gopdf.Chr(136)]=692 + me.cw[gopdf.Chr(137)]=692 + me.cw[gopdf.Chr(138)]=692 + me.cw[gopdf.Chr(139)]=692 + me.cw[gopdf.Chr(140)]=692 + me.cw[gopdf.Chr(141)]=692 + me.cw[gopdf.Chr(142)]=692 + me.cw[gopdf.Chr(143)]=692 + me.cw[gopdf.Chr(144)]=692 + me.cw[gopdf.Chr(145)]=247 + me.cw[gopdf.Chr(146)]=247 + me.cw[gopdf.Chr(147)]=370 + me.cw[gopdf.Chr(148)]=370 + me.cw[gopdf.Chr(149)]=216 + me.cw[gopdf.Chr(150)]=360 + me.cw[gopdf.Chr(151)]=720 + me.cw[gopdf.Chr(152)]=692 + me.cw[gopdf.Chr(153)]=692 + me.cw[gopdf.Chr(154)]=692 + me.cw[gopdf.Chr(155)]=692 + me.cw[gopdf.Chr(156)]=692 + me.cw[gopdf.Chr(157)]=692 + me.cw[gopdf.Chr(158)]=692 + me.cw[gopdf.Chr(159)]=692 + me.cw[gopdf.Chr(160)]=216 + me.cw[gopdf.Chr(161)]=386 + me.cw[gopdf.Chr(162)]=378 + me.cw[gopdf.Chr(163)]=382 + me.cw[gopdf.Chr(164)]=393 + me.cw[gopdf.Chr(165)]=393 + me.cw[gopdf.Chr(166)]=408 + me.cw[gopdf.Chr(167)]=294 + me.cw[gopdf.Chr(168)]=367 + me.cw[gopdf.Chr(169)]=377 + me.cw[gopdf.Chr(170)]=380 + me.cw[gopdf.Chr(171)]=384 + me.cw[gopdf.Chr(172)]=519 + me.cw[gopdf.Chr(173)]=519 + me.cw[gopdf.Chr(174)]=425 + me.cw[gopdf.Chr(175)]=425 + me.cw[gopdf.Chr(176)]=343 + me.cw[gopdf.Chr(177)]=461 + me.cw[gopdf.Chr(178)]=532 + me.cw[gopdf.Chr(179)]=543 + me.cw[gopdf.Chr(180)]=391 + me.cw[gopdf.Chr(181)]=391 + me.cw[gopdf.Chr(182)]=378 + me.cw[gopdf.Chr(183)]=430 + me.cw[gopdf.Chr(184)]=335 + me.cw[gopdf.Chr(185)]=420 + me.cw[gopdf.Chr(186)]=428 + me.cw[gopdf.Chr(187)]=428 + me.cw[gopdf.Chr(188)]=381 + me.cw[gopdf.Chr(189)]=381 + me.cw[gopdf.Chr(190)]=447 + me.cw[gopdf.Chr(191)]=447 + me.cw[gopdf.Chr(192)]=425 + me.cw[gopdf.Chr(193)]=400 + me.cw[gopdf.Chr(194)]=375 + me.cw[gopdf.Chr(195)]=322 + me.cw[gopdf.Chr(196)]=378 + me.cw[gopdf.Chr(197)]=381 + me.cw[gopdf.Chr(198)]=425 + me.cw[gopdf.Chr(199)]=335 + me.cw[gopdf.Chr(200)]=393 + me.cw[gopdf.Chr(201)]=438 + me.cw[gopdf.Chr(202)]=381 + me.cw[gopdf.Chr(203)]=427 + me.cw[gopdf.Chr(204)]=454 + me.cw[gopdf.Chr(205)]=387 + me.cw[gopdf.Chr(206)]=372 + me.cw[gopdf.Chr(207)]=391 + me.cw[gopdf.Chr(208)]=357 + me.cw[gopdf.Chr(209)]=0 + me.cw[gopdf.Chr(210)]=316 + me.cw[gopdf.Chr(211)]=316 + me.cw[gopdf.Chr(212)]=0 + me.cw[gopdf.Chr(213)]=0 + me.cw[gopdf.Chr(214)]=0 + me.cw[gopdf.Chr(215)]=0 + me.cw[gopdf.Chr(216)]=0 + me.cw[gopdf.Chr(217)]=0 + me.cw[gopdf.Chr(218)]=0 + me.cw[gopdf.Chr(219)]=692 + me.cw[gopdf.Chr(220)]=692 + me.cw[gopdf.Chr(221)]=692 + me.cw[gopdf.Chr(222)]=692 + me.cw[gopdf.Chr(223)]=411 + me.cw[gopdf.Chr(224)]=203 + me.cw[gopdf.Chr(225)]=377 + me.cw[gopdf.Chr(226)]=237 + me.cw[gopdf.Chr(227)]=242 + me.cw[gopdf.Chr(228)]=244 + me.cw[gopdf.Chr(229)]=205 + me.cw[gopdf.Chr(230)]=399 + me.cw[gopdf.Chr(231)]=0 + me.cw[gopdf.Chr(232)]=0 + me.cw[gopdf.Chr(233)]=0 + me.cw[gopdf.Chr(234)]=0 + me.cw[gopdf.Chr(235)]=0 + me.cw[gopdf.Chr(236)]=0 + me.cw[gopdf.Chr(237)]=0 + me.cw[gopdf.Chr(238)]=0 + me.cw[gopdf.Chr(239)]=450 + me.cw[gopdf.Chr(240)]=449 + me.cw[gopdf.Chr(241)]=449 + me.cw[gopdf.Chr(242)]=449 + me.cw[gopdf.Chr(243)]=449 + me.cw[gopdf.Chr(244)]=449 + me.cw[gopdf.Chr(245)]=449 + me.cw[gopdf.Chr(246)]=449 + me.cw[gopdf.Chr(247)]=449 + me.cw[gopdf.Chr(248)]=449 + me.cw[gopdf.Chr(249)]=449 + me.cw[gopdf.Chr(250)]=522 + me.cw[gopdf.Chr(251)]=697 + me.cw[gopdf.Chr(252)]=692 + me.cw[gopdf.Chr(253)]=692 + me.cw[gopdf.Chr(254)]=692 + me.cw[gopdf.Chr(255)]=692 + me.up = -35 + me.ut = 30 + me.fonttype = "TrueType" + me.name = "THSarabunNew" + me.enc = "cp874" + me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" + me.desc = make([]gopdf.FontDescItem,8) + me.desc[0] = gopdf.FontDescItem{ Key:"Ascent",Val : "850" } + me.desc[1] = gopdf.FontDescItem{ Key: "Descent", Val : "-250" } + me.desc[2] = gopdf.FontDescItem{ Key:"CapHeight", Val : "476" } + me.desc[3] = gopdf.FontDescItem{ Key: "Flags", Val : "32" } + me.desc[4] = gopdf.FontDescItem{ Key:"FontBBox", Val : "[-427 -421 947 836]" } + me.desc[5] = gopdf.FontDescItem{ Key:"ItalicAngle", Val : "0" } + me.desc[6] = gopdf.FontDescItem{ Key:"StemV", Val : "70" } + me.desc[7] = gopdf.FontDescItem{ Key:"MissingWidth", Val : "692" } + } +func (me * THSarabunNew)GetType() string{ + return me.fonttype +} +func (me * THSarabunNew)GetName() string{ + return me.name +} +func (me * THSarabunNew)GetDesc() []gopdf.FontDescItem{ + return me.desc +} +func (me * THSarabunNew)GetUp() int{ + return me.up +} +func (me * THSarabunNew)GetUt() int{ + return me.ut +} +func (me * THSarabunNew)GetCw() gopdf.FontCw{ + return me.cw +} +func (me * THSarabunNew)GetEnc() string{ + return me.enc +} +func (me * THSarabunNew)GetDiff() string { + return me.diff +} +func (me * THSarabunNew) GetOriginalsize() int{ + return 98764 +} +func (me * THSarabunNew) SetFamily(family string){ + me.family = family +} +func (me * THSarabunNew) GetFamily() string{ + return me.family +} diff --git a/fonts/THSarabunNew_Bold.font.go b/fonts/THSarabunNew_Bold.font.go new file mode 100755 index 0000000..72984fb --- /dev/null +++ b/fonts/THSarabunNew_Bold.font.go @@ -0,0 +1,322 @@ +package fonts +import ( + "github.com/signintech/gopdf" +) +type THSarabunNewBold struct { + family string + fonttype string + name string + desc []gopdf.FontDescItem + up int + ut int + cw gopdf.FontCw + enc string + diff string +} +func (me * THSarabunNewBold) Init(){ + me.cw = make(gopdf.FontCw) + me.cw[gopdf.Chr(0)]=698 + me.cw[gopdf.Chr(1)]=698 + me.cw[gopdf.Chr(2)]=698 + me.cw[gopdf.Chr(3)]=698 + me.cw[gopdf.Chr(4)]=698 + me.cw[gopdf.Chr(5)]=698 + me.cw[gopdf.Chr(6)]=698 + me.cw[gopdf.Chr(7)]=698 + me.cw[gopdf.Chr(8)]=698 + me.cw[gopdf.Chr(9)]=698 + me.cw[gopdf.Chr(10)]=698 + me.cw[gopdf.Chr(11)]=698 + me.cw[gopdf.Chr(12)]=698 + me.cw[gopdf.Chr(13)]=698 + me.cw[gopdf.Chr(14)]=698 + me.cw[gopdf.Chr(15)]=698 + me.cw[gopdf.Chr(16)]=698 + me.cw[gopdf.Chr(17)]=698 + me.cw[gopdf.Chr(18)]=698 + me.cw[gopdf.Chr(19)]=698 + me.cw[gopdf.Chr(20)]=698 + me.cw[gopdf.Chr(21)]=698 + me.cw[gopdf.Chr(22)]=698 + me.cw[gopdf.Chr(23)]=698 + me.cw[gopdf.Chr(24)]=698 + me.cw[gopdf.Chr(25)]=698 + me.cw[gopdf.Chr(26)]=698 + me.cw[gopdf.Chr(27)]=698 + me.cw[gopdf.Chr(28)]=698 + me.cw[gopdf.Chr(29)]=698 + me.cw[gopdf.Chr(30)]=698 + me.cw[gopdf.Chr(31)]=698 + me.cw[gopdf.ToByte(" ")]=226 + me.cw[gopdf.ToByte("!")]=168 + me.cw[gopdf.ToByte("\"")]=291 + me.cw[gopdf.ToByte("#")]=462 + me.cw[gopdf.ToByte("$")]=367 + me.cw[gopdf.ToByte("%")]=688 + me.cw[gopdf.ToByte("&")]=486 + me.cw[gopdf.ToByte("'")]=169 + me.cw[gopdf.ToByte("(")]=244 + me.cw[gopdf.ToByte(")")]=244 + me.cw[gopdf.ToByte("*")]=343 + me.cw[gopdf.ToByte("+")]=417 + me.cw[gopdf.ToByte(",")]=172 + me.cw[gopdf.ToByte("-")]=226 + me.cw[gopdf.ToByte(".")]=172 + me.cw[gopdf.ToByte("/")]=276 + me.cw[gopdf.ToByte("0")]=378 + me.cw[gopdf.ToByte("1")]=378 + me.cw[gopdf.ToByte("2")]=378 + me.cw[gopdf.ToByte("3")]=378 + me.cw[gopdf.ToByte("4")]=378 + me.cw[gopdf.ToByte("5")]=378 + me.cw[gopdf.ToByte("6")]=378 + me.cw[gopdf.ToByte("7")]=378 + me.cw[gopdf.ToByte("8")]=378 + me.cw[gopdf.ToByte("9")]=378 + me.cw[gopdf.ToByte(":")]=172 + me.cw[gopdf.ToByte(";")]=172 + me.cw[gopdf.ToByte("<")]=417 + me.cw[gopdf.ToByte("=")]=417 + me.cw[gopdf.ToByte(">")]=417 + me.cw[gopdf.ToByte("?")]=289 + me.cw[gopdf.ToByte("@")]=572 + me.cw[gopdf.ToByte("A")]=451 + me.cw[gopdf.ToByte("B")]=396 + me.cw[gopdf.ToByte("C")]=432 + me.cw[gopdf.ToByte("D")]=459 + me.cw[gopdf.ToByte("E")]=358 + me.cw[gopdf.ToByte("F")]=358 + me.cw[gopdf.ToByte("G")]=454 + me.cw[gopdf.ToByte("H")]=472 + me.cw[gopdf.ToByte("I")]=163 + me.cw[gopdf.ToByte("J")]=282 + me.cw[gopdf.ToByte("K")]=411 + me.cw[gopdf.ToByte("L")]=359 + me.cw[gopdf.ToByte("M")]=574 + me.cw[gopdf.ToByte("N")]=472 + me.cw[gopdf.ToByte("O")]=518 + me.cw[gopdf.ToByte("P")]=390 + me.cw[gopdf.ToByte("Q")]=518 + me.cw[gopdf.ToByte("R")]=395 + me.cw[gopdf.ToByte("S")]=365 + me.cw[gopdf.ToByte("T")]=421 + me.cw[gopdf.ToByte("U")]=482 + me.cw[gopdf.ToByte("V")]=422 + me.cw[gopdf.ToByte("W")]=612 + me.cw[gopdf.ToByte("X")]=426 + me.cw[gopdf.ToByte("Y")]=396 + me.cw[gopdf.ToByte("Z")]=451 + me.cw[gopdf.ToByte("[")]=234 + me.cw[gopdf.ToByte("\\")]=268 + me.cw[gopdf.ToByte("]")]=234 + me.cw[gopdf.ToByte("^")]=418 + me.cw[gopdf.ToByte("_")]=376 + me.cw[gopdf.ToByte("`")]=210 + me.cw[gopdf.ToByte("a")]=367 + me.cw[gopdf.ToByte("b")]=435 + me.cw[gopdf.ToByte("c")]=347 + me.cw[gopdf.ToByte("d")]=435 + me.cw[gopdf.ToByte("e")]=391 + me.cw[gopdf.ToByte("f")]=254 + me.cw[gopdf.ToByte("g")]=332 + me.cw[gopdf.ToByte("h")]=423 + me.cw[gopdf.ToByte("i")]=163 + me.cw[gopdf.ToByte("j")]=171 + me.cw[gopdf.ToByte("k")]=340 + me.cw[gopdf.ToByte("l")]=213 + me.cw[gopdf.ToByte("m")]=636 + me.cw[gopdf.ToByte("n")]=423 + me.cw[gopdf.ToByte("o")]=412 + me.cw[gopdf.ToByte("p")]=431 + me.cw[gopdf.ToByte("q")]=431 + me.cw[gopdf.ToByte("r")]=246 + me.cw[gopdf.ToByte("s")]=296 + me.cw[gopdf.ToByte("t")]=258 + me.cw[gopdf.ToByte("u")]=418 + me.cw[gopdf.ToByte("v")]=358 + me.cw[gopdf.ToByte("w")]=480 + me.cw[gopdf.ToByte("x")]=349 + me.cw[gopdf.ToByte("y")]=361 + me.cw[gopdf.ToByte("z")]=358 + me.cw[gopdf.ToByte("{")]=255 + me.cw[gopdf.ToByte("|")]=177 + me.cw[gopdf.ToByte("}")]=255 + me.cw[gopdf.ToByte("~")]=422 + me.cw[gopdf.Chr(127)]=698 + me.cw[gopdf.Chr(128)]=518 + me.cw[gopdf.Chr(129)]=698 + me.cw[gopdf.Chr(130)]=698 + me.cw[gopdf.Chr(131)]=698 + me.cw[gopdf.Chr(132)]=698 + me.cw[gopdf.Chr(133)]=504 + me.cw[gopdf.Chr(134)]=698 + me.cw[gopdf.Chr(135)]=698 + me.cw[gopdf.Chr(136)]=698 + me.cw[gopdf.Chr(137)]=698 + me.cw[gopdf.Chr(138)]=698 + me.cw[gopdf.Chr(139)]=698 + me.cw[gopdf.Chr(140)]=698 + me.cw[gopdf.Chr(141)]=698 + me.cw[gopdf.Chr(142)]=698 + me.cw[gopdf.Chr(143)]=698 + me.cw[gopdf.Chr(144)]=698 + me.cw[gopdf.Chr(145)]=253 + me.cw[gopdf.Chr(146)]=253 + me.cw[gopdf.Chr(147)]=384 + me.cw[gopdf.Chr(148)]=384 + me.cw[gopdf.Chr(149)]=226 + me.cw[gopdf.Chr(150)]=335 + me.cw[gopdf.Chr(151)]=693 + me.cw[gopdf.Chr(152)]=698 + me.cw[gopdf.Chr(153)]=698 + me.cw[gopdf.Chr(154)]=698 + me.cw[gopdf.Chr(155)]=698 + me.cw[gopdf.Chr(156)]=698 + me.cw[gopdf.Chr(157)]=698 + me.cw[gopdf.Chr(158)]=698 + me.cw[gopdf.Chr(159)]=698 + me.cw[gopdf.Chr(160)]=226 + me.cw[gopdf.Chr(161)]=391 + me.cw[gopdf.Chr(162)]=415 + me.cw[gopdf.Chr(163)]=431 + me.cw[gopdf.Chr(164)]=403 + me.cw[gopdf.Chr(165)]=403 + me.cw[gopdf.Chr(166)]=453 + me.cw[gopdf.Chr(167)]=318 + me.cw[gopdf.Chr(168)]=390 + me.cw[gopdf.Chr(169)]=405 + me.cw[gopdf.Chr(170)]=415 + me.cw[gopdf.Chr(171)]=431 + me.cw[gopdf.Chr(172)]=565 + me.cw[gopdf.Chr(173)]=565 + me.cw[gopdf.Chr(174)]=425 + me.cw[gopdf.Chr(175)]=425 + me.cw[gopdf.Chr(176)]=372 + me.cw[gopdf.Chr(177)]=492 + me.cw[gopdf.Chr(178)]=551 + me.cw[gopdf.Chr(179)]=576 + me.cw[gopdf.Chr(180)]=405 + me.cw[gopdf.Chr(181)]=405 + me.cw[gopdf.Chr(182)]=391 + me.cw[gopdf.Chr(183)]=438 + me.cw[gopdf.Chr(184)]=358 + me.cw[gopdf.Chr(185)]=433 + me.cw[gopdf.Chr(186)]=445 + me.cw[gopdf.Chr(187)]=445 + me.cw[gopdf.Chr(188)]=414 + me.cw[gopdf.Chr(189)]=414 + me.cw[gopdf.Chr(190)]=482 + me.cw[gopdf.Chr(191)]=482 + me.cw[gopdf.Chr(192)]=425 + me.cw[gopdf.Chr(193)]=417 + me.cw[gopdf.Chr(194)]=386 + me.cw[gopdf.Chr(195)]=329 + me.cw[gopdf.Chr(196)]=391 + me.cw[gopdf.Chr(197)]=399 + me.cw[gopdf.Chr(198)]=425 + me.cw[gopdf.Chr(199)]=379 + me.cw[gopdf.Chr(200)]=403 + me.cw[gopdf.Chr(201)]=461 + me.cw[gopdf.Chr(202)]=399 + me.cw[gopdf.Chr(203)]=438 + me.cw[gopdf.Chr(204)]=468 + me.cw[gopdf.Chr(205)]=394 + me.cw[gopdf.Chr(206)]=385 + me.cw[gopdf.Chr(207)]=380 + me.cw[gopdf.Chr(208)]=340 + me.cw[gopdf.Chr(209)]=0 + me.cw[gopdf.Chr(210)]=336 + me.cw[gopdf.Chr(211)]=336 + me.cw[gopdf.Chr(212)]=0 + me.cw[gopdf.Chr(213)]=0 + me.cw[gopdf.Chr(214)]=0 + me.cw[gopdf.Chr(215)]=0 + me.cw[gopdf.Chr(216)]=0 + me.cw[gopdf.Chr(217)]=0 + me.cw[gopdf.Chr(218)]=0 + me.cw[gopdf.Chr(219)]=698 + me.cw[gopdf.Chr(220)]=698 + me.cw[gopdf.Chr(221)]=698 + me.cw[gopdf.Chr(222)]=698 + me.cw[gopdf.Chr(223)]=389 + me.cw[gopdf.Chr(224)]=208 + me.cw[gopdf.Chr(225)]=395 + me.cw[gopdf.Chr(226)]=252 + me.cw[gopdf.Chr(227)]=269 + me.cw[gopdf.Chr(228)]=252 + me.cw[gopdf.Chr(229)]=209 + me.cw[gopdf.Chr(230)]=437 + me.cw[gopdf.Chr(231)]=0 + me.cw[gopdf.Chr(232)]=0 + me.cw[gopdf.Chr(233)]=0 + me.cw[gopdf.Chr(234)]=0 + me.cw[gopdf.Chr(235)]=0 + me.cw[gopdf.Chr(236)]=0 + me.cw[gopdf.Chr(237)]=0 + me.cw[gopdf.Chr(238)]=0 + me.cw[gopdf.Chr(239)]=450 + me.cw[gopdf.Chr(240)]=456 + me.cw[gopdf.Chr(241)]=456 + me.cw[gopdf.Chr(242)]=456 + me.cw[gopdf.Chr(243)]=456 + me.cw[gopdf.Chr(244)]=456 + me.cw[gopdf.Chr(245)]=456 + me.cw[gopdf.Chr(246)]=456 + me.cw[gopdf.Chr(247)]=456 + me.cw[gopdf.Chr(248)]=456 + me.cw[gopdf.Chr(249)]=456 + me.cw[gopdf.Chr(250)]=525 + me.cw[gopdf.Chr(251)]=697 + me.cw[gopdf.Chr(252)]=698 + me.cw[gopdf.Chr(253)]=698 + me.cw[gopdf.Chr(254)]=698 + me.cw[gopdf.Chr(255)]=698 + me.up = -35 + me.ut = 30 + me.fonttype = "TrueType" + me.name = "THSarabunNew-Bold" + me.enc = "cp874" + me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" + me.desc = make([]gopdf.FontDescItem,8) + me.desc[0] = gopdf.FontDescItem{ Key:"Ascent",Val : "850" } + me.desc[1] = gopdf.FontDescItem{ Key: "Descent", Val : "-250" } + me.desc[2] = gopdf.FontDescItem{ Key:"CapHeight", Val : "476" } + me.desc[3] = gopdf.FontDescItem{ Key: "Flags", Val : "32" } + me.desc[4] = gopdf.FontDescItem{ Key:"FontBBox", Val : "[-466 -457 947 844]" } + me.desc[5] = gopdf.FontDescItem{ Key:"ItalicAngle", Val : "0" } + me.desc[6] = gopdf.FontDescItem{ Key:"StemV", Val : "120" } + me.desc[7] = gopdf.FontDescItem{ Key:"MissingWidth", Val : "698" } + } +func (me * THSarabunNewBold)GetType() string{ + return me.fonttype +} +func (me * THSarabunNewBold)GetName() string{ + return me.name +} +func (me * THSarabunNewBold)GetDesc() []gopdf.FontDescItem{ + return me.desc +} +func (me * THSarabunNewBold)GetUp() int{ + return me.up +} +func (me * THSarabunNewBold)GetUt() int{ + return me.ut +} +func (me * THSarabunNewBold)GetCw() gopdf.FontCw{ + return me.cw +} +func (me * THSarabunNewBold)GetEnc() string{ + return me.enc +} +func (me * THSarabunNewBold)GetDiff() string { + return me.diff +} +func (me * THSarabunNewBold) GetOriginalsize() int{ + return 98764 +} +func (me * THSarabunNewBold) SetFamily(family string){ + me.family = family +} +func (me * THSarabunNewBold) GetFamily() string{ + return me.family +} diff --git a/src/gopdf/gopdf.go b/gopdf.go similarity index 99% rename from src/gopdf/gopdf.go rename to gopdf.go index fb07ea6..43fc1a1 100644 --- a/src/gopdf/gopdf.go +++ b/gopdf.go @@ -16,6 +16,7 @@ type GoPdf struct { pdfObjs []IObj config Config + /*---index ของ obj สำคัญๆ เก็บเพื่อลด loop ตอนค้นหา---*/ //index ของ obj pages indexOfPagesObj int diff --git a/src/gopdf/ifont.go b/ifont.go similarity index 100% rename from src/gopdf/ifont.go rename to ifont.go diff --git a/src/gopdf/image_obj.go b/image_obj.go similarity index 97% rename from src/gopdf/image_obj.go rename to image_obj.go index b2dce7a..855d348 100644 --- a/src/gopdf/image_obj.go +++ b/image_obj.go @@ -13,7 +13,6 @@ import ( type ImageObj struct{ buffer bytes.Buffer imagepath string - //getRoot func()(*GoPdf) } func (me *ImageObj) Init(funcGetRoot func()(*GoPdf)) { @@ -31,7 +30,6 @@ func (me *ImageObj) Build() { m , _ , err := image.Decode(file) if err != nil { - //fmt.Printf("1--%+v\n",err) return } diff --git a/src/gopdf/iobj.go b/iobj.go similarity index 100% rename from src/gopdf/iobj.go rename to iobj.go diff --git a/src/gopdf/page_obj.go b/page_obj.go similarity index 100% rename from src/gopdf/page_obj.go rename to page_obj.go diff --git a/src/gopdf/pages_obj.go b/pages_obj.go similarity index 100% rename from src/gopdf/pages_obj.go rename to pages_obj.go diff --git a/src/gopdf/procset_obj.go b/procset_obj.go similarity index 97% rename from src/gopdf/procset_obj.go rename to procset_obj.go index 46cf970..9fd6572 100644 --- a/src/gopdf/procset_obj.go +++ b/procset_obj.go @@ -75,9 +75,9 @@ func (me * RelateFonts ) IsContainsFamily(family string) bool{ type RelateFont struct{ Family string - //เช่น /F1 + //etc /F1 CountOfFont int - //เช่น 5 0 R + //etc 5 0 R IndexOfObj int } diff --git a/src/gopdf/rect.go b/rect.go similarity index 100% rename from src/gopdf/rect.go rename to rect.go diff --git a/res/fonts/THSarabunNew.z b/res/fonts/THSarabunNew.z old mode 100644 new mode 100755 diff --git a/res/fonts/THSarabunNew Bold.z b/res/fonts/THSarabunNew_Bold.z old mode 100644 new mode 100755 similarity index 100% rename from res/fonts/THSarabunNew Bold.z rename to res/fonts/THSarabunNew_Bold.z diff --git a/run.sh b/run.sh deleted file mode 100644 index 2d84c23..0000000 --- a/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -rm -f ./bin/gopdf -. ./compile.sh -./bin/gopdf - diff --git a/src/encoder/cp874.go b/src/encoder/cp874.go deleted file mode 100644 index 7bb7a5b..0000000 --- a/src/encoder/cp874.go +++ /dev/null @@ -1,100 +0,0 @@ -package encoder - - - -var ENCODEINFO_CP874 = []EnCodeInfo{ - - { Utf8 : 0xe0b880 , Ucode: 0xA0 }, - { Utf8 : 0xe0b881 , Ucode: 0xA1 }, - { Utf8 : 0xe0b882 , Ucode: 0xA2 }, - { Utf8 : 0xe0b883 , Ucode: 0xA3 }, - { Utf8 : 0xe0b884 , Ucode: 0xA4 }, - { Utf8 : 0xe0b885 , Ucode: 0xA5 }, - { Utf8 : 0xe0b886 , Ucode: 0xA6 }, - { Utf8 : 0xe0b887 , Ucode: 0xA7 }, - { Utf8 : 0xe0b888 , Ucode: 0xA8 }, - { Utf8 : 0xe0b889 , Ucode: 0xA9 }, - { Utf8 : 0xe0b88a , Ucode: 0xAA }, - { Utf8 : 0xe0b88b , Ucode: 0xAB }, - { Utf8 : 0xe0b88c , Ucode: 0xAC }, - { Utf8 : 0xe0b88d , Ucode: 0xAD }, - { Utf8 : 0xe0b88e , Ucode: 0xAE }, - { Utf8 : 0xe0b88f , Ucode: 0xAF }, - { Utf8 : 0xe0b890 , Ucode: 0xB0 }, - { Utf8 : 0xe0b891 , Ucode: 0xB1 }, - { Utf8 : 0xe0b892 , Ucode: 0xB2 }, - { Utf8 : 0xe0b893 , Ucode: 0xB3 }, - { Utf8 : 0xe0b894 , Ucode: 0xB4 }, - { Utf8 : 0xe0b895 , Ucode: 0xB5 }, - { Utf8 : 0xe0b896 , Ucode: 0xB6 }, - { Utf8 : 0xe0b897 , Ucode: 0xB7 }, - { Utf8 : 0xe0b898 , Ucode: 0xB8 }, - { Utf8 : 0xe0b899 , Ucode: 0xB9 }, - { Utf8 : 0xe0b89a , Ucode: 0xBA }, - { Utf8 : 0xe0b89b , Ucode: 0xBB }, - { Utf8 : 0xe0b89c , Ucode: 0xBC }, - { Utf8 : 0xe0b89d , Ucode: 0xBD }, - { Utf8 : 0xe0b89e , Ucode: 0xBE }, - { Utf8 : 0xe0b89f , Ucode: 0xBF }, - { Utf8 : 0xe0b8a0 , Ucode: 0xC0 }, - { Utf8 : 0xe0b8a1 , Ucode: 0xC1 }, - { Utf8 : 0xe0b8a2 , Ucode: 0xC2 }, - { Utf8 : 0xe0b8a3 , Ucode: 0xC3 }, - { Utf8 : 0xe0b8a4 , Ucode: 0xC4 }, - { Utf8 : 0xe0b8a5 , Ucode: 0xC5 }, - { Utf8 : 0xe0b8a6 , Ucode: 0xC6 }, - { Utf8 : 0xe0b8a7 , Ucode: 0xC7 }, - { Utf8 : 0xe0b8a8 , Ucode: 0xC8 }, - { Utf8 : 0xe0b8a9 , Ucode: 0xC9 }, - { Utf8 : 0xe0b8aa , Ucode: 0xCA }, - { Utf8 : 0xe0b8ab , Ucode: 0xCB }, - { Utf8 : 0xe0b8ac , Ucode: 0xCC }, - { Utf8 : 0xe0b8ad , Ucode: 0xCD }, - { Utf8 : 0xe0b8ae , Ucode: 0xCE }, - { Utf8 : 0xe0b8af , Ucode: 0xCF }, - { Utf8 : 0xe0b8b0 , Ucode: 0xD0 }, - { Utf8 : 0xe0b8b1 , Ucode: 0xD1 }, - { Utf8 : 0xe0b8b2 , Ucode: 0xD2 }, - { Utf8 : 0xe0b8b3 , Ucode: 0xD3 }, - { Utf8 : 0xe0b8b4 , Ucode: 0xD4 }, - { Utf8 : 0xe0b8b5 , Ucode: 0xD5 }, - { Utf8 : 0xe0b8b6 , Ucode: 0xD6 }, - { Utf8 : 0xe0b8b7 , Ucode: 0xD7 }, - { Utf8 : 0xe0b8b8 , Ucode: 0xD8 }, - { Utf8 : 0xe0b8b9 , Ucode: 0xD9 }, - { Utf8 : 0xe0b8ba , Ucode: 0xDA }, - { Utf8 : 0xe0b8bb , Ucode: 0xDB }, - { Utf8 : 0xe0b8bc , Ucode: 0xDC }, - { Utf8 : 0xe0b8bd , Ucode: 0xDD }, - { Utf8 : 0xe0b8be , Ucode: 0xDE }, - { Utf8 : 0xe0b8bf , Ucode: 0xDF }, - { Utf8 : 0xe0b980 , Ucode: 0xE0 }, - { Utf8 : 0xe0b981 , Ucode: 0xE1 }, - { Utf8 : 0xe0b982 , Ucode: 0xE2 }, - { Utf8 : 0xe0b983 , Ucode: 0xE3 }, - { Utf8 : 0xe0b984 , Ucode: 0xE4 }, - { Utf8 : 0xe0b985 , Ucode: 0xE5 }, - { Utf8 : 0xe0b986 , Ucode: 0xE6 }, - { Utf8 : 0xe0b987 , Ucode: 0xE7 }, - { Utf8 : 0xe0b988 , Ucode: 0xE8 }, - { Utf8 : 0xe0b989 , Ucode: 0xE9 }, - { Utf8 : 0xe0b98a , Ucode: 0xEA }, - { Utf8 : 0xe0b98b , Ucode: 0xEB }, - { Utf8 : 0xe0b98c , Ucode: 0xEC }, - { Utf8 : 0xe0b98d , Ucode: 0xED }, - { Utf8 : 0xe0b98e , Ucode: 0xEE }, - { Utf8 : 0xe0b98f , Ucode: 0xEF }, - { Utf8 : 0xe0b990 , Ucode: 0xF0 }, - { Utf8 : 0xe0b991 , Ucode: 0xF1 }, - { Utf8 : 0xe0b992 , Ucode: 0xF2 }, - { Utf8 : 0xe0b993 , Ucode: 0xF3 }, - { Utf8 : 0xe0b994 , Ucode: 0xF4 }, - { Utf8 : 0xe0b995 , Ucode: 0xF5 }, - { Utf8 : 0xe0b996 , Ucode: 0xF6 }, - { Utf8 : 0xe0b997 , Ucode: 0xF7 }, - { Utf8 : 0xe0b998 , Ucode: 0xF8 }, - { Utf8 : 0xe0b999 , Ucode: 0xF9 }, - { Utf8 : 0xe0b99a , Ucode: 0xFA }, - { Utf8 : 0xe0b99b , Ucode: 0xFB }, - - }; diff --git a/src/encoder/encode.go b/src/encoder/encode.go deleted file mode 100644 index 7fef73c..0000000 --- a/src/encoder/encode.go +++ /dev/null @@ -1,51 +0,0 @@ -package encoder - -import ( - "strings" -) - - -type EnCodeInfo struct{ - Utf8 int64 - Ucode int64 -} - - -func TranslateFromUtf8(enCodeInfos *[]EnCodeInfo,str string) string{ - - chars := strings.Split(str,"") - outputBuffer := make([]byte, len([]byte(str))*2) - i := 0 - j := 0 - num := int64(0) - multiply := int64(0) - max := len(chars) - clen := 0 - for i < max { - b := []byte(chars[i]) - j = len(b) - num = 0 - multiply = 0x1 - for j > 0 { - num = num + ( int64(b[j - 1 ]) * multiply ) - multiply = multiply * 0x100 - j-- - } - if num >= 0xe0b880 && num <= 0xe0b99b { - j = 0 - clen = len(*enCodeInfos) - for j < clen { - if( (*enCodeInfos)[j].Utf8 == num ){ - num = (*enCodeInfos)[j].Ucode - break - } - j++ - } - } - if num <= 255 { - outputBuffer[i] = byte(num) - } - i++ - } - return string(outputBuffer[0:i] ) -} \ No newline at end of file diff --git a/src/gopdf/config.go b/src/gopdf/config.go deleted file mode 100644 index ce19ded..0000000 --- a/src/gopdf/config.go +++ /dev/null @@ -1,31 +0,0 @@ -package gopdf - -import ( - -) - - -type Config struct{ - //pt , mm , cm , in - Unit string - PageSize Rect - K float64 -} - - -/* -func (me * Config) calK() float64 { - k := 1.0 //pt - if(me.Unit == "pt" ){ - k = 1.0 - }else if( me.Unit == "cm" ){ - k = 72.0/2.54; - }else if( me.Unit =="in" ){ - k = 72.0/2.54 - }else if( me.Unit =="mm" ){ - k = 72.0/25.4 - } - return k -} -*/ - diff --git a/src/gopdf/font_THSarabunBold.go b/src/gopdf/font_THSarabunBold.go deleted file mode 100644 index 7eb9289..0000000 --- a/src/gopdf/font_THSarabunBold.go +++ /dev/null @@ -1,324 +0,0 @@ -package gopdf - -import ( - -) - -type THSarabunBold struct { - family string - fonttype string - name string - desc []FontDescItem - up int - ut int - cw FontCw - enc string - diff string -} -func (me * THSarabunBold) Init(){ - me.cw = make(FontCw) - me.cw[Chr(0)]=698 - me.cw[Chr(1)]=698 - me.cw[Chr(2)]=698 - me.cw[Chr(3)]=698 - me.cw[Chr(4)]=698 - me.cw[Chr(5)]=698 - me.cw[Chr(6)]=698 - me.cw[Chr(7)]=698 - me.cw[Chr(8)]=698 - me.cw[Chr(9)]=698 - me.cw[Chr(10)]=698 - me.cw[Chr(11)]=698 - me.cw[Chr(12)]=698 - me.cw[Chr(13)]=698 - me.cw[Chr(14)]=698 - me.cw[Chr(15)]=698 - me.cw[Chr(16)]=698 - me.cw[Chr(17)]=698 - me.cw[Chr(18)]=698 - me.cw[Chr(19)]=698 - me.cw[Chr(20)]=698 - me.cw[Chr(21)]=698 - me.cw[Chr(22)]=698 - me.cw[Chr(23)]=698 - me.cw[Chr(24)]=698 - me.cw[Chr(25)]=698 - me.cw[Chr(26)]=698 - me.cw[Chr(27)]=698 - me.cw[Chr(28)]=698 - me.cw[Chr(29)]=698 - me.cw[Chr(30)]=698 - me.cw[Chr(31)]=698 - me.cw[ToByte(" ")]=226 - me.cw[ToByte("!")]=168 - me.cw[ToByte("\"")]=291 - me.cw[ToByte("#")]=462 - me.cw[ToByte("$")]=367 - me.cw[ToByte("%")]=688 - me.cw[ToByte("&")]=486 - me.cw[ToByte("'")]=169 - me.cw[ToByte("(")]=244 - me.cw[ToByte(")")]=244 - me.cw[ToByte("*")]=343 - me.cw[ToByte("+")]=417 - me.cw[ToByte(",")]=172 - me.cw[ToByte("-")]=226 - me.cw[ToByte(".")]=172 - me.cw[ToByte("/")]=276 - me.cw[ToByte("0")]=378 - me.cw[ToByte("1")]=378 - me.cw[ToByte("2")]=378 - me.cw[ToByte("3")]=378 - me.cw[ToByte("4")]=378 - me.cw[ToByte("5")]=378 - me.cw[ToByte("6")]=378 - me.cw[ToByte("7")]=378 - me.cw[ToByte("8")]=378 - me.cw[ToByte("9")]=378 - me.cw[ToByte(":")]=172 - me.cw[ToByte(";")]=172 - me.cw[ToByte("<")]=417 - me.cw[ToByte("=")]=417 - me.cw[ToByte(">")]=417 - me.cw[ToByte("?")]=289 - me.cw[ToByte("@")]=572 - me.cw[ToByte("A")]=451 - me.cw[ToByte("B")]=396 - me.cw[ToByte("C")]=432 - me.cw[ToByte("D")]=459 - me.cw[ToByte("E")]=358 - me.cw[ToByte("F")]=358 - me.cw[ToByte("G")]=454 - me.cw[ToByte("H")]=472 - me.cw[ToByte("I")]=163 - me.cw[ToByte("J")]=282 - me.cw[ToByte("K")]=411 - me.cw[ToByte("L")]=359 - me.cw[ToByte("M")]=574 - me.cw[ToByte("N")]=472 - me.cw[ToByte("O")]=518 - me.cw[ToByte("P")]=390 - me.cw[ToByte("Q")]=518 - me.cw[ToByte("R")]=395 - me.cw[ToByte("S")]=365 - me.cw[ToByte("T")]=421 - me.cw[ToByte("U")]=482 - me.cw[ToByte("V")]=422 - me.cw[ToByte("W")]=612 - me.cw[ToByte("X")]=426 - me.cw[ToByte("Y")]=396 - me.cw[ToByte("Z")]=451 - me.cw[ToByte("[")]=234 - me.cw[ToByte("\\")]=268 - me.cw[ToByte("]")]=234 - me.cw[ToByte("^")]=418 - me.cw[ToByte("_")]=376 - me.cw[ToByte("`")]=210 - me.cw[ToByte("a")]=367 - me.cw[ToByte("b")]=435 - me.cw[ToByte("c")]=347 - me.cw[ToByte("d")]=435 - me.cw[ToByte("e")]=391 - me.cw[ToByte("f")]=254 - me.cw[ToByte("g")]=332 - me.cw[ToByte("h")]=423 - me.cw[ToByte("i")]=163 - me.cw[ToByte("j")]=171 - me.cw[ToByte("k")]=340 - me.cw[ToByte("l")]=213 - me.cw[ToByte("m")]=636 - me.cw[ToByte("n")]=423 - me.cw[ToByte("o")]=412 - me.cw[ToByte("p")]=431 - me.cw[ToByte("q")]=431 - me.cw[ToByte("r")]=246 - me.cw[ToByte("s")]=296 - me.cw[ToByte("t")]=258 - me.cw[ToByte("u")]=418 - me.cw[ToByte("v")]=358 - me.cw[ToByte("w")]=480 - me.cw[ToByte("x")]=349 - me.cw[ToByte("y")]=361 - me.cw[ToByte("z")]=358 - me.cw[ToByte("{")]=255 - me.cw[ToByte("|")]=177 - me.cw[ToByte("}")]=255 - me.cw[ToByte("~")]=422 - me.cw[Chr(127)]=698 - me.cw[Chr(128)]=518 - me.cw[Chr(129)]=698 - me.cw[Chr(130)]=698 - me.cw[Chr(131)]=698 - me.cw[Chr(132)]=698 - me.cw[Chr(133)]=504 - me.cw[Chr(134)]=698 - me.cw[Chr(135)]=698 - me.cw[Chr(136)]=698 - me.cw[Chr(137)]=698 - me.cw[Chr(138)]=698 - me.cw[Chr(139)]=698 - me.cw[Chr(140)]=698 - me.cw[Chr(141)]=698 - me.cw[Chr(142)]=698 - me.cw[Chr(143)]=698 - me.cw[Chr(144)]=698 - me.cw[Chr(145)]=253 - me.cw[Chr(146)]=253 - me.cw[Chr(147)]=384 - me.cw[Chr(148)]=384 - me.cw[Chr(149)]=226 - me.cw[Chr(150)]=335 - me.cw[Chr(151)]=693 - me.cw[Chr(152)]=698 - me.cw[Chr(153)]=698 - me.cw[Chr(154)]=698 - me.cw[Chr(155)]=698 - me.cw[Chr(156)]=698 - me.cw[Chr(157)]=698 - me.cw[Chr(158)]=698 - me.cw[Chr(159)]=698 - me.cw[Chr(160)]=220 - me.cw[Chr(161)]=391 - me.cw[Chr(162)]=415 - me.cw[Chr(163)]=431 - me.cw[Chr(164)]=403 - me.cw[Chr(165)]=403 - me.cw[Chr(166)]=453 - me.cw[Chr(167)]=318 - me.cw[Chr(168)]=390 - me.cw[Chr(169)]=405 - me.cw[Chr(170)]=415 - me.cw[Chr(171)]=431 - me.cw[Chr(172)]=565 - me.cw[Chr(173)]=565 - me.cw[Chr(174)]=425 - me.cw[Chr(175)]=425 - me.cw[Chr(176)]=372 - me.cw[Chr(177)]=492 - me.cw[Chr(178)]=551 - me.cw[Chr(179)]=576 - me.cw[Chr(180)]=405 - me.cw[Chr(181)]=405 - me.cw[Chr(182)]=391 - me.cw[Chr(183)]=438 - me.cw[Chr(184)]=358 - me.cw[Chr(185)]=433 - me.cw[Chr(186)]=445 - me.cw[Chr(187)]=445 - me.cw[Chr(188)]=414 - me.cw[Chr(189)]=414 - me.cw[Chr(190)]=482 - me.cw[Chr(191)]=482 - me.cw[Chr(192)]=425 - me.cw[Chr(193)]=417 - me.cw[Chr(194)]=386 - me.cw[Chr(195)]=329 - me.cw[Chr(196)]=391 - me.cw[Chr(197)]=399 - me.cw[Chr(198)]=425 - me.cw[Chr(199)]=379 - me.cw[Chr(200)]=403 - me.cw[Chr(201)]=461 - me.cw[Chr(202)]=399 - me.cw[Chr(203)]=438 - me.cw[Chr(204)]=468 - me.cw[Chr(205)]=394 - me.cw[Chr(206)]=385 - me.cw[Chr(207)]=380 - me.cw[Chr(208)]=340 - me.cw[Chr(209)]=0 - me.cw[Chr(210)]=336 - me.cw[Chr(211)]=336 - me.cw[Chr(212)]=0 - me.cw[Chr(213)]=0 - me.cw[Chr(214)]=0 - me.cw[Chr(215)]=0 - me.cw[Chr(216)]=0 - me.cw[Chr(217)]=0 - me.cw[Chr(218)]=0 - me.cw[Chr(219)]=698 - me.cw[Chr(220)]=698 - me.cw[Chr(221)]=698 - me.cw[Chr(222)]=698 - me.cw[Chr(223)]=389 - me.cw[Chr(224)]=208 - me.cw[Chr(225)]=395 - me.cw[Chr(226)]=252 - me.cw[Chr(227)]=269 - me.cw[Chr(228)]=252 - me.cw[Chr(229)]=209 - me.cw[Chr(230)]=437 - me.cw[Chr(231)]=0 - me.cw[Chr(232)]=0 - me.cw[Chr(233)]=0 - me.cw[Chr(234)]=0 - me.cw[Chr(235)]=0 - me.cw[Chr(236)]=0 - me.cw[Chr(237)]=0 - me.cw[Chr(238)]=0 - me.cw[Chr(239)]=450 - me.cw[Chr(240)]=456 - me.cw[Chr(241)]=456 - me.cw[Chr(242)]=456 - me.cw[Chr(243)]=456 - me.cw[Chr(244)]=456 - me.cw[Chr(245)]=456 - me.cw[Chr(246)]=456 - me.cw[Chr(247)]=456 - me.cw[Chr(248)]=456 - me.cw[Chr(249)]=456 - me.cw[Chr(250)]=525 - me.cw[Chr(251)]=697 - me.cw[Chr(252)]=698 - me.cw[Chr(253)]=698 - me.cw[Chr(254)]=698 - me.cw[Chr(255)]=698 - me.up = -35 - me.ut = 30 - me.fonttype = "TrueType" - me.name = "THSarabunPSK-Bold" - me.enc = "cp874" - me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" - me.desc = make([]FontDescItem,8) - me.desc[0] = FontDescItem{ Key:"Ascent",Val : "850" } - me.desc[1] = FontDescItem{ Key: "Descent", Val : "-250" } - me.desc[2] = FontDescItem{ Key:"CapHeight", Val : "476" } - me.desc[3] = FontDescItem{ Key: "Flags", Val : "32" } - me.desc[4] = FontDescItem{ Key:"FontBBox", Val : "[-466 -457 947 844]" } - me.desc[5] = FontDescItem{ Key:"ItalicAngle", Val : "0" } - me.desc[6] = FontDescItem{ Key:"StemV", Val : "120" } - me.desc[7] = FontDescItem{ Key:"MissingWidth", Val : "698" } - } -func (me * THSarabunBold)GetType() string{ - return me.fonttype -} -func (me * THSarabunBold)GetName() string{ - return me.name -} -func (me * THSarabunBold)GetDesc() []FontDescItem{ - return me.desc -} -func (me * THSarabunBold)GetUp() int{ - return me.up -} -func (me * THSarabunBold)GetUt() int{ - return me.ut -} -func (me * THSarabunBold)GetCw() FontCw{ - return me.cw -} -func (me * THSarabunBold)GetEnc() string{ - return me.enc -} -func (me * THSarabunBold)GetDiff() string { - return me.diff -} -func (me * THSarabunBold) GetOriginalsize() int{ - return 98764 -} -func (me * THSarabunBold) SetFamily(family string){ - me.family = family -} -func (me * THSarabunBold) GetFamily() string{ - return me.family -} diff --git a/src/gopdf/font_thsarabun.go b/src/gopdf/font_thsarabun.go deleted file mode 100644 index cb1c04a..0000000 --- a/src/gopdf/font_thsarabun.go +++ /dev/null @@ -1,332 +0,0 @@ -package gopdf - -import ( - -) - -type THSarabun struct{ - family string - fonttype string - name string - desc []FontDescItem - up int - ut int - cw FontCw - enc string - diff string -} - -func (me * THSarabun)Init(){ - - me.cw = make(FontCw) - //me.cw = cw - me.cw[Chr(0)]=692; - me.cw[Chr(1)]=692; - me.cw[Chr(2)]=692; - me.cw[Chr(3)]=692; - me.cw[Chr(4)]=692; - me.cw[Chr(5)]=692; - me.cw[Chr(6)]=692; - me.cw[Chr(7)]=692; - me.cw[Chr(8)]=692; - me.cw[Chr(9)]=692; - me.cw[Chr(10)]=692; - me.cw[Chr(11)]=692; - me.cw[Chr(12)]=692; - me.cw[Chr(13)]=692; - me.cw[Chr(14)]=692; - me.cw[Chr(15)]=692; - me.cw[Chr(16)]=692; - me.cw[Chr(17)]=692; - me.cw[Chr(18)]=692; - me.cw[Chr(19)]=692; - me.cw[Chr(20)]=692; - me.cw[Chr(21)]=692; - me.cw[Chr(22)]=692; - me.cw[Chr(23)]=692; - me.cw[Chr(24)]=692; - me.cw[Chr(25)]=692; - me.cw[Chr(26)]=692; - me.cw[Chr(27)]=692; - me.cw[Chr(28)]=692; - me.cw[Chr(29)]=692; - me.cw[Chr(30)]=692; - me.cw[Chr(31)]=692; - me.cw[ToByte(" ")]=216; - me.cw[ToByte("!")]=147; - me.cw[ToByte("\"")]=208; - me.cw[ToByte("#")]=403; - me.cw[ToByte("$")]=361; - me.cw[ToByte("%")]=585; - me.cw[ToByte("&")]=423; - me.cw[ToByte("'")]=120; - me.cw[ToByte("(")]=190; - me.cw[ToByte(")")]=190; - me.cw[ToByte("*")]=285; - me.cw[ToByte("+")]=411; - me.cw[ToByte(",")]=162; - me.cw[ToByte("-")]=216; - me.cw[ToByte(".")]=162; - me.cw[ToByte("/")]=270; - me.cw[ToByte("0")]=362; - me.cw[ToByte("1")]=362; - me.cw[ToByte("2")]=362; - me.cw[ToByte("3")]=362; - me.cw[ToByte("4")]=362; - me.cw[ToByte("5")]=362; - me.cw[ToByte("6")]=362; - me.cw[ToByte("7")]=362; - me.cw[ToByte("8")]=362; - me.cw[ToByte("9")]=362; - me.cw[ToByte(":")]=162; - me.cw[ToByte(";")]=162; - me.cw[ToByte("<")]=411; - me.cw[ToByte("=")]=411; - me.cw[ToByte(">")]=411; - me.cw[ToByte("?")]=283; - me.cw[ToByte("@")]=536; - me.cw[ToByte("A")]=400; - me.cw[ToByte("B")]=378; - me.cw[ToByte("C")]=406; - me.cw[ToByte("D")]=431; - me.cw[ToByte("E")]=351; - me.cw[ToByte("F")]=351; - me.cw[ToByte("G")]=425; - me.cw[ToByte("H")]=441; - me.cw[ToByte("I")]=147; - me.cw[ToByte("J")]=264; - me.cw[ToByte("K")]=376; - me.cw[ToByte("L")]=353; - me.cw[ToByte("M")]=548; - me.cw[ToByte("N")]=441; - me.cw[ToByte("O")]=486; - me.cw[ToByte("P")]=378; - me.cw[ToByte("Q")]=487; - me.cw[ToByte("R")]=379; - me.cw[ToByte("S")]=352; - me.cw[ToByte("T")]=379; - me.cw[ToByte("U")]=466; - me.cw[ToByte("V")]=390; - me.cw[ToByte("W")]=588; - me.cw[ToByte("X")]=418; - me.cw[ToByte("Y")]=366; - me.cw[ToByte("Z")]=424; - me.cw[ToByte("[")]=196; - me.cw[ToByte("\\")]=262; - me.cw[ToByte("]")]=196; - me.cw[ToByte("^")]=412; - me.cw[ToByte("_")]=352; - me.cw[ToByte("`")]=204; - me.cw[ToByte("a")]=344; - me.cw[ToByte("b")]=401; - me.cw[ToByte("c")]=331; - me.cw[ToByte("d")]=401; - me.cw[ToByte("e")]=374; - me.cw[ToByte("f")]=206; - me.cw[ToByte("g")]=311; - me.cw[ToByte("h")]=390; - me.cw[ToByte("i")]=143; - me.cw[ToByte("j")]=155; - me.cw[ToByte("k")]=316; - me.cw[ToByte("l")]=200; - me.cw[ToByte("m")]=601; - me.cw[ToByte("n")]=390; - me.cw[ToByte("o")]=398; - me.cw[ToByte("p")]=401; - me.cw[ToByte("q")]=401; - me.cw[ToByte("r")]=217; - me.cw[ToByte("s")]=282; - me.cw[ToByte("t")]=238; - me.cw[ToByte("u")]=390; - me.cw[ToByte("v")]=341; - me.cw[ToByte("w")]=507; - me.cw[ToByte("x")]=318; - me.cw[ToByte("y")]=337; - me.cw[ToByte("z")]=321; - me.cw[ToByte("{")]=208; - me.cw[ToByte("|")]=153; - me.cw[ToByte("}")]=208; - me.cw[ToByte("~")]=416; - me.cw[Chr(127)]=692; - me.cw[Chr(128)]=406; - me.cw[Chr(129)]=692; - me.cw[Chr(130)]=692; - me.cw[Chr(131)]=692; - me.cw[Chr(132)]=692; - me.cw[Chr(133)]=479; - me.cw[Chr(134)]=692; - me.cw[Chr(135)]=692; - me.cw[Chr(136)]=692; - me.cw[Chr(137)]=692; - me.cw[Chr(138)]=692; - me.cw[Chr(139)]=692; - me.cw[Chr(140)]=692; - me.cw[Chr(141)]=692; - me.cw[Chr(142)]=692; - me.cw[Chr(143)]=692; - me.cw[Chr(144)]=692; - me.cw[Chr(145)]=247; - me.cw[Chr(146)]=247; - me.cw[Chr(147)]=370; - me.cw[Chr(148)]=370; - me.cw[Chr(149)]=216; - me.cw[Chr(150)]=360; - me.cw[Chr(151)]=720; - me.cw[Chr(152)]=692; - me.cw[Chr(153)]=692; - me.cw[Chr(154)]=692; - me.cw[Chr(155)]=692; - me.cw[Chr(156)]=692; - me.cw[Chr(157)]=692; - me.cw[Chr(158)]=692; - me.cw[Chr(159)]=692; - me.cw[Chr(160)]=216; - me.cw[Chr(161)]=386; - me.cw[Chr(162)]=378; - me.cw[Chr(163)]=382; - me.cw[Chr(164)]=393; - me.cw[Chr(165)]=393; - me.cw[Chr(166)]=408; - me.cw[Chr(167)]=294; - me.cw[Chr(168)]=367; - me.cw[Chr(169)]=377; - me.cw[Chr(170)]=380; - me.cw[Chr(171)]=384; - me.cw[Chr(172)]=519; - me.cw[Chr(173)]=519; - me.cw[Chr(174)]=425; - me.cw[Chr(175)]=425; - me.cw[Chr(176)]=343; - me.cw[Chr(177)]=461; - me.cw[Chr(178)]=532; - me.cw[Chr(179)]=543; - me.cw[Chr(180)]=391; - me.cw[Chr(181)]=391; - me.cw[Chr(182)]=378; - me.cw[Chr(183)]=430; - me.cw[Chr(184)]=335; - me.cw[Chr(185)]=420; - me.cw[Chr(186)]=428; - me.cw[Chr(187)]=428; - me.cw[Chr(188)]=381; - me.cw[Chr(189)]=381; - me.cw[Chr(190)]=447; - me.cw[Chr(191)]=447; - me.cw[Chr(192)]=425; - me.cw[Chr(193)]=400; - me.cw[Chr(194)]=375; - me.cw[Chr(195)]=322; - me.cw[Chr(196)]=378; - me.cw[Chr(197)]=381; - me.cw[Chr(198)]=425; - me.cw[Chr(199)]=335; - me.cw[Chr(200)]=393; - me.cw[Chr(201)]=438; - me.cw[Chr(202)]=381; - me.cw[Chr(203)]=427; - me.cw[Chr(204)]=454; - me.cw[Chr(205)]=387; - me.cw[Chr(206)]=372; - me.cw[Chr(207)]=391; - me.cw[Chr(208)]=357; - me.cw[Chr(209)]=0; - me.cw[Chr(210)]=316; - me.cw[Chr(211)]=316; - me.cw[Chr(212)]=0; - me.cw[Chr(213)]=0; - me.cw[Chr(214)]=0; - me.cw[Chr(215)]=0; - me.cw[Chr(216)]=0; - me.cw[Chr(217)]=0; - me.cw[Chr(218)]=0; - me.cw[Chr(219)]=692; - me.cw[Chr(220)]=692; - me.cw[Chr(221)]=692; - me.cw[Chr(222)]=692; - me.cw[Chr(223)]=411; - me.cw[Chr(224)]=203; - me.cw[Chr(225)]=377; - me.cw[Chr(226)]=237; - me.cw[Chr(227)]=242; - me.cw[Chr(228)]=244; - me.cw[Chr(229)]=205; - me.cw[Chr(230)]=399; - me.cw[Chr(231)]=0; - me.cw[Chr(232)]=0; - me.cw[Chr(233)]=0; - me.cw[Chr(234)]=0; - me.cw[Chr(235)]=0; - me.cw[Chr(236)]=0; - me.cw[Chr(237)]=0; - me.cw[Chr(238)]=0; - me.cw[Chr(239)]=450; - me.cw[Chr(240)]=449; - me.cw[Chr(241)]=449; - me.cw[Chr(242)]=449; - me.cw[Chr(243)]=449; - me.cw[Chr(244)]=449; - me.cw[Chr(245)]=449; - me.cw[Chr(246)]=449; - me.cw[Chr(247)]=449; - me.cw[Chr(248)]=449; - me.cw[Chr(249)]=449; - me.cw[Chr(250)]=522; - me.cw[Chr(251)]=697; - me.cw[Chr(252)]=692; - me.cw[Chr(253)]=692; - me.cw[Chr(254)]=692; - me.cw[Chr(255)]=692; - - me.up = -35; - me.ut = 30; - me.fonttype = "TrueType" - me.name = "THSarabunPSK" - me.enc = "cp874" - me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" - - me.desc = make([]FontDescItem,8) - me.desc[0] = FontDescItem{ Key:"Ascent",Val : "850" } - me.desc[1] = FontDescItem{ Key: "Descent", Val : "-250" } - me.desc[2] = FontDescItem{ Key:"CapHeight", Val : "476"} - me.desc[3] = FontDescItem{ Key: "Flags", Val : "32"} - me.desc[4] = FontDescItem{ Key:"FontBBox", Val : "[-427 -421 947 836]"} - me.desc[5] = FontDescItem{ Key:"ItalicAngle", Val : "0"} - me.desc[6] = FontDescItem{ Key:"StemV", Val : "70"} - me.desc[7] = FontDescItem{ Key:"MissingWidth", Val : "692"} -} -func (me * THSarabun)GetType() string{ - return me.fonttype -} -func (me * THSarabun)GetName() string{ - return me.name -} -func (me * THSarabun)GetDesc() []FontDescItem{ - return me.desc -} -func (me * THSarabun)GetUp() int{ - return me.up -} -func (me * THSarabun)GetUt() int{ - return me.ut -} -func (me * THSarabun)GetCw() FontCw{ - return me.cw -} -func (me * THSarabun)GetEnc() string{ - return me.enc -} -func (me * THSarabun)GetDiff() string { - return me.diff -} - -func (me * THSarabun) GetOriginalsize() int{ - return 98764 -} - -func (me * THSarabun) SetFamily(family string){ - me.family = family -} - -func (me * THSarabun) GetFamily() string{ - return me.family -} diff --git a/src/gopdf/font_thsarabunnew.go b/src/gopdf/font_thsarabunnew.go deleted file mode 100644 index 8891c99..0000000 --- a/src/gopdf/font_thsarabunnew.go +++ /dev/null @@ -1,324 +0,0 @@ -package gopdf - -import ( - -) - -type THSarabunNew struct { - family string - fonttype string - name string - desc []FontDescItem - up int - ut int - cw FontCw - enc string - diff string -} -func (me * THSarabunNew) Init(){ - me.cw = make(FontCw) - me.cw[Chr(0)]=692 - me.cw[Chr(1)]=692 - me.cw[Chr(2)]=692 - me.cw[Chr(3)]=692 - me.cw[Chr(4)]=692 - me.cw[Chr(5)]=692 - me.cw[Chr(6)]=692 - me.cw[Chr(7)]=692 - me.cw[Chr(8)]=692 - me.cw[Chr(9)]=692 - me.cw[Chr(10)]=692 - me.cw[Chr(11)]=692 - me.cw[Chr(12)]=692 - me.cw[Chr(13)]=692 - me.cw[Chr(14)]=692 - me.cw[Chr(15)]=692 - me.cw[Chr(16)]=692 - me.cw[Chr(17)]=692 - me.cw[Chr(18)]=692 - me.cw[Chr(19)]=692 - me.cw[Chr(20)]=692 - me.cw[Chr(21)]=692 - me.cw[Chr(22)]=692 - me.cw[Chr(23)]=692 - me.cw[Chr(24)]=692 - me.cw[Chr(25)]=692 - me.cw[Chr(26)]=692 - me.cw[Chr(27)]=692 - me.cw[Chr(28)]=692 - me.cw[Chr(29)]=692 - me.cw[Chr(30)]=692 - me.cw[Chr(31)]=692 - me.cw[ToByte(" ")]=216 - me.cw[ToByte("!")]=147 - me.cw[ToByte("\"")]=208 - me.cw[ToByte("#")]=403 - me.cw[ToByte("$")]=361 - me.cw[ToByte("%")]=585 - me.cw[ToByte("&")]=423 - me.cw[ToByte("'")]=120 - me.cw[ToByte("(")]=190 - me.cw[ToByte(")")]=190 - me.cw[ToByte("*")]=285 - me.cw[ToByte("+")]=411 - me.cw[ToByte(",")]=162 - me.cw[ToByte("-")]=216 - me.cw[ToByte(".")]=162 - me.cw[ToByte("/")]=270 - me.cw[ToByte("0")]=362 - me.cw[ToByte("1")]=362 - me.cw[ToByte("2")]=362 - me.cw[ToByte("3")]=362 - me.cw[ToByte("4")]=362 - me.cw[ToByte("5")]=362 - me.cw[ToByte("6")]=362 - me.cw[ToByte("7")]=362 - me.cw[ToByte("8")]=362 - me.cw[ToByte("9")]=362 - me.cw[ToByte(":")]=162 - me.cw[ToByte(";")]=162 - me.cw[ToByte("<")]=411 - me.cw[ToByte("=")]=411 - me.cw[ToByte(">")]=411 - me.cw[ToByte("?")]=283 - me.cw[ToByte("@")]=536 - me.cw[ToByte("A")]=400 - me.cw[ToByte("B")]=378 - me.cw[ToByte("C")]=406 - me.cw[ToByte("D")]=431 - me.cw[ToByte("E")]=351 - me.cw[ToByte("F")]=351 - me.cw[ToByte("G")]=425 - me.cw[ToByte("H")]=441 - me.cw[ToByte("I")]=147 - me.cw[ToByte("J")]=264 - me.cw[ToByte("K")]=376 - me.cw[ToByte("L")]=353 - me.cw[ToByte("M")]=548 - me.cw[ToByte("N")]=441 - me.cw[ToByte("O")]=486 - me.cw[ToByte("P")]=378 - me.cw[ToByte("Q")]=487 - me.cw[ToByte("R")]=379 - me.cw[ToByte("S")]=352 - me.cw[ToByte("T")]=379 - me.cw[ToByte("U")]=466 - me.cw[ToByte("V")]=390 - me.cw[ToByte("W")]=588 - me.cw[ToByte("X")]=418 - me.cw[ToByte("Y")]=366 - me.cw[ToByte("Z")]=424 - me.cw[ToByte("[")]=196 - me.cw[ToByte("\\")]=262 - me.cw[ToByte("]")]=196 - me.cw[ToByte("^")]=412 - me.cw[ToByte("_")]=352 - me.cw[ToByte("`")]=204 - me.cw[ToByte("a")]=344 - me.cw[ToByte("b")]=401 - me.cw[ToByte("c")]=331 - me.cw[ToByte("d")]=401 - me.cw[ToByte("e")]=374 - me.cw[ToByte("f")]=206 - me.cw[ToByte("g")]=311 - me.cw[ToByte("h")]=390 - me.cw[ToByte("i")]=143 - me.cw[ToByte("j")]=155 - me.cw[ToByte("k")]=316 - me.cw[ToByte("l")]=200 - me.cw[ToByte("m")]=601 - me.cw[ToByte("n")]=390 - me.cw[ToByte("o")]=398 - me.cw[ToByte("p")]=401 - me.cw[ToByte("q")]=401 - me.cw[ToByte("r")]=217 - me.cw[ToByte("s")]=282 - me.cw[ToByte("t")]=238 - me.cw[ToByte("u")]=390 - me.cw[ToByte("v")]=341 - me.cw[ToByte("w")]=507 - me.cw[ToByte("x")]=318 - me.cw[ToByte("y")]=337 - me.cw[ToByte("z")]=321 - me.cw[ToByte("{")]=208 - me.cw[ToByte("|")]=153 - me.cw[ToByte("}")]=208 - me.cw[ToByte("~")]=416 - me.cw[Chr(127)]=692 - me.cw[Chr(128)]=406 - me.cw[Chr(129)]=692 - me.cw[Chr(130)]=692 - me.cw[Chr(131)]=692 - me.cw[Chr(132)]=692 - me.cw[Chr(133)]=479 - me.cw[Chr(134)]=692 - me.cw[Chr(135)]=692 - me.cw[Chr(136)]=692 - me.cw[Chr(137)]=692 - me.cw[Chr(138)]=692 - me.cw[Chr(139)]=692 - me.cw[Chr(140)]=692 - me.cw[Chr(141)]=692 - me.cw[Chr(142)]=692 - me.cw[Chr(143)]=692 - me.cw[Chr(144)]=692 - me.cw[Chr(145)]=247 - me.cw[Chr(146)]=247 - me.cw[Chr(147)]=370 - me.cw[Chr(148)]=370 - me.cw[Chr(149)]=216 - me.cw[Chr(150)]=360 - me.cw[Chr(151)]=720 - me.cw[Chr(152)]=692 - me.cw[Chr(153)]=692 - me.cw[Chr(154)]=692 - me.cw[Chr(155)]=692 - me.cw[Chr(156)]=692 - me.cw[Chr(157)]=692 - me.cw[Chr(158)]=692 - me.cw[Chr(159)]=692 - me.cw[Chr(160)]=216 - me.cw[Chr(161)]=386 - me.cw[Chr(162)]=378 - me.cw[Chr(163)]=382 - me.cw[Chr(164)]=393 - me.cw[Chr(165)]=393 - me.cw[Chr(166)]=408 - me.cw[Chr(167)]=294 - me.cw[Chr(168)]=367 - me.cw[Chr(169)]=377 - me.cw[Chr(170)]=380 - me.cw[Chr(171)]=384 - me.cw[Chr(172)]=519 - me.cw[Chr(173)]=519 - me.cw[Chr(174)]=425 - me.cw[Chr(175)]=425 - me.cw[Chr(176)]=343 - me.cw[Chr(177)]=461 - me.cw[Chr(178)]=532 - me.cw[Chr(179)]=543 - me.cw[Chr(180)]=391 - me.cw[Chr(181)]=391 - me.cw[Chr(182)]=378 - me.cw[Chr(183)]=430 - me.cw[Chr(184)]=335 - me.cw[Chr(185)]=420 - me.cw[Chr(186)]=428 - me.cw[Chr(187)]=428 - me.cw[Chr(188)]=381 - me.cw[Chr(189)]=381 - me.cw[Chr(190)]=447 - me.cw[Chr(191)]=447 - me.cw[Chr(192)]=425 - me.cw[Chr(193)]=400 - me.cw[Chr(194)]=375 - me.cw[Chr(195)]=322 - me.cw[Chr(196)]=378 - me.cw[Chr(197)]=381 - me.cw[Chr(198)]=425 - me.cw[Chr(199)]=335 - me.cw[Chr(200)]=393 - me.cw[Chr(201)]=438 - me.cw[Chr(202)]=381 - me.cw[Chr(203)]=427 - me.cw[Chr(204)]=454 - me.cw[Chr(205)]=387 - me.cw[Chr(206)]=372 - me.cw[Chr(207)]=391 - me.cw[Chr(208)]=357 - me.cw[Chr(209)]=0 - me.cw[Chr(210)]=316 - me.cw[Chr(211)]=316 - me.cw[Chr(212)]=0 - me.cw[Chr(213)]=0 - me.cw[Chr(214)]=0 - me.cw[Chr(215)]=0 - me.cw[Chr(216)]=0 - me.cw[Chr(217)]=0 - me.cw[Chr(218)]=0 - me.cw[Chr(219)]=692 - me.cw[Chr(220)]=692 - me.cw[Chr(221)]=692 - me.cw[Chr(222)]=692 - me.cw[Chr(223)]=411 - me.cw[Chr(224)]=203 - me.cw[Chr(225)]=377 - me.cw[Chr(226)]=237 - me.cw[Chr(227)]=242 - me.cw[Chr(228)]=244 - me.cw[Chr(229)]=205 - me.cw[Chr(230)]=399 - me.cw[Chr(231)]=0 - me.cw[Chr(232)]=0 - me.cw[Chr(233)]=0 - me.cw[Chr(234)]=0 - me.cw[Chr(235)]=0 - me.cw[Chr(236)]=0 - me.cw[Chr(237)]=0 - me.cw[Chr(238)]=0 - me.cw[Chr(239)]=450 - me.cw[Chr(240)]=449 - me.cw[Chr(241)]=449 - me.cw[Chr(242)]=449 - me.cw[Chr(243)]=449 - me.cw[Chr(244)]=449 - me.cw[Chr(245)]=449 - me.cw[Chr(246)]=449 - me.cw[Chr(247)]=449 - me.cw[Chr(248)]=449 - me.cw[Chr(249)]=449 - me.cw[Chr(250)]=522 - me.cw[Chr(251)]=697 - me.cw[Chr(252)]=692 - me.cw[Chr(253)]=692 - me.cw[Chr(254)]=692 - me.cw[Chr(255)]=692 - me.up = -35 - me.ut = 30 - me.fonttype = "TrueType" - me.name = "THSarabunNew" - me.enc = "cp874" - me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" - me.desc = make([]FontDescItem,8) - me.desc[0] = FontDescItem{ Key:"Ascent",Val : "850" } - me.desc[1] = FontDescItem{ Key: "Descent", Val : "-250" } - me.desc[2] = FontDescItem{ Key:"CapHeight", Val : "476" } - me.desc[3] = FontDescItem{ Key: "Flags", Val : "32" } - me.desc[4] = FontDescItem{ Key:"FontBBox", Val : "[-427 -421 947 836]" } - me.desc[5] = FontDescItem{ Key:"ItalicAngle", Val : "0" } - me.desc[6] = FontDescItem{ Key:"StemV", Val : "70" } - me.desc[7] = FontDescItem{ Key:"MissingWidth", Val : "692" } - } -func (me * THSarabunNew)GetType() string{ - return me.fonttype -} -func (me * THSarabunNew)GetName() string{ - return me.name -} -func (me * THSarabunNew)GetDesc() []FontDescItem{ - return me.desc -} -func (me * THSarabunNew)GetUp() int{ - return me.up -} -func (me * THSarabunNew)GetUt() int{ - return me.ut -} -func (me * THSarabunNew)GetCw() FontCw{ - return me.cw -} -func (me * THSarabunNew)GetEnc() string{ - return me.enc -} -func (me * THSarabunNew)GetDiff() string { - return me.diff -} -func (me * THSarabunNew) GetOriginalsize() int{ - return 98764 -} -func (me * THSarabunNew) SetFamily(family string){ - me.family = family -} -func (me * THSarabunNew) GetFamily() string{ - return me.family -} \ No newline at end of file diff --git a/src/gopdf/font_thsarabunnewbold.go b/src/gopdf/font_thsarabunnewbold.go deleted file mode 100644 index 681c5d1..0000000 --- a/src/gopdf/font_thsarabunnewbold.go +++ /dev/null @@ -1,324 +0,0 @@ -package gopdf - -import ( - -) - -type THSarabunNewBold struct { - family string - fonttype string - name string - desc []FontDescItem - up int - ut int - cw FontCw - enc string - diff string -} -func (me * THSarabunNewBold) Init(){ - me.cw = make(FontCw) - me.cw[Chr(0)]=698 - me.cw[Chr(1)]=698 - me.cw[Chr(2)]=698 - me.cw[Chr(3)]=698 - me.cw[Chr(4)]=698 - me.cw[Chr(5)]=698 - me.cw[Chr(6)]=698 - me.cw[Chr(7)]=698 - me.cw[Chr(8)]=698 - me.cw[Chr(9)]=698 - me.cw[Chr(10)]=698 - me.cw[Chr(11)]=698 - me.cw[Chr(12)]=698 - me.cw[Chr(13)]=698 - me.cw[Chr(14)]=698 - me.cw[Chr(15)]=698 - me.cw[Chr(16)]=698 - me.cw[Chr(17)]=698 - me.cw[Chr(18)]=698 - me.cw[Chr(19)]=698 - me.cw[Chr(20)]=698 - me.cw[Chr(21)]=698 - me.cw[Chr(22)]=698 - me.cw[Chr(23)]=698 - me.cw[Chr(24)]=698 - me.cw[Chr(25)]=698 - me.cw[Chr(26)]=698 - me.cw[Chr(27)]=698 - me.cw[Chr(28)]=698 - me.cw[Chr(29)]=698 - me.cw[Chr(30)]=698 - me.cw[Chr(31)]=698 - me.cw[ToByte(" ")]=226 - me.cw[ToByte("!")]=168 - me.cw[ToByte("\"")]=291 - me.cw[ToByte("#")]=462 - me.cw[ToByte("$")]=367 - me.cw[ToByte("%")]=688 - me.cw[ToByte("&")]=486 - me.cw[ToByte("'")]=169 - me.cw[ToByte("(")]=244 - me.cw[ToByte(")")]=244 - me.cw[ToByte("*")]=343 - me.cw[ToByte("+")]=417 - me.cw[ToByte(",")]=172 - me.cw[ToByte("-")]=226 - me.cw[ToByte(".")]=172 - me.cw[ToByte("/")]=276 - me.cw[ToByte("0")]=378 - me.cw[ToByte("1")]=378 - me.cw[ToByte("2")]=378 - me.cw[ToByte("3")]=378 - me.cw[ToByte("4")]=378 - me.cw[ToByte("5")]=378 - me.cw[ToByte("6")]=378 - me.cw[ToByte("7")]=378 - me.cw[ToByte("8")]=378 - me.cw[ToByte("9")]=378 - me.cw[ToByte(":")]=172 - me.cw[ToByte(";")]=172 - me.cw[ToByte("<")]=417 - me.cw[ToByte("=")]=417 - me.cw[ToByte(">")]=417 - me.cw[ToByte("?")]=289 - me.cw[ToByte("@")]=572 - me.cw[ToByte("A")]=451 - me.cw[ToByte("B")]=396 - me.cw[ToByte("C")]=432 - me.cw[ToByte("D")]=459 - me.cw[ToByte("E")]=358 - me.cw[ToByte("F")]=358 - me.cw[ToByte("G")]=454 - me.cw[ToByte("H")]=472 - me.cw[ToByte("I")]=163 - me.cw[ToByte("J")]=282 - me.cw[ToByte("K")]=411 - me.cw[ToByte("L")]=359 - me.cw[ToByte("M")]=574 - me.cw[ToByte("N")]=472 - me.cw[ToByte("O")]=518 - me.cw[ToByte("P")]=390 - me.cw[ToByte("Q")]=518 - me.cw[ToByte("R")]=395 - me.cw[ToByte("S")]=365 - me.cw[ToByte("T")]=421 - me.cw[ToByte("U")]=482 - me.cw[ToByte("V")]=422 - me.cw[ToByte("W")]=612 - me.cw[ToByte("X")]=426 - me.cw[ToByte("Y")]=396 - me.cw[ToByte("Z")]=451 - me.cw[ToByte("[")]=234 - me.cw[ToByte("\\")]=268 - me.cw[ToByte("]")]=234 - me.cw[ToByte("^")]=418 - me.cw[ToByte("_")]=376 - me.cw[ToByte("`")]=210 - me.cw[ToByte("a")]=367 - me.cw[ToByte("b")]=435 - me.cw[ToByte("c")]=347 - me.cw[ToByte("d")]=435 - me.cw[ToByte("e")]=391 - me.cw[ToByte("f")]=254 - me.cw[ToByte("g")]=332 - me.cw[ToByte("h")]=423 - me.cw[ToByte("i")]=163 - me.cw[ToByte("j")]=171 - me.cw[ToByte("k")]=340 - me.cw[ToByte("l")]=213 - me.cw[ToByte("m")]=636 - me.cw[ToByte("n")]=423 - me.cw[ToByte("o")]=412 - me.cw[ToByte("p")]=431 - me.cw[ToByte("q")]=431 - me.cw[ToByte("r")]=246 - me.cw[ToByte("s")]=296 - me.cw[ToByte("t")]=258 - me.cw[ToByte("u")]=418 - me.cw[ToByte("v")]=358 - me.cw[ToByte("w")]=480 - me.cw[ToByte("x")]=349 - me.cw[ToByte("y")]=361 - me.cw[ToByte("z")]=358 - me.cw[ToByte("{")]=255 - me.cw[ToByte("|")]=177 - me.cw[ToByte("}")]=255 - me.cw[ToByte("~")]=422 - me.cw[Chr(127)]=698 - me.cw[Chr(128)]=518 - me.cw[Chr(129)]=698 - me.cw[Chr(130)]=698 - me.cw[Chr(131)]=698 - me.cw[Chr(132)]=698 - me.cw[Chr(133)]=504 - me.cw[Chr(134)]=698 - me.cw[Chr(135)]=698 - me.cw[Chr(136)]=698 - me.cw[Chr(137)]=698 - me.cw[Chr(138)]=698 - me.cw[Chr(139)]=698 - me.cw[Chr(140)]=698 - me.cw[Chr(141)]=698 - me.cw[Chr(142)]=698 - me.cw[Chr(143)]=698 - me.cw[Chr(144)]=698 - me.cw[Chr(145)]=253 - me.cw[Chr(146)]=253 - me.cw[Chr(147)]=384 - me.cw[Chr(148)]=384 - me.cw[Chr(149)]=226 - me.cw[Chr(150)]=335 - me.cw[Chr(151)]=693 - me.cw[Chr(152)]=698 - me.cw[Chr(153)]=698 - me.cw[Chr(154)]=698 - me.cw[Chr(155)]=698 - me.cw[Chr(156)]=698 - me.cw[Chr(157)]=698 - me.cw[Chr(158)]=698 - me.cw[Chr(159)]=698 - me.cw[Chr(160)]=226 - me.cw[Chr(161)]=391 - me.cw[Chr(162)]=415 - me.cw[Chr(163)]=431 - me.cw[Chr(164)]=403 - me.cw[Chr(165)]=403 - me.cw[Chr(166)]=453 - me.cw[Chr(167)]=318 - me.cw[Chr(168)]=390 - me.cw[Chr(169)]=405 - me.cw[Chr(170)]=415 - me.cw[Chr(171)]=431 - me.cw[Chr(172)]=565 - me.cw[Chr(173)]=565 - me.cw[Chr(174)]=425 - me.cw[Chr(175)]=425 - me.cw[Chr(176)]=372 - me.cw[Chr(177)]=492 - me.cw[Chr(178)]=551 - me.cw[Chr(179)]=576 - me.cw[Chr(180)]=405 - me.cw[Chr(181)]=405 - me.cw[Chr(182)]=391 - me.cw[Chr(183)]=438 - me.cw[Chr(184)]=358 - me.cw[Chr(185)]=433 - me.cw[Chr(186)]=445 - me.cw[Chr(187)]=445 - me.cw[Chr(188)]=414 - me.cw[Chr(189)]=414 - me.cw[Chr(190)]=482 - me.cw[Chr(191)]=482 - me.cw[Chr(192)]=425 - me.cw[Chr(193)]=417 - me.cw[Chr(194)]=386 - me.cw[Chr(195)]=329 - me.cw[Chr(196)]=391 - me.cw[Chr(197)]=399 - me.cw[Chr(198)]=425 - me.cw[Chr(199)]=379 - me.cw[Chr(200)]=403 - me.cw[Chr(201)]=461 - me.cw[Chr(202)]=399 - me.cw[Chr(203)]=438 - me.cw[Chr(204)]=468 - me.cw[Chr(205)]=394 - me.cw[Chr(206)]=385 - me.cw[Chr(207)]=380 - me.cw[Chr(208)]=340 - me.cw[Chr(209)]=0 - me.cw[Chr(210)]=336 - me.cw[Chr(211)]=336 - me.cw[Chr(212)]=0 - me.cw[Chr(213)]=0 - me.cw[Chr(214)]=0 - me.cw[Chr(215)]=0 - me.cw[Chr(216)]=0 - me.cw[Chr(217)]=0 - me.cw[Chr(218)]=0 - me.cw[Chr(219)]=698 - me.cw[Chr(220)]=698 - me.cw[Chr(221)]=698 - me.cw[Chr(222)]=698 - me.cw[Chr(223)]=389 - me.cw[Chr(224)]=208 - me.cw[Chr(225)]=395 - me.cw[Chr(226)]=252 - me.cw[Chr(227)]=269 - me.cw[Chr(228)]=252 - me.cw[Chr(229)]=209 - me.cw[Chr(230)]=437 - me.cw[Chr(231)]=0 - me.cw[Chr(232)]=0 - me.cw[Chr(233)]=0 - me.cw[Chr(234)]=0 - me.cw[Chr(235)]=0 - me.cw[Chr(236)]=0 - me.cw[Chr(237)]=0 - me.cw[Chr(238)]=0 - me.cw[Chr(239)]=450 - me.cw[Chr(240)]=456 - me.cw[Chr(241)]=456 - me.cw[Chr(242)]=456 - me.cw[Chr(243)]=456 - me.cw[Chr(244)]=456 - me.cw[Chr(245)]=456 - me.cw[Chr(246)]=456 - me.cw[Chr(247)]=456 - me.cw[Chr(248)]=456 - me.cw[Chr(249)]=456 - me.cw[Chr(250)]=525 - me.cw[Chr(251)]=697 - me.cw[Chr(252)]=698 - me.cw[Chr(253)]=698 - me.cw[Chr(254)]=698 - me.cw[Chr(255)]=698 - me.up = -35 - me.ut = 30 - me.fonttype = "TrueType" - me.name = "THSarabunNew-Bold" - me.enc = "cp874" - me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" - me.desc = make([]FontDescItem,8) - me.desc[0] = FontDescItem{ Key:"Ascent",Val : "850" } - me.desc[1] = FontDescItem{ Key: "Descent", Val : "-250" } - me.desc[2] = FontDescItem{ Key:"CapHeight", Val : "476" } - me.desc[3] = FontDescItem{ Key: "Flags", Val : "32" } - me.desc[4] = FontDescItem{ Key:"FontBBox", Val : "[-466 -457 947 844]" } - me.desc[5] = FontDescItem{ Key:"ItalicAngle", Val : "0" } - me.desc[6] = FontDescItem{ Key:"StemV", Val : "120" } - me.desc[7] = FontDescItem{ Key:"MissingWidth", Val : "698" } - } -func (me * THSarabunNewBold)GetType() string{ - return me.fonttype -} -func (me * THSarabunNewBold)GetName() string{ - return me.name -} -func (me * THSarabunNewBold)GetDesc() []FontDescItem{ - return me.desc -} -func (me * THSarabunNewBold)GetUp() int{ - return me.up -} -func (me * THSarabunNewBold)GetUt() int{ - return me.ut -} -func (me * THSarabunNewBold)GetCw() FontCw{ - return me.cw -} -func (me * THSarabunNewBold)GetEnc() string{ - return me.enc -} -func (me * THSarabunNewBold)GetDiff() string { - return me.diff -} -func (me * THSarabunNewBold) GetOriginalsize() int{ - return 98764 -} -func (me * THSarabunNewBold) SetFamily(family string){ - me.family = family -} -func (me * THSarabunNewBold) GetFamily() string{ - return me.family -} \ No newline at end of file diff --git a/src/gopdf/loma.go b/src/gopdf/loma.go deleted file mode 100644 index d595f69..0000000 --- a/src/gopdf/loma.go +++ /dev/null @@ -1,332 +0,0 @@ -package gopdf - -import ( - -) - -/*ยังไม่เสร็จ*/ - -type Loma struct{ - family string - fonttype string - name string - desc []FontDescItem - up int - ut int - cw FontCw - enc string - diff string -} - -func (me * Loma)Init(){ - me.cw = make(FontCw) - me.cw[Chr(0)]=750; - me.cw[Chr(1)]=750; - me.cw[Chr(2)]=750; - me.cw[Chr(3)]=750; - me.cw[Chr(4)]=750; - me.cw[Chr(5)]=750; - me.cw[Chr(6)]=750; - me.cw[Chr(7)]=750; - me.cw[Chr(8)]=750; - me.cw[Chr(9)]=750; - me.cw[Chr(10)]=750; - me.cw[Chr(11)]=750; - me.cw[Chr(12)]=750; - me.cw[Chr(13)]=750; - me.cw[Chr(14)]=750; - me.cw[Chr(15)]=750; - me.cw[Chr(16)]=750; - me.cw[Chr(17)]=750; - me.cw[Chr(18)]=750; - me.cw[Chr(19)]=750; - me.cw[Chr(20)]=750; - me.cw[Chr(21)]=750; - me.cw[Chr(22)]=750; - me.cw[Chr(23)]=750; - me.cw[Chr(24)]=750; - me.cw[Chr(25)]=750; - me.cw[Chr(26)]=750; - me.cw[Chr(27)]=750; - me.cw[Chr(28)]=750; - me.cw[Chr(29)]=750; - me.cw[Chr(30)]=750; - me.cw[Chr(31)]=750; - me.cw[ToByte(" ")]=500; - me.cw[ToByte("!")]=278; - me.cw[ToByte("\"")]=355; - me.cw[ToByte("#")]=556; - me.cw[ToByte("$")]=556; - me.cw[ToByte("%")]=889; - me.cw[ToByte("&")]=667; - me.cw[ToByte("'")]=191; - me.cw[ToByte("(")]=333; - me.cw[ToByte(")")]=333; - me.cw[ToByte("*")]=389; - me.cw[ToByte("+")]=584; - me.cw[ToByte(",")]=278; - me.cw[ToByte("-")]=333; - me.cw[ToByte(".")]=278; - me.cw[ToByte("/")]=291; - me.cw[ToByte("0")]=556; - me.cw[ToByte("1")]=556; - me.cw[ToByte("2")]=556; - me.cw[ToByte("3")]=556; - me.cw[ToByte("4")]=556; - me.cw[ToByte("5")]=556; - me.cw[ToByte("6")]=556; - me.cw[ToByte("7")]=556; - me.cw[ToByte("8")]=556; - me.cw[ToByte("9")]=556; - me.cw[ToByte(":")]=278; - me.cw[ToByte(";")]=278; - me.cw[ToByte("<")]=584; - me.cw[ToByte("=")]=584; - me.cw[ToByte(">")]=584; - me.cw[ToByte("?")]=556; - me.cw[ToByte("@")]=1015; - me.cw[ToByte("A")]=667; - me.cw[ToByte("B")]=667; - me.cw[ToByte("C")]=722; - me.cw[ToByte("D")]=722; - me.cw[ToByte("E")]=667; - me.cw[ToByte("F")]=611; - me.cw[ToByte("G")]=722; - me.cw[ToByte("H")]=722; - me.cw[ToByte("I")]=317; - me.cw[ToByte("J")]=500; - me.cw[ToByte("K")]=667; - me.cw[ToByte("L")]=556; - me.cw[ToByte("M")]=833; - me.cw[ToByte("N")]=722; - me.cw[ToByte("O")]=778; - me.cw[ToByte("P")]=667; - me.cw[ToByte("Q")]=810; - me.cw[ToByte("R")]=684; - me.cw[ToByte("S")]=667; - me.cw[ToByte("T")]=611; - me.cw[ToByte("U")]=722; - me.cw[ToByte("V")]=667; - me.cw[ToByte("W")]=944; - me.cw[ToByte("X")]=667; - me.cw[ToByte("Y")]=667; - me.cw[ToByte("Z")]=611; - me.cw[ToByte("[")]=278; - me.cw[ToByte("\\")]=278; - me.cw[ToByte("]")]=278; - me.cw[ToByte("^")]=469; - me.cw[ToByte("_")]=556; - me.cw[ToByte("`")]=333; - me.cw[ToByte("a")]=556; - me.cw[ToByte("b")]=556; - me.cw[ToByte("c")]=500; - me.cw[ToByte("d")]=556; - me.cw[ToByte("e")]=556; - me.cw[ToByte("f")]=278; - me.cw[ToByte("g")]=556; - me.cw[ToByte("h")]=556; - me.cw[ToByte("i")]=222; - me.cw[ToByte("j")]=222; - me.cw[ToByte("k")]=500; - me.cw[ToByte("l")]=222; - me.cw[ToByte("m")]=833; - me.cw[ToByte("n")]=556; - me.cw[ToByte("o")]=556; - me.cw[ToByte("p")]=556; - me.cw[ToByte("q")]=556; - me.cw[ToByte("r")]=333; - me.cw[ToByte("s")]=500; - me.cw[ToByte("t")]=278; - me.cw[ToByte("u")]=556; - me.cw[ToByte("v")]=500; - me.cw[ToByte("w")]=722; - me.cw[ToByte("x")]=500; - me.cw[ToByte("y")]=500; - me.cw[ToByte("z")]=500; - me.cw[ToByte("{")]=334; - me.cw[ToByte("|")]=260; - me.cw[ToByte("}")]=334; - me.cw[ToByte("~")]=584; - me.cw[Chr(127)]=750; - me.cw[Chr(128)]=750; - me.cw[Chr(129)]=750; - me.cw[Chr(130)]=750; - me.cw[Chr(131)]=750; - me.cw[Chr(132)]=750; - me.cw[Chr(133)]=806; - me.cw[Chr(134)]=750; - me.cw[Chr(135)]=750; - me.cw[Chr(136)]=750; - me.cw[Chr(137)]=750; - me.cw[Chr(138)]=750; - me.cw[Chr(139)]=750; - me.cw[Chr(140)]=750; - me.cw[Chr(141)]=750; - me.cw[Chr(142)]=750; - me.cw[Chr(143)]=750; - me.cw[Chr(144)]=750; - me.cw[Chr(145)]=220; - me.cw[Chr(146)]=283; - me.cw[Chr(147)]=415; - me.cw[Chr(148)]=488; - me.cw[Chr(149)]=464; - me.cw[Chr(150)]=549; - me.cw[Chr(151)]=921; - me.cw[Chr(152)]=750; - me.cw[Chr(153)]=750; - me.cw[Chr(154)]=750; - me.cw[Chr(155)]=750; - me.cw[Chr(156)]=750; - me.cw[Chr(157)]=750; - me.cw[Chr(158)]=750; - me.cw[Chr(159)]=750; - me.cw[Chr(160)]=278; - me.cw[Chr(161)]=605; - me.cw[Chr(162)]=684; - me.cw[Chr(163)]=708; - me.cw[Chr(164)]=669; - me.cw[Chr(165)]=669; - me.cw[Chr(166)]=742; - me.cw[Chr(167)]=488; - me.cw[Chr(168)]=586; - me.cw[Chr(169)]=681; - me.cw[Chr(170)]=679; - me.cw[Chr(171)]=679; - me.cw[Chr(172)]=854; - me.cw[Chr(173)]=852; - me.cw[Chr(174)]=671; - me.cw[Chr(175)]=671; - me.cw[Chr(176)]=552; - me.cw[Chr(177)]=830; - me.cw[Chr(178)]=903; - me.cw[Chr(179)]=928; - me.cw[Chr(180)]=649; - me.cw[Chr(181)]=649; - me.cw[Chr(182)]=605; - me.cw[Chr(183)]=659; - me.cw[Chr(184)]=610; - me.cw[Chr(185)]=684; - me.cw[Chr(186)]=635; - me.cw[Chr(187)]=635; - me.cw[Chr(188)]=586; - me.cw[Chr(189)]=586; - me.cw[Chr(190)]=659; - me.cw[Chr(191)]=708; - me.cw[Chr(192)]=659; - me.cw[Chr(193)]=659; - me.cw[Chr(194)]=586; - me.cw[Chr(195)]=537; - me.cw[Chr(196)]=605; - me.cw[Chr(197)]=613; - me.cw[Chr(198)]=659; - me.cw[Chr(199)]=562; - me.cw[Chr(200)]=635; - me.cw[Chr(201)]=659; - me.cw[Chr(202)]=610; - me.cw[Chr(203)]=659; - me.cw[Chr(204)]=684; - me.cw[Chr(205)]=601; - me.cw[Chr(206)]=610; - me.cw[Chr(207)]=562; - me.cw[Chr(208)]=537; - me.cw[Chr(209)]=0; - me.cw[Chr(210)]=562; - me.cw[Chr(211)]=562; - me.cw[Chr(212)]=0; - me.cw[Chr(213)]=0; - me.cw[Chr(214)]=0; - me.cw[Chr(215)]=0; - me.cw[Chr(216)]=0; - me.cw[Chr(217)]=0; - me.cw[Chr(218)]=0; - me.cw[Chr(219)]=750; - me.cw[Chr(220)]=750; - me.cw[Chr(221)]=750; - me.cw[Chr(222)]=750; - me.cw[Chr(223)]=610; - me.cw[Chr(224)]=342; - me.cw[Chr(225)]=645; - me.cw[Chr(226)]=537; - me.cw[Chr(227)]=488; - me.cw[Chr(228)]=503; - me.cw[Chr(229)]=488; - me.cw[Chr(230)]=537; - me.cw[Chr(231)]=0; - me.cw[Chr(232)]=0; - me.cw[Chr(233)]=0; - me.cw[Chr(234)]=0; - me.cw[Chr(235)]=0; - me.cw[Chr(236)]=0; - me.cw[Chr(237)]=0; - me.cw[Chr(238)]=0; - me.cw[Chr(239)]=610; - me.cw[Chr(240)]=610; - me.cw[Chr(241)]=635; - me.cw[Chr(242)]=659; - me.cw[Chr(243)]=684; - me.cw[Chr(244)]=757; - me.cw[Chr(245)]=757; - me.cw[Chr(246)]=635; - me.cw[Chr(247)]=752; - me.cw[Chr(248)]=771; - me.cw[Chr(249)]=732; - me.cw[Chr(250)]=684; - me.cw[Chr(251)]=1157; - me.cw[Chr(252)]=750; - me.cw[Chr(253)]=750; - me.cw[Chr(254)]=750; - me.cw[Chr(255)]=750; - - me.up = -88; - me.ut = 10; - me.fonttype = "TrueType" - me.name = "Loma" - me.enc = "cp874" - me.diff = "130 /.notdef /.notdef /.notdef 134 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 152 /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /kokaithai /khokhaithai /khokhuatthai /khokhwaithai /khokhonthai /khorakhangthai /ngonguthai /chochanthai /chochingthai /chochangthai /sosothai /chochoethai /yoyingthai /dochadathai /topatakthai /thothanthai /thonangmonthothai /thophuthaothai /nonenthai /dodekthai /totaothai /thothungthai /thothahanthai /thothongthai /nonuthai /bobaimaithai /poplathai /phophungthai /fofathai /phophanthai /fofanthai /phosamphaothai /momathai /yoyakthai /roruathai /ruthai /lolingthai /luthai /wowaenthai /sosalathai /sorusithai /sosuathai /hohipthai /lochulathai /oangthai /honokhukthai /paiyannoithai /saraathai /maihanakatthai /saraaathai /saraamthai /saraithai /saraiithai /sarauethai /saraueethai /sarauthai /sarauuthai /phinthuthai /.notdef /.notdef /.notdef /.notdef /bahtthai /saraethai /saraaethai /saraothai /saraaimaimuanthai /saraaimaimalaithai /lakkhangyaothai /maiyamokthai /maitaikhuthai /maiekthai /maithothai /maitrithai /maichattawathai /thanthakhatthai /nikhahitthai /yamakkanthai /fongmanthai /zerothai /onethai /twothai /threethai /fourthai /fivethai /sixthai /seventhai /eightthai /ninethai /angkhankhuthai /khomutthai /.notdef /.notdef /.notdef /.notdef" - - me.desc = make([]FontDescItem,8) - me.desc[0] = FontDescItem{ Key:"Ascent",Val : "800" } - me.desc[1] = FontDescItem{ Key: "Descent", Val : "-200" } - me.desc[2] = FontDescItem{ Key:"CapHeight", Val : "800"} - me.desc[3] = FontDescItem{ Key: "Flags", Val : "32"} - me.desc[4] = FontDescItem{ Key:"FontBBox", Val : "[-743 -440 1338 1146]"} - me.desc[5] = FontDescItem{ Key:"ItalicAngle", Val : "0"} - me.desc[6] = FontDescItem{ Key:"StemV", Val : "70"} - me.desc[7] = FontDescItem{ Key:"MissingWidth", Val : "750"} - -} -func (me * Loma)GetType() string{ - return me.fonttype -} -func (me * Loma)GetName() string{ - return me.name -} -func (me * Loma)GetDesc() []FontDescItem{ - return me.desc -} -func (me * Loma)GetUp() int{ - return me.up -} -func (me * Loma)GetUt() int{ - return me.ut -} -func (me * Loma)GetCw() FontCw{ - return me.cw -} -func (me * Loma)GetEnc() string{ - return me.enc -} -func (me * Loma)GetDiff() string { - return me.diff -} -func (me * Loma) GetOriginalsize() int{ - return 0 -} - -func (me * Loma) SetFamily(family string){ - me.family = family -} - -func (me * Loma) GetFamily() string{ - return me.family -} diff --git a/src/gopdf_test/normal_test.go b/src/gopdf_test/normal_test.go deleted file mode 100644 index 01f9b32..0000000 --- a/src/gopdf_test/normal_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package gopdf_test - -import ( - "fmt" - "gopdf" - iconv "github.com/djimenez/iconv-go" - "testing" -) - -var fontPath = "/data/CODES/WORKS/GoPdf_ws/GoPdf/res/fonts" -var outputPdfPath = "/var/www/fpdf17/output" - -func TestNormol01(t *testing.T){ - - fmt.Println("start...") - pdf := gopdf.GoPdf{} - pdf.Start(gopdf.Config{Unit: "pt", PageSize: gopdf.Rect{W: 595.28, H: 841.89}}) //595.28, 841.89 = A4 - pdf.AddFont("THSarabunPSK",new(gopdf.THSarabun),fontPath + "/THSarabun.z") - pdf.AddFont("Loma",new(gopdf.Loma), fontPath + "/Loma.z") - pdf.AddPage() - pdf.SetFont("THSarabunPSK", "B", 14) - pdf.Cell(nil, ToCp874("ทดสอบ")) - pdf.Cell(nil, ToCp874("Test")) - pdf.Br(28) - - /*pdf.SetFont("THSarabunPSK", "B", 26) - pdf.Image("/data/CODES/WORKS/GoPdf_ws/GoPdf/test/me.jpg",20,10,nil) - pdf.Cell(nil, ToCp874("ด้วยการที่เราไม่ไปทำยังไง")) - pdf.Cell(nil, ToCp874("ศาลอาญา ไม่ชี้ชัด ใครยิง ")) - - - pdf.AddPage() - pdf.SetFont("Loma", "B", 12) - pdf.Cell(&gopdf.Rect{H: 100, W: 100}, ToCp874("การบ้านx")) - pdf.SetFont("THSarabunPSK", "B", 12) - pdf.Cell(&gopdf.Rect{H: 100, W: 100}, ToCp874("การบ้านx") ) - pdf.Br(14) - pdf.Cell(&gopdf.Rect{H: 100, W: 100}, ToCp874("การบ้านx")) - pdf.Cell(&gopdf.Rect{H: 100, W: 100}, ToCp874("การบ้านx") ) - pdf.SetLineWidth(1) - pdf.Line(10,10,500,10)*/ - - pdf.WritePdf(outputPdfPath + "/x.pdf") - fmt.Println("end...") -} - - - -func ToCp874(str string) string{ - str, _ = iconv.ConvertString( str, "utf-8", "cp874") - return str -} \ No newline at end of file diff --git a/src/gopdf/strhelper.go b/strhelper.go similarity index 100% rename from src/gopdf/strhelper.go rename to strhelper.go diff --git a/test.sh b/test.sh deleted file mode 100644 index 78724cb..0000000 --- a/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -rm -f ./bin/gopdf - . ./compile.sh - go test -v gopdf_test \ No newline at end of file diff --git a/test/me.jpg b/test/me.jpg deleted file mode 100644 index 318ac30..0000000 Binary files a/test/me.jpg and /dev/null differ