gitflow-hotfix-stash: v1.0

This commit is contained in:
Unknown
2018-04-28 15:55:04 -04:00
parent f92bb18c30
commit c8420a46ff
5 changed files with 132 additions and 84 deletions

View File

@@ -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()