Commit Graph

12 Commits

Author SHA1 Message Date
a117731aa2 2.5
- Fix: text draw in fonts was slightly too low; it didn't calculate offset
  correctly. Now it is aligned to have number characters in center.

- Fix: text clip was too wide, giving errors on extreme zoom in.

- Added boundbox-clipped default text drawing for view2d:

  void UI_view2d_text_cache_rectf(View2D *v2d, rctf *rect, char *str)

  (Note; also for previous commit, this cache immediately projects, so if
   you change view2d while drawing, text is still on correct positions)
2009-06-01 17:21:03 +00:00
2e91f1b155 Assorted UI tweaks/cleanups 2009-05-20 13:56:22 +00:00
b4d46e5ded UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
  This means the layout engine now works at button level, and makes it
  easier to write templates. Otherwise you had to store all info and
  create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
  These can contain regular buttons, and can be put in a Free layout,
  which means you can specify manual coordinates, but still get nested
  correct inside other layouts.

* API was changed to allow better nesting. Previously items were added
  in the last added layout specifier, i.e. one level up in the layout
  hierarchy. This doesn't work well in always, so now when creating things
  like rows or columns it always returns a layout which you have to add
  the items in. All py scripts were updated to follow this.

* Computing the layout now goes in two passes, first estimating the
  required width/height of all nested layouts, and then in the second
  pass using the results of that to decide on the actual locations.

* Enum and array buttons now follow the direction of the layout, i.e.
  they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
  RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
  opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
  row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
  buttons).

* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
405cf80eb8 Big, big commit!!
1) Remove WITH_FREETYPE2 from code, so now blender always need freetype2
2) Remove the old bmfont
3) Remove ftfont and bFTGL library
4) Implement a new BLF_draw_default function for place that still need/use
   the old BMF api.

I try to update both, scons and cmake, but I only can test with make, so
hope all work fine.

MSVC is broken, but I don't have Windows, things to search and fix are
any reference to WITH_FREETYPE2, FTGL and BMFONT (take in care that
blenkernel also have a BKE_bmfont.h, this don't have anything to do with bmfont).
        Always have to link/include the freetype2 library
        Remove any reference to libbmfont
        Remove any reference to libftfont
        Remove any reference to libbftgl (or libbFTGL)
2009-05-05 23:10:32 +00:00
3ee6c11e31 2.5
Two fixes:

- objects in editmode now update data on saving .blend
- uifonts and uistyles were not freed yet on reading files
  yet.
2009-04-30 16:44:00 +00:00
58cdd37f52 UI:
* Made separator item work horizontal & vertical.
* Add colon (:) automatic for int/float/enum/string.
* Added space variables to uiStyle and use them in the
  layout engine.

* Added initial World buttons by Thomas Dinges, thanks!
* Added some code for modifiers in the Object Data context.
  This will become a template though.
* Use a common poll() callback in the scripts to reduce code.
2009-04-27 18:05:58 +00:00
efd1a69d6c Move texture draw to blf_util.c, now both font used it.
A little cleanup on the internal font, it's possible load the old
bmfont with: BLF_load_mem(name, NULL, 0) where name can be: helv,
helvb or scr.

Note that the internal font also support both draw, texture and bitmap,
by default always used texture.

Remove some old lang function that I left there and don't exist any more
because the locale are now in the RNA.

Small changes to Style's, so if we build without freetype2 by default
go back to the internal font, this is a little ugly (and have the old
problem of scale) but now blender always show text (need work a little
more there).
2009-04-23 21:57:41 +00:00
ad164a5261 2.5
Fixed & upgraded tooltips to new drawing system.
Also fixed small error in menu shadows. Rounding of shadow below
menu went wrong.
2009-04-15 14:43:54 +00:00
4e81404d7e 2.5
Grand cleanup: 
- removal of FTF and ftfont dir
- removal of text.c which wrapped it
- wrapped old text drawing code temporarily, need to decide how 'style'
  will behave per editor when you draw strings outside interface code.... 
  wouldn't be very useful to set fonts locally all over?
2009-04-10 16:30:28 +00:00
6124933781 2.5
Nicer implementation of blurred font draw, moved to blenfont
module. Set it with BLF_blur(value). Current kernels implemented
are 3 and 5 only. Blenfont module can extend this once.
2009-04-10 14:27:29 +00:00
d2cc19dcc6 2.5
More font style work;

- hooked up almost all ui buttons code to new font
  system, including text clipping
- panel headers scale now too to smaller fonts
- added further style hints, for shadow/emboss. Is all going to
  be in UI designer control!
- for fun; changed layout engine to spread vertical buttons in
  window width

Next: removal of all usage of old font system, using 'styles'.
Will also move font blurring to blenfont module.
2009-04-10 14:06:24 +00:00
79c30a0752 2.5
WIP commit for UI drawing.

- Hooked up Diego's new Font API
- Added Style definitions for fonts, currently it uses
  a different font for panel titles to show it.
- Styles are in Userdef now too, still not finished 
- Userdef "DPI" will offer global control over font size,
  to match monitor size/resolution. It's meant to scale
  widgets and headers too btw, later.
- Lots of code removed for old fonts, but that's unfinished.

On todo: too much to mention, will continue happily tomorrow!
2009-04-09 18:11:18 +00:00