Age | Commit message (Collapse) | Author |
|
|
|
else if's
|
|
|
|
|
|
|
|
- Mipmaps are generated in BLF when drawing text in-game. In that case, padding around each glyph is increased to prevent bleeding.
- Texture filtering is turned on for in-game text.
- All glyphs are now "twisted": the leading edge is brought a small distance forward, to prevent z-fighting in overlapping (kerned) glyphs. This happens both in the game engine and the rest of the UI, but should have no effect in the UI due to Z-compression in the clipping matrix.
Reviewed and approved by bdiego; see patch [#29882] in the tracker. Tested by dfelinto.
|
|
As Campbell point, this is to avoid call glGet/glTexEnvi
on each character.
|
|
[#25834] no color of textobjects in game engine when combined with
textured objects
[#26893] Curruption of displayed text (debug properties/fps info or bgui)
when using animated/tile uv mode
The first bug was beacuse a bad mode on the texture environment, now
we save the current glTexEnvi, set the one that we need, draw and
restore the original at the end.
The second was because a missing call to glLoadIdentity for the
texture matrix and as we do before, now we do a gl-Push/Identity/Pop
for this matrix to.
The first problem was solved by Kanttori and the second by Dalai.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
when toggling use antialising user preference. Also fix some other use of
uninitialized memory found by valgrind.
|
|
|
|
glGetIntegerv(GL_TEXTURE_2D_BINDING_EXT, &cur_tex);
... with shadow enabled glGetFloatv(GL_CURRENT_COLOR, color) was called twice per character as well.
Now only call glGetFloatv(GL_CURRENT_COLOR, ...) once per string and only when drawing with shadow or blur, texture bind is stored in the font.
Gives 8% overall FPS speedup when displaying heavy UI in my test.
|
|
|
|
ASCII lookup table wasn't being freed when when the rest of the glyphs were.
Also found own bug where mesh stat text was using wrong sized array (char[3] as char[4]).
|
|
|
|
|
|
Remove the XXX code from blf_glyph.c and use the pointer
inside the FontBLF struct.
If still have problem, let me know.
|
|
User Preferences
Using "no AA font" crashed, caused by commit to make static variables.
However, how this was ever meant to work... using such globals has to be
treated carefully. Fixed for now with XXX warning for Diego :)
Thanks to reporter Susanne H. to point at the right code!
|
|
|
|
python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
|
|
(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
|
|
If still fails, check & update Freetype (OS one or Blender's lib/).
|
|
>> Compile failure on windows platform (see ML for Errors).
SVN Revert of Revisions: 32805, 32804 and 32802
|
|
|
|
"Configuration" by recompilation for now (feel free to code that).
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
The option of Texture or Bitmap font is working again, yes it's really
uuuuugly right now, but it work.
On the next commit I go to put this at the same level that texture font.
Change this from User Preferences -> Language -> Textued Fonts, save
the preferences and run blender again.
|
|
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.
|
|
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.
|
|
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
|
|
Now that we only work with Freetype2, I don't see any point to keep
wrapping the functions.
Also remove the reference code, it's something that we don't go to used.
|
|
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).
|
|
space_info.c
|
|
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 :)
|
|
|
|
function for aspect and rotation (and the new clipping).
Update source/Makefile to point to the new libed_sculpt_paint.
|
|
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 ?
|
|
Also I remove some of the #if 0.
|
|
All the code have #if 0 / #endif so nothing to worry about.
|