Commit Graph

66 Commits

Author SHA1 Message Date
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
ac166d5eb6 Fix for MSVC. 2011-09-27 19:04:27 +00:00
3bcbefa558 minor changes to interface code (no functional changes)
- made 2 loops on menu items break out of the loop when the item is found.
- include function names in error prints.
2011-09-27 17:04:38 +00:00
fbdfdfefd8 use BLI_snprintf rather than sprintf for interface functions 2011-09-26 16:53:04 +00:00
573ed73be8 change define INTERNATIONAL --> WITH_INTERNATIONAL
also rename backface_culling --> use_backface_culling (which is used elsewhere in rna)
2011-09-26 10:35:47 +00:00
ae0124157f Translation: reload font on enabling/disabling use international fonts. 2011-09-21 15:15:30 +00:00
6d125e159d i18n: code clean-up
- Move all translation-related declarations to BLF_translation.h
- Reverted some changes to match trunk svn rev40365
2011-09-20 07:39:25 +00:00
66a679d71f i18n: replace gnu unifont with droid sans font
- Static variables can be initialized with constants only.
- Removed bunifont.ttf.c from datafiles -- it's not actually a
  data file. Unicode font loading stuff is not in blenkernel/font.c
- Allocate as much memory for unzipped data as it's needed.
  Default read chunk is 512Kb.
- Fixed regression (or just a typo) in setting utf locale.
- Default locale set to en_US:en works fine now.
- Commented put Nepali language in user preferences -- it's
  not supported by current droid font and imo it's better to
  have nice font for languages we actually have translation for
  rather than allowing to choose more languages in user preferences.
2011-09-17 20:50:22 +00:00
Xiao Xiangquan
465c3b82fa merge with trunk r39216 2011-08-10 14:32:03 +00:00
dc4dede802 for UI text drawing use BLF_ascender(fs->uifont_id) rather then BLF_height(fs->uifont_id, "2"), while profiling draw noticed that the hash lookup on the character and utf8 next were being called on every text draw, use BLF_ascender since it doesn't do any lookups. 2011-08-06 06:38:18 +00:00
Xiao Xiangquan
287b24926f merge with trunk r38787 2011-07-29 17:42:53 +00:00
Xiao Xiangquan
08645d9293 switch language in User Preference's System page. with some known switch failure bugs 2011-07-22 14:14:28 +00:00
Xiao Xiangquan
77926a7f9d select uiStyle according to UserDef and update lang-packs 2011-07-16 18:28:24 +00:00
Xiao Xiangquan
fa46278e34 merge from trunk 38379 2011-07-14 17:29:53 +00:00
05fb0e2d61 First commit to make "Style" settings saved in startup.blend
Usage currently is limited to:
- Panel text, widget text and label text style:
  point size, shadow effects

Setting individual fonts to these is not possible yet, it uses the
default for it.

Access goes via outliner now; check "User Preferences". UI team could
add this in userpref scripts :)
2011-06-24 14:00:15 +00:00
Xiao Xiangquan
9a2f36b50f handle SpaceType and UserPref popups 2011-06-20 10:07:46 +00:00
Xiao Xiangquan
a40e1302ae Almost complete the i18n system, including:
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.
2011-06-02 11:22:22 +00:00
a41c0c324a fix [#26937] Radio button text truncation should start at beginning of string
ensure start of text is always visible.

- also left in test for fix [#26933] which left it broken.
- quiet warning in AUD Py API.
2011-04-15 01:32:37 +00:00
e124c47713 Fix #26653: changed DPI setting in user preferences is not saved as default.
Clamping on load did not match RNA property min/max.
2011-03-29 14:39:39 +00:00
Nathan Letwory
95100afc12 doxygen: blender/editors tagged. 2011-02-27 20:29:51 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
35f431b3d0 Menu UI feature common in other widget sets:
Automatically assign menu keys based on name, alternative to pressing number 0-9 on menus items.

 keys are assigned by first giving each menu item the first character of any word, if that fails any key in the name is used.

- active key is shown underlined.
- only ascii keys are assigned currently.
- can run operators, open menu items.
- currently this only works in cases where number buttons were used (UI_BLOCK_NUMSELECT), but could be enabled for file menu, splash etc by removing this check.
2010-12-14 02:38:29 +00:00
545cc4803e Change the BLF_aspect function to handle 3d text.
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.
2010-12-09 22:27:55 +00:00
263830f000 Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
cfd3b11630 fix building blenderplayer and a divide by zero bug with the console view. 2010-11-26 17:07:31 +00:00
cf0820d628 change monospace font to be an extern, not good final design but better then loading the same font 3 times.
need to load twice still because render may use the font in a thread.
2010-11-26 16:33:42 +00:00
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
80a650dfb1 BLF_draw functions take an extra length argument, so the console drawing doenst need to swap in NULL chars to draw word wrapping. 2010-11-11 06:35:45 +00:00
4741dd26d3 Enabled kerning for the default UI font for the places that are using UI_DrawString still and for filebrowser.
Makes text more readable :)
2010-11-07 18:01:32 +00:00
d1759639dc - remove unused includes IMB_*, BIF_* & MEM_*
- remove MEM_guardedalloc.h from header files (include directly)
2010-08-16 05:46:10 +00:00
8c455e1da8 remove unused includes 2010-08-08 08:33:47 +00:00
5daf9354d2 change some references to .B.blend, .Blog to new names 2010-07-15 11:51:43 +00:00
a56b72fd82 BugFix:
[#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.
2010-04-22 10:56:45 +00:00
5d155868fb Fix [#21694] text input box last character not editable
Font kerning needs to be set in order to get accurate results out of BLF_width(). 
Would be nice if this was more automatic, I've added it to a few other places that 
seem like they need this though it's a little unclear due to the globals etc. Also 
some other minor tweaks when editing text fields.
2010-04-02 11:15:37 +00:00
f743b583bf more lint includes
Only source/blender/editors/ dir, should not give errors on different platforms
Only removing:  UI_*.h, ED_*.h, WM_*.h, DNA_*.h, IMB_*.h, RNA_*.h, PIL_*.h
2010-03-23 14:09:09 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
38aacb92f3 Cleaned up some printfs in editors/ - converted some to reports, hid others behind G_DEBUG. 2010-01-22 06:48:29 +00:00
37e4a311b0 Math Lib
* Convert all code to use new functions.
* Branch maintainers may want to skip this commit, and run this
  conversion script instead, if they use a lot of math functions
  in new code:
  http://www.pasteall.org/9052/python
2009-11-10 20:43:45 +00:00
ed032e13f2 Patch #19034: (2.5) Display titles of closed panels in horizontal mode
This patch was one of the patches submitted by Wolfgang W. (bender) (the others have already been committed). In the patch, there was commented out code for counter-clockwise rotation of the text, but I've removed that.

--

In this commit, I've also removed all of the panel tabbing code instead of merely commenting it out.
2009-10-19 03:54:30 +00:00
74b3681532 Remove bitmap mode from blenfont, only draw with textures.
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.
2009-08-06 20:06:02 +00:00
9ae77b0eff UI tweaks
-Removed shadows from most UI items. The shadow settings are unfortunately not really useful, because you can't set them for individual items. There was a lot of black text with black shadows, which really only makes the text look fuzzy. For shadows to improve clarity, they should be the opposite color of the text label, not the same color.

-Tweaked material layout, with clearer grouping in Ray Mirror and Ray Transparency panels.

-Added icons in the texture type menu to signify which textures are procedural and which ones are images, and plugins.
2009-08-03 10:54:02 +00:00
4ad9dd7c8e Bitmap mode is back.
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.
2009-07-28 20:02:09 +00:00
0bb50594f9 2.5: UI
* Fix issue where it would automatically scroll when collapsing panels.
* Fix panel dragging not taking zoom level into account.
* Fix enum menu having too small default width in headers.
* Fix tooltips not showing shortcuts etc. if there was not tooltip
  defined for the button.
* Fix some refresh issues with color ramps.

* Add a bit more space between columns in the layout engine.
* Make scrollers darker so they are less distracting, and highlight
  instead of reverse shading when dragging.
2009-07-23 20:50:24 +00:00
a78ef19054 2.5: UI
* List template visual changes. Items now look different,
  and it expands to size 5 as more items are added.

* Added LISTROW and LISTBOX elements. The former is like
  a typical ROW button, but looks diffrent. The latter
  looks like a BOUNDBOX, and has no extra features yet.
* Fix some glColor3ubv warnings with casting, did not find
  a nicer way.
2009-07-21 01:26:17 +00:00
7c2fb42195 2.5: Defaults
* Wave modifier speed 0.5 -> 0.25.

* Particles even and random distribution on.
* Particles normal velocity 0.0 -> 1.0.
* Particles size 1.0 -> 0.05.
* Particles draw emitter and material color on.

* Field strength 0.0 -> 1.0

* Object drawing without material was not consistent
  with default material.

* Panel title 13 -> 12 points.
2009-07-15 22:58:12 +00:00
b80b581bc0 Allow the user set which style to use for the kerning value.
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.
2009-07-10 22:16:25 +00:00
395025d67e 2.5:
* Default panel zoom level user preference, when creating
  new button windows or pressing home-key to reset. Patch
  by Matt D., thanks!
2009-07-10 20:43:32 +00:00
ad59d04c77 Yes!! a nice font 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.
2009-07-10 20:18:19 +00:00
483e9479f7 New Style option: Overlap
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)
2009-06-23 18:26:01 +00:00
cb59bf722e Move shadow option (for text) from editor/interface to blenfont.
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.
2009-06-23 16:27:35 +00:00