mirror of
https://github.com/sbrow/ps.git
synced 2025-12-29 18:47:38 -05:00
gitflow-hotfix-stash: v1.0
This commit is contained in:
32
ps_test.go
32
ps_test.go
@@ -1,3 +1,4 @@
|
||||
// TODO: Update package tests.
|
||||
package ps
|
||||
|
||||
import (
|
||||
@@ -248,6 +249,37 @@ func TestDoJs_HideLayer(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTextItem(t *testing.T) {
|
||||
// err := Open("F:\\GitLab\\dreamkeepers-psd\\Template009.1.psd")
|
||||
// if err != nil {
|
||||
// t.Fatal(err)
|
||||
// }
|
||||
|
||||
d, err := ActiveDocument()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, lyr := range d.ArtLayers() {
|
||||
if lyr.Name() == "Text" {
|
||||
lyr.SetText("Butts")
|
||||
// lyr.FmtText(0, 5, "Arial", "Regular")
|
||||
// lyr.FmtText(0, 3, "Arial", "Bold")
|
||||
}
|
||||
}
|
||||
|
||||
/* byt := []byte(`{"Name": "lyr", "TextItem": {"Contents": "lyr", "Size": 12.000, "Font": "ArialItalic"}}`)
|
||||
lyr := &ArtLayer{}
|
||||
// byt := []byte(`{"Name": "lyr"}`)
|
||||
// lyr := &TextItem{}
|
||||
err := lyr.UnmarshalJSON(byt)
|
||||
fmt.Printf("%+v\n", lyr)
|
||||
fmt.Println(lyr.TextItem)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func BenchmarkDoc_Go(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := ActiveDocument()
|
||||
|
||||
Reference in New Issue
Block a user