File: charwrap_test_elements.py

package info (click to toggle)
fpdf2 2.8.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 53,860 kB
  • sloc: python: 39,487; sh: 133; makefile: 12
file content (54 lines) | stat: -rw-r--r-- 1,669 bytes parent folder | download | duplicates (2)
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
43
44
45
46
47
48
49
50
51
52
53
54
elements = [
    {
        "name": "multi",
        "type": "T",
        "x1": 80,
        "y1": 10,
        "x2": 170,
        "y2": 15,
        "text": "If multiline is False, the text should still not wrap even if wrapmode is specified.",
        "background": 0xEEFFFF,
        "multiline": False,
        "wrapmode": "WORD",
    },
    {
        "name": "multi",
        "type": "T",
        "x1": 80,
        "y1": 40,
        "x2": 170,
        "y2": 45,
        "text": "If multiline is True, and wrapmode is omitted, the text should wrap by word and not "
        + "cause an error due to omission of the wrapmode argument.",
        "background": 0xEEFFFF,
        "multiline": True,
    },
    {
        "name": "multi",
        "type": "T",
        "x1": 80,
        "y1": 70,
        "x2": 170,
        "y2": 75,
        "text": "If multiline is True and the wrapmode argument is provided, it should not cause a "
        + "problem even if using the default wrapmode of 'WORD'.",
        "background": 0xEEFFFF,
        "multiline": True,
        "wrapmode": "WORD",
    },
    {
        "name": "multi",
        "type": "T",
        "x1": 80,
        "y1": 100,
        "x2": 170,
        "y2": 105,
        "text": "If multiline is True and the wrapmode is 'CHAR', it should result in "
        + "wrapping based on characters instead of words, regardless of language (i.e. even though "
        + "this is designed to support scripts like Chinese and Japanese, wrapping long sentences "
        + "like this in English still demonstrates functionality.)",
        "background": 0xEEFFFF,
        "multiline": True,
        "wrapmode": "CHAR",
    },
]