File: oriented_labels.dx

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (42 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This data file is intended to demonstrate using the Text module to place
# labels.


# the positions component
object 1 class array type float rank 1 shape 2 items 4 data follows
    0.0 5.0
    5.0 5.0
    0.0 0.0
    5.0 0.0

# the data component (type string). The shape is the length of the longest
# string + 1.
object 2 class array type string rank 1 shape 11 items 4 data follows
    "this"
    "is"
    "annotation"
    "text"
attribute "dep" string "positions"

# the tangents component can be used to orient the direction of annotation
# text
object 3 class array type float rank 1 shape 2 items 4 data follows
   0.0 1.0
   0.5 0.5
   1.0 0.0
   0.5 -0.5

# the binormals component can be used to orient the "up" direction of the
# text. 
object 4 class array type float rank 1 shape 2 items 4 data follows
   -1.0 0.0
   -0.5 0.5
    0.2 1.0
    0.2 0.5

# create the field
object 5 class field 
   component "positions" value 1
   component "data" value 2
   component "tangents" value 3
   component "binormals" value 4