Commit Graph

37 Commits

Author SHA1 Message Date
Campbell Barton 15bc30f4ee Text3d: store number of characters and utf8 length separately
EditFont's use of Curve.len was very confusing, in editmode it
represented the number of characters, in object mode the number of
bytes. add Curve.len_wchar and keep track of both.

Also don't convert the editmode text into utf8 on every keystroke.
Now this is done on exiting editmode or save - to match most other
object types.

This also fixes curves 'body_format' being reported with an invalid size.
2014-01-03 17:08:23 +11:00
Campbell Barton a5cb2229ab Text3d: avoid converting utf8 to wchar_t in editmode 2014-01-03 14:20:35 +11:00
Campbell Barton 0af52adac0 Code Cleanup: remove unused members for editfont (3D text) 2013-11-21 04:16:41 +11:00
Campbell Barton 221a383366 use 'bool' for BLI_/BKE_ functions. 2013-03-09 05:35:49 +00:00
Campbell Barton 9a776daca8 code cleanup: vfont's used confusing and over complicated method of storing memory for loaded fonts, not store as a temp var in the fonts. 2012-08-21 10:39:02 +00:00
Campbell Barton 96bda09d23 code cleanup: use camelcase for struct name. 2012-08-03 23:44:50 +00:00
Campbell Barton 6972e19fd5 code cleanup:
- replace (strcmp(vfont->name, FO_BUILTIN_NAME) == 0)  with  (BKE_vfont_is_builtin(vfont)).
- reduce some double promotions.
2012-08-03 22:12:57 +00:00
Campbell Barton 173b998735 fix/edits to vector font handling
- don't overwrite the font path with "<builtin>" when the font file cant be found, it caused bad problems when loading files on someone elses systems when paths couldn't be found blender would silently clobber paths (tsk tsk).

- when fonts are freed their temp data is now freed too.

- assigning a new filepath to a font now refreshes the object data.
2012-08-03 15:03:40 +00:00
Campbell Barton 34b18fcbc1 code cleanup: BKE_ naming, also make bpy.data.images.load() always load a new image. (not use existing one) 2012-05-05 14:52:04 +00:00
Campbell Barton a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
Campbell Barton e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton 8d6a554d75 - add BLI_string_utf8.h for unicode functions.
- move font.c unicode functions into string_utf8.c and rename to fit with other BLI_string funcs.
2011-10-20 09:47:05 +00:00
Campbell Barton 011a3645bf fix [#28846] Relative paths on linked scene fails 2011-10-08 11:02:58 +00:00
Campbell Barton 1fc9fabfbf possible fix [#26930] Blender 2.57 Shuts down when trying to edit 3D text
can't test but this avoids using strncat which is giving problems.
2011-04-15 03:47:54 +00:00
Nathan Letwory 22638e22ea doxygen: blenkernel under core as module. 2011-02-18 13:05:18 +00:00
Campbell Barton 51dcbdde03 use 'const char *' by default with RNA functions except when the value is flagged as PROP_THICK_WRAP.
Also use const char in many other parts of blenders code.

Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
2010-11-17 09:45:45 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Ton Roosendaal 66437a62a7 2.5
Font object + editing back.

Was quite some work due to a myriad of globals all over!
Works nicely 100% local now.

To enable a single textedit operator, I've added a new
keymap entry KM_TEXTEDIT, which gives all keyboard events
to the handler. Also had to add a new keymap-add function
to force a keymap handler in beginning of region handlers.
In future this can be used to prioritize handlers.

Also: split off the arrow keys (frame change) to a separate
region level handler. Can be set with default flag in
regiontype->keymapflag ED_KEYMAP_FRAMES
2009-01-23 14:43:25 +00:00
Ton Roosendaal f7cb86df3a 2.5
Think global, act local!

The old favorite G.scene gone! Man... that took almost 2 days.
Also removed G.curscreen and G.edbo.

Not everything could get solved; here's some notes.
- modifiers now store current scene in ModifierData. This is not
  meant for permanent, but it can probably stick there until we
  cleaned the anim system and depsgraph to cope better with
  timing issues.
- Game engine G.scene should become an argument for staring it.
  Didn't solve this yet.
- Texture nodes should get scene cfra, but the current implementation
  is too tightly wrapped to do it easily.
2009-01-04 14:14:06 +00:00
Ton Roosendaal a6721c60d9 2.5
From the anti-globalization department: 
G.obedit terminated!

Wherever possible, use CTX_data_edit_object(C) to get this
now. It's stored in scene now, and the screen context has
it defined.
2009-01-02 19:10:35 +00:00
Brecht Van Lommel bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
Ken Hughes bc18e9e290 Suggestion by GSR; move "extern C" into header file, remove "_" from
utf8towchar function name.
2008-04-25 19:18:24 +00:00
Chris Want 5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Chris Want 5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
Ton Roosendaal c79966be52 Blenkernel for 2.5 project, changes mainly are because of disabling
bad level calls. (which is not finished at all)
2007-12-24 18:38:03 +00:00
Ton Roosendaal d7bee8c117 Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
   enables to control the entire animation system of the Group.

Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
   to override NLA/action of any Grouped Object.

For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.

Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.

Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.

-> Recoded entire duplicator system

The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.

By centralizing the code for duplicating, more options can be easier added.
Features to note:

- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too

Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.

-> Library System

- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.

-> Fixes

- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
  causing unnecessary slowdown on reading.

Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
Chris Want 902b11b84c An #include <wchar.h> was needed to ccoompile on OSX 2005-09-14 20:07:32 +00:00
Alexander Ewering 98bd4615b5 On behalf of Mika Saari, the famous Unicode Font support!
Further information is available here:

http://wiki.blender.org/bin/view.pl/Blenderdev/UnicodeFont3D

Shortlist of features:

- Unicode character support for Font3D
- UI to select characters from Unicode character list
- UI to select Unicode table areas
- Optimized character loading (Load only those characters which are used
  in font object)

Please test extensively if it breaks anything, try also loading/saving
files, packing fonts, etc.

The official text regression file in the regression suite should be a
good start.

Thanks to mikasaari for this very useful addition!
2005-09-14 14:02:21 +00:00
Alexander Ewering a07394ef2c More text object fancyness, and fixes:
- "Flush" is now split into two seperate Alignment modes "Flush" and
   "Justify":

   - Justify does exactly the same as a normal word processor's justify
     function does, and in addition, it uses *whitespace* instead of
     *character spacing* (kerning) to fill lines. Much more readable.

   - Flush is pretty much the old Blender "Flush" mode - and as such it
     uses character spacing to fill lines. Just as Justify, this only
     works with at least one textframe.

 - Underlining for text objects. Not a lot to explain. New button "U" in
   the editbuttons, and CTRL-U as hotkey toggle underlining for newly
   entered characters or for the selection, just like CTRL-B/CTRL-I do for
   bold/italic.

   Underline height (thickness) and Underline position (vertical) can be
   set in the editbuttons.

   Implemented as CU_POLY polygon curves.

 - The B, U and i buttons (and the corresponding CTRL-B/U/I keystrokes)
   have been fixed to only affect *one* attribute at a time. Formerly,
   hitting CTRL-B when no other style was active, on a text portion with
   italics text, for example, would kill the italics and just apply bold.

   Now, these attributes always add or substract only, but do not
   replace the style.

 - In the past, there were bugs with material indices uninitialized, and
   thus crashes in the renderer with illegal material indices.

   Even though I assume they have been fixed, I've put in a check that
   checks (hah) if the material index of a character is illegal (bigger
   than ob->totcol), and then sets it to zero, and spits out a warning
   on stderr.

   If you see such warnings, please report and link to the .blend.

 - Bugfix: All alignment modes only worked if there were at least *two*
   lines of text in the text object. Fixed


There's now a regression test file for text objects, please add to the
corresponding repository:

http://blender.instinctive.de/downloads/release/demo/text-regression.blend.gz
2005-08-29 12:46:07 +00:00
Daniel Dunbar 51fe322063 - add extern to selboxes variables declaration 2005-07-17 16:02:10 +00:00
Alexander Ewering 97df61a7e5 Initial commit for new text object.
Important notes:

 - Full compatibility with old text objects not fully restored
   (word spacing will be 0.0, need to set it manually to 1.0), will
   either need version upgrade to 238 or a hack. Will check.

 - lorem.c (about to be committed) contains BF copyright notice, but as
   BF did not exist a few hundred years ago, probably best to remove it :)

 - If you notice any cross-platform issues (especially beloved windows),
   please report

 - A few tiny warnings left, I will fix those issues still.

The rest has been said already - so have fun testing. And please do!

=== Reminder:
=== Documentation at http://blender.instinctive.de/docs/textobject.txt ===
2005-06-17 21:04:27 +00:00
Kent Mein f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
Kent Mein b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
Kent Mein 01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont 12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00