On Tuesday (17. May 2011), we, Raik and me, visited the 18. it2 (“18. Industrietag Informationstechnologie”) in Halle, Germany. The program was quite interesting and we heard lots of good presentations. I did my talk about Spreadshirt’s platform architecture for providing Customized Apparel as a Service (CAaaS) at around 5:30 pm. You can see a picture of me and the audience below.
In my talk, I started with a short introduction to Spreadshirt’s platform vision and then got into the details auf our t-shirt designer’s and API architecture. You can click on the image below to see the presentation on slideshare.
It was fun to be at the it2 and we will try to be there next year again.
Since a couple of weeks, there is a YouTube video about Spreadshirt’s REST API available, that gives a pretty good introduction to the API and what opportunities it gives to you.
In this blog post, I will tell you how to translate product type, product, design and text coordinates correctly from Spreadshirt’s SVG user coordinate system to your application’s coordinate system. You need to understand how the translation works in case you want to display and manipulate Spreadshirt products in your own applications. Please read the Text and Design Positioning Guide to learn more about how to position text and designs on Spreadshirt products. Also read Product Model, ProductType Model, Design Model to learn more about them in case you don’t know already.
When displaying a Spreadshirt product or creating a new one in your own application, you need to consider different coordinates and sizes from Spreadshirt product types, products, designs and text. The coordinates and sizes to be considered are as follows:
- View size – size of the view, e.g. front, back or left side on a shirt
- ViewMap offset – position of the print area on the actual view
- PrintArea size – size of the print area we can print on
- Configuration offset – position of the actual configuration on the print area
- Size – actual size of the design
- Position – start position of the text depending on the given text anchor
- Font size – size of the font used for the text
- Text anchor – alignment of the text, e.g. left, center, right
Spreadshirt does all internal calculations in Spreadshirt’s SVG user coordinate system in millimeters right now. That means all coordinates, sizes and font sizes are provided in millimeters! So when displaying a Spreadshirt product in a Web browser or creating a new one, you always need to translate the millimeter coordinates, sizes and font sizes to pixels and vice versa. Continue reading “Mapping Coordinates from Spreadshirt’s SVG User Coordinate System to your Application’s Coordinate System (API Terminology Explained #10)”