2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
title: Add instructions to your design
|
|
|
|
for: developers
|
|
|
|
about: While documentation is good, sometimes you want to add some instructions to your design itself
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
<Note>
|
|
|
|
|
|
|
|
##### See this example in our source code
|
|
|
|
|
2022-08-21 12:31:23 -04:00
|
|
|
- [designs/aaron/src/back.js](https://github.com/freesewing/freesewing/blob/3ca5d0edfe54c7ac20aaf3af2f3544aee72f9b99/designs/aaron/src/back.js#L66)
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
</Note>
|
|
|
|
|
2022-02-20 14:35:50 +01:00
|
|
|
Adding instructions to your pattern is _just_ a matter of adding text.
|
2021-08-25 16:09:31 +02:00
|
|
|
The tricky part is to make sure your text can be translated.
|
|
|
|
|
|
|
|
Below is a rather involved example from Aaron:
|
|
|
|
|
|
|
|
```js
|
2022-08-21 12:31:23 -04:00
|
|
|
points.bindingAnchor = new Point(points.armhole.x / 4, points.armhole.y)
|
2021-08-25 16:09:31 +02:00
|
|
|
.attr('data-text', 'cutTwoStripsToFinishTheArmholes')
|
|
|
|
.attr('data-text', ':\n')
|
2022-08-21 12:31:23 -04:00
|
|
|
.attr('data-text', `2x: ${units(sa * 6 || 60)} x ${units(armholeLength * 0.95 + 2 * sa)}`)
|
|
|
|
.attr('data-text', '\n \n')
|
2021-08-25 16:09:31 +02:00
|
|
|
.attr('data-text', 'cutOneStripToFinishTheNeckOpening')
|
|
|
|
.attr('data-text', ':\n')
|
|
|
|
.attr('data-text', 'width')
|
|
|
|
.attr('data-text', ':')
|
2022-08-21 12:31:23 -04:00
|
|
|
.attr(
|
|
|
|
'data-text',
|
|
|
|
`${units((sa || 10) * 6)} x ${units(neckOpeningLength * 2 * 0.95 + 2 * sa)}`
|
|
|
|
)
|
2021-08-25 16:09:31 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
If you want to add text along a path, you can do that too:
|
|
|
|
|
|
|
|
```js
|
|
|
|
paths.breakLine.attr('data-text', 'breakLine').attr('data-text-class', 'center')
|
|
|
|
paths.flb.attr('data-text', 'facingLiningBoundary')
|
|
|
|
```
|
|
|
|
|
|
|
|
<Tip>
|
|
|
|
|
2022-04-30 14:07:54 -04:00
|
|
|
Refer to [the sprinkle macro documentation](/reference/api/macros/sprinkle/) for details on how
|
2021-08-25 16:09:31 +02:00
|
|
|
to use this macro
|
|
|
|
|
|
|
|
</Tip>
|