Age | Commit message (Collapse) | Author |
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
|
|
- Move all translation-related declarations to BLF_translation.h
- Reverted some changes to match trunk svn rev40365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
failure bugs
|
|
|
|
|
|
|
|
|
|
Copy unifont..ttf.gz from source tree to target datafile path( now ONLY works with cmake );
Set the locale the same with system's setting;
If need unicode font, unzip and load unifont when init ui styles;
Apply gettext() to labels in space_info.py, who are the main menu items.
Each of these should have been commit one by one. As they work well according to my tests, so I just lazily send a long list.
|
|
|
|
- BLF_height_max
- BLF_width_max
- BLF_descender
- BLF_ascender
use for tooltip and image stamp.
|
|
|
|
|
|
|
|
|
|
This is need to properly handle 3d text (dalai work on GE), before
the BLF_aspect only take one argument, and the result was a call to:
glScalef(aspect, aspect, 1.0)
Now the three value are store in the font (x, y and z) and also
need to be enable using BLF_enable(BLF_ASPECT).
By default all the code that don't have BLF_ASPECT enable work with
a scale of 1.0 (so nothing change to the current UI).
I also remove all the call of BLF_aspect(fontid, 1.0) found in
the editors, because is disable by default, so no need any more.
Campbell the only thing to check is the python api, right now
I modify the api to from:
BLF_aspect(fontid, aspect)
to:
BLF_aspect(fontid, aspect, aspect, 1.0)
This is to avoid break the api, but now you need add the BLF_ASPECT
option to the function py_blf_enable and in some point change
py_blf_aspect to take 3 arguments.
|
|
This option allow the user to set a 4x4 matrix to be
multiplied before draw the text, for example:
double *m;
/* Get the matrix or build it! */
BLF_matrix(m);
BLF_enable(BLF_MATRIX);
/* set color, size, etc and draw! */
BLF_disable(BLF_MATRIX);
You don't need the last line (disable), but remember
that if you use the font to draw in any other place,
the matrix will be used!.
The GL code is:
glPushMatrix();
glMultMatrixd(m);
glTranslatef();
glScalef();
glRotatef();
glPopMatrix();
Let's Dalai test this!!! :D
|
|
(userpref->system), with a great help from brecht (its been way too long
for me).
However as brecht pointed out that the non-AA text is slightly lareger
then AA'ed Text :S, i did not do anything about this as this commit was
just the option not the text drawing.
this commit also makes it possible to do all kinds of UI textrender options
|
|
loading the same font 3 times.
need to load twice still because render may use the font in a thread.
|
|
|
|
doenst need to swap in NULL chars to draw word wrapping.
|
|
particle display.
- ascii text drawing functions, slightly faster since they dont have to do hash lookups & utf8 conversions for each char.
- used ascii drawing functions for the view3d's number display.
- each text item was using fixed 128 chars, now only allocate the string length needed.
|
|
removed last beos reference :)
|
|
[#20854] PROPERTIES STAMP: Rendering stamp flickers in output renders
Blenfont was not thread safe, that is why one thread can change
the font properties (size, dpi, color, etc) at the same time
that the stamp draw on the image, and then the problem.
To make blenfont thread safe I have to change two important things:
1) Every BLF_* function take one argument, the font id.
2) We have two new function to make font "thread safe":
BLF_load_unique
BLF_load_mem_unique
This two function are for case like stamp, that need and own font
that don't share the glyph cache, so can draw without problem
in a different thread.
Why the BLF_*_unique function ?
Because blenfont keep only one copy of a font and keep a list of
"glyph cache". Every glyph cache have size and dpi, so if two
different thread access the same font at the same time, they can
change value and finish with something like the stamp problem.
Why don't remove the glyph cache ?
Because if we do that, we finish with a font object for every size
and dpi, and the stamp is really a special case that happen in
the rendering process, so I really thing is better keep the
glyph cache and make this two new function to handle this
special case.
(When I say "font object" I mean have the same freetype font multiple
times just to have differents size and dpi)
As Matt point we still can have one case that two thread access
the BLF_*_unique function at the same time, but I am looking to
fix this with some class of thread lock.
For now I test and work fine, so if some one found problem, please
let me know.
Campbell I have to change the python api (python/generic/blf_api.c)
to the new syntax, so maybe you can take a look at this.
|
|
|
|
|
|
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.
|