Blender Git Loki

Git Commits -> Revision f2341f8

Revision f2341f8 by Campbell Barton (master)
September 18, 2015, 10:43 (GMT)
BLF: initial word-wrap support

- Adds support for word wrapping to Blender's BLF font library.
- Splits lines when width limit is reached or on explicit n newlines.

Details:

- Word wrapping is used when `BLF_WORD_WRAP` flag is enabled.
- There is a single loop to handle line wrapping,
this runs callback, passing in a substring,
this way we can avoid code-duplication for all word-wrapped
versions of functions... OR... avoid having to add support
for word-wrapping directly into each function.
- The `ResultBLF` struct was added to be able to get the number
of wrapped lines, when calling otherwise unrelated functions
such as `BLF_draw/BLF_width/BLF_boundbox`,
which can be passed as the last argument to `BLF_*_ex()` functions.
- The `ResultBLF` struct is used to store the result of drawing
(currently only the number of lines wrapped, and the width).

Commit Details:

Full Hash: f2341f829654c4dc97fcf9fd1f74a6526c4f50ff
Parent Commit: e9dd060
Lines Changed: +464, -105

10 Modified Paths:

/source/blender/blenfont/BLF_api.h (+28, -5) (Diff)
/source/blender/blenfont/intern/blf.c (+130, -27) (Diff)
/source/blender/blenfont/intern/blf_font.c (+237, -40) (Diff)
/source/blender/blenfont/intern/blf_internal.h (+11, -7) (Diff)
/source/blender/blenfont/intern/blf_internal_types.h (+8, -1) (Diff)
/source/blender/blenfont/intern/blf_thumbs.c (+3, -3) (Diff)
/source/blender/blenkernel/intern/image.c (+11, -11) (Diff)
/source/blender/blenkernel/intern/image_gen.c (+9, -9) (Diff)
/source/blender/blenkernel/intern/seqeffects.c (+2, -2) (Diff)
/source/blender/python/generic/blf_py_api.c (+25, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021