Age | Commit message (Collapse) | Author |
|
A couple of new functions:
BLF_width_and_height - Merge of BLF_width and BLF_height in one call to avoid freetype2 stuff.
BLF_buffer - Set the buffer, size and number of channel.
BLF_buffer_col - Set the text color (the alpha is not used right now).
BLF_draw_buffer - Draw the text in the current buffer.
Also tweak a little the boundbox and draw function to avoid access the freetype2 and use the cache info.
By default the font size is 12, the UI still need work to allow change the font and size.
|
|
As Joe point on a previous mail, glBitmap don't work nice
on all cards and also some of the things that we can do
with texture are hard (or need that blender check the font mode)
to implement.
|
|
also fixed smoke comparing a float's mem-location rather then its value.
|
|
* Text window font size now supports full range 8-32, instead of
just 12 and 15. I added BLF_fixed_width to get the character
width of a fixed size font.
* Buttons do undo push on change again.
* Animated/Keyframe/Driver colors are now themable, with blend
value to blend with original color. Set this to 0.5 now to
give colors less constrast.
* Fix tooltip popping up with RMB menu open, and missing redraw.
* Autokeyframe now works for buttons.
* Driver expressions can be edited in place in a button now.
(still some refresh issues).
* Also made python driver default for the Add Driver function
in the RMB button. This way you don't have to open a Graph
editor if you just want to type an expression. Also, the
default expression then is the current value.
* Tooltips now show some extra info, not sure what is good to
have, but currently I added:
* Shortcut key for operator buttons.
* Python struct & property name for RNA buttons.
* Expression for driven values.
* Value for text/search/pointer buttons.
|
|
This are freetype2 options:
Unfitted - Scaled but un-grid-fitted kerning distances
Default - Scaled and grid-fitted kerning distances
We always use Unfitted, but the "Default" style give better result here,
so please test and if nobody complain we can set this style as the default.
|
|
Matt, I found the problem in one of my previous commit, so I revert
all my changes and now the font look good again.
Also remove all the options (kerning, overlap and user kerning), I want
to make this a little better.
|
|
Cleanup of scroller drawing in 2D windows.
Before:
http://download.blender.org/institute/rt11.jpg
After:
http://download.blender.org/institute/rt12.jpg
Will add 'zoom' widget circles later, as mockupped here:
http://www.reynish.com/files/blender25/fcurve_scrollbar.png
Also note the scale values are inside scroller; drawing it
on top conflicts with current frame item and markers.
Currently scroller disappear entirely when view is total.
For Joshua:
To make sliders behave nicely, the boundbox (v2d->tot) has to
be refreshed on each change. I've added it in graph drawing
now, but it could be notifier based I guess... not sure what
the correct anim api call would be. Can discuss tomorrow!
On todo:
Layout config hints so people can make scroller positions swap.
|
|
If this option is enable, the blenfont check for overlap characters, like
one of my previous commit but now it's optional and disable by default.
(This fix the "Fi" or other case when the characters are too close)
Enable/disable from:
Outliner -> User Preferences -> Styles -> Panel Font -> Overlap
(also for other styles, Group Label, Widget, Widget Label)
|
|
Two new function:
BLF_shadow: set the level (for blur) and the shadow color.
BLF_shadow_offset: set the x and y offset for shadow.
(this is the current position plus offset)
By default shadow is not enable in the font, so before draw the
text you need call BLF_enable(BLF_SHADOW), also remember disable
the option in the end.
|
|
0.5 is the default value now, the range are from -5.0 to 5.0.
Note that we allow negative value, but the current draw code
always check for overlap characters.
|
|
This commit add two option to the blenfont library:
1) BLF_FONT_KERNING
This enable the kerning information that come with the
font, by default this option is disable and still don't
have a UI for change.
2) BLF USER_KERNING
This allow the user set a kerning value to by apply for
every character, by default this option is enable but all
the font have a kerning value of zero.
Ton I add this option to the style with a default value of 1.
Access from:
Outliner -> User Preferences -> Style -> FontStyle -> Kerning
|
|
Fonts like Type 1, have one file with the glyph image and another
file with metrics and kerning information, this try to search if the font
have this information and load (try open the same file but with the .afm
and .pfm extension).
Also add a function to load the same information from memory, just in case
that in some point we add a font like this.
|
|
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)
|
|
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).
|
|
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.
|
|
The library can load any font supported by the Freetype2 library or
used the internal bitmap font.
With both types it's possible draw the text as texture or bitmap,
and using texture it's possible rotate, scale and clipping text.
Still have things to fix/add, but I think it's ready to move-on
and start droping the old api, most of (if it's not all) the
editors/interface/text.c will be remove, but some things still
has to be define, like:
* Where is store the fonts ? (default font, panel font, filesel font, etc)
I mean, every space have own fonts ? or we keep it on the context ?
It's not a really problem from the blenfont side, because every font
have reference number, so it's load only the first time.
* What we do about gettext ?
Keep the old system that call gettext inside the blenfont or replace
it for _() in the Blender source ?
Also things like pupmen has to be take care, if we want translate the menu.
Ok, time to sleep, back tomorrow to start moving the things :)
|
|
freetype2.
|
|
This is the old bmfont library but using textures.
I made small test in the space Info and work fine,
commit now to finish tomorrow from work.
|
|
|
|
There was very little structure in this code, using many globals
and duplicated code. Now it should be better structured. Most
things should work, the main parts that are not back yet are the
python plugins and markers. Notes:
* Blenfont is used for drawing the text, nicely anti-aliased.
* A monospace truetype font was added, since that is needed for
the text editor. It's Bitstream Vera Sans Mono. This is the
default gnome terminal font, but it doesn't fit entirely well
with the other font I think, can be changed easily of course.
* Clipboard copy/cut/paste now always uses the system clipboard,
the code for the own cut buffer was removed.
* The interface buttons should support copy/cut/paste again now
as well.
* WM_clipboard_text_get/WM_clipboard_text_set were added to the
windowmanager code.
* Find panel is now a kind of second header, instead of a panel.
This needs especially a way to start editing the text field
immediately on open still.
* Operators are independent of the actual space when possible,
was a bit of puzzling but got it solved nice with notifiers,
and some lazy init for syntax highlight in the drawing code.
* RNA was created for the text editor space and used for buttons.
* Operators:
* New, Open, Reload, Save, Save As, Make Internal
* Run Script, Refresh Pyconstraints
* Copy, Cut, Paste
* Convert Whitespace, Uncomment, Comment, Indent, Unindent
* Line Break, Insert
* Next Marker, Previous Marker, Clear All Markers, Mark All
* Select Line, Select All
* Jump, Move, Move Select, Delete, Toggle Overwrite
* Scroll, Scroll Bar, Set Cursor, Line Number
* Find and Replace, Find, Replace, Find Set Selected,
Replace Set Selected
* To 3D Object
* Resolve Conflict
|
|
function for aspect and rotation (and the new clipping).
Update source/Makefile to point to the new libed_sculpt_paint.
|
|
The rotation is through glRotatef and as you can see it's ugly,
the freetype2 allow apply a transformation (2x2 mat) to the glyph
before load, so I want to try using that.
Another thing to add is the 4x4 mat to get the scale and size from
there.. but I need commit this now to continue from my home.
|
|
I change the #if 0 with #if WITH_FREETYPE2, also fix a lot of typos, etc.
This is the basic but now it draw text!!, I am using the "User Preference"
space to test the library, nobody is working on that and the option are
in the outliner now so...
TODO-next: using the 4x4 mat, string size, bounding box, aspect and rotate.
Notes: I update the Makefile, missing some include and other things so
maybe scons, cmake and msvc also need update ?
|
|
All the code have #if 0 / #endif so nothing to worry about.
|
|
I go to start commit the new code here and then replace one
by one bmfont and ftfont, this do nothing right now, but it's
more easy keep the files here to work from the studio and my home.
I only update the Makefile and SConscript (but JesterKing a double
check never is bad), so please check the msvc and cmake files.
The new library is libblenfont.a
|