Campbell Barton
7c352ed43a
Cleanup: style + doxy
2015-08-19 08:49:12 +10:00
Campbell Barton
2e2dc9b9e3
Refactor translation code out of blenfont
...
- Add blentranslation `BLT_*` module.
- moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`).
- moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
2015-08-18 07:01:26 +10:00
Sergey Sharybin
dfc672f8bb
SCons: Fix for really nasty bug with polluting configuration environment
...
The issue was caused by the following construction:
def = env['SOMETHING']
defs.append('SOMETHING_MORE')
Since first assignment was actually referencing environment option it was totally
polluted hawing weird and wonderful side effects on all other areas of Blender.
2015-08-04 18:06:28 +02:00
Campbell Barton
c67abff7f0
Fix drawing text on >2gig buffers (stamp for eg)
2015-06-02 14:59:31 +10:00
Bastien Montagne
2d8880643d
Font Preview: fallback to default english strings in case translated ones have not enough chars in current font.
...
This avoids some ugly 'missing char' in previews - not all cases of course, but most common ones.
A complete solution would be much much more involved, and probably not worth it here.
Definitively not before a release, at least!
2015-06-01 19:42:56 +02:00
Campbell Barton
183b643774
Building without Python works again
2015-05-19 11:38:07 +10:00
Campbell Barton
57d9badc21
Cleanup: use bool /w flag checks
2015-04-21 01:50:20 +10:00
Campbell Barton
d1f9fcaabc
Cleanup: style
2015-04-13 22:08:51 +10:00
Bastien Montagne
f75bbe27e2
Thumbnails: Add translations to font preview.
...
Not much to say, this is pretty straightforward.
We just have to add current locale to thumbnails 'signature', so that
previews get re-generated when we change locale...
Tested with Japanese and French.
Btw, I do not really understand why using BLF in ImBuf is badlevel... :/
2015-04-10 15:34:31 +02:00
Bastien Montagne
8a99dc2324
BLF translation: fix BLF_lang_get(), add UI-agnostic BLF_translate/_do helpers.
...
BLF_lang_get() shall return 'default' Blender locale (en_US) when translations
are completely disabled!
Also, add BLF_translate() and BLF_translate_do() to allow translating some strings
outside of label/tip context, but still only when i18n global flag is enabled.
2015-04-10 15:34:31 +02:00
Campbell Barton
8c539b0ab5
Font preview for file browser
...
D1002 by @plasmasolutions , with own refactoring.
Note, needed to do a bad-level call here (IMB -> BLF)
Also can't use the BLF API directly because its not thread-safe.
So keep the function isolated (blf_thumbs.c).
2015-04-08 10:38:19 +10:00
Campbell Barton
c56c493cf4
BLF: use regular unsigned int's
...
So GL isnt needed to include BLF types.
2015-04-08 10:30:18 +10:00
Campbell Barton
a57b898d17
BLF: Fix clamping drawing into byte buffer
2015-04-08 09:55:01 +10:00
Campbell Barton
9510137d12
Cleanup: brace placement /w structs
2015-04-07 11:25:42 +10:00
Campbell Barton
4cbf2ebdc9
Cleanup: style
2015-02-06 13:55:20 +11:00
Sergey Sharybin
66eacc2abb
Fix for recent LANG locale workaround
...
Need to get a copy of the string since stored pointer is affected
by subsequent calls of setlocale().
2015-02-04 16:02:47 +05:00
Sergey Sharybin
701a7dcc87
Fix T43544: Runtime Error when Locale is not valid
...
This is not a real fix and only prevents crash, textures IO might be not
working totally correct if they're unicode path or so. Proper solution
would be to detect which locale we can use and set LANG, LC_ALL and friends.
2015-02-03 17:36:15 +05:00
Bastien Montagne
fca515838e
Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
...
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
Campbell Barton
f8c52402d6
BLF: remove paranoid checks for unset default font
2015-01-20 15:50:20 +11:00
Campbell Barton
bae5826b65
Fix T42069: Fonts /w non-ascii paths fail in win32
...
Workaround freetype's use of fopen by swapping FT_New_Face for our own version which uses BLI_fopen.
2015-01-12 18:30:11 +11:00
Bastien Montagne
090ab750b3
Fix missing UI ID messages and/or I18N contexts for MovieClip/Mask/Palette/PaintCurve ID types.
2014-12-15 11:53:35 +01:00
Bastien Montagne
2420a3c189
Fix T42797: -Werror=sign-conversion Triggered in blf_glyph.c
...
Very minor, but since it was reported...
2014-12-04 10:23:21 +01:00
Campbell Barton
915235c87a
Cleanup: unused headers
2014-11-28 22:16:14 +01:00
Campbell Barton
43fa4baa6c
Refactor: BLI_path_util (part 2)
...
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
2014-11-23 18:55:52 +01:00
Campbell Barton
6308c16675
Refactor: BLI_path_util (split out app directory access)
...
This module is intended for path manipulation functions
but had utility functions added to access various directories.
2014-11-23 18:42:18 +01:00
Campbell Barton
7d040d2a08
Cleanup: use BLI_listbase_*** prefix for count,sort,sort_r
2014-11-16 13:57:58 +01:00
Campbell Barton
a00b6d1271
Cleanup: (float)floor -> floorf
2014-10-10 00:24:34 +02:00
Jason Wilkins
8d084e8c8f
Ghost Context Refactor
...
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
Campbell Barton
f2821e392b
hint checks to re-alloc as unlikely
...
also edit comments for knife tool
2014-08-14 11:07:33 +10:00
Tamito Kajiyama
f0259d0a53
Fix for double freeing of MEM_guardedalloc'ed memory originating from BLF_lang_set().
2014-08-05 11:21:02 +09:00
Campbell Barton
1ae11f71ff
BLF: avoid float/int conversion drawing glyphs
...
also use UNLIKELY for error cases
2014-07-16 11:12:19 +10:00
Bastien Montagne
e3c8cf0a9e
Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
...
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs.
Reviewed by Campbell Barton, many thanks!
2014-07-04 14:14:06 +02:00
Campbell Barton
b96172cb05
UI: Add back ability to select a custom interface font
2014-06-14 02:32:38 +10:00
Campbell Barton
8bd4b7361b
BLF: use NONNULL & WARN_UNUSED_RESULT attrs & remove unneeded NULL check
2014-06-14 00:47:11 +10:00
Campbell Barton
4ca67869cc
Code cleanup: remove unused includes
...
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
Sergey Sharybin
8f2a7cde6d
Fix compilation error after recent BLF change
...
FT headers seems to be inconsistent here, FT_KERNING_UNFITTED
is defined as an enum element, but FT_Get_Kerning expects UInt.
Just case for now.
2014-04-11 13:56:26 +06:00
Campbell Barton
a15b3c4d11
Code cleanup: use bool
2014-04-11 11:33:29 +10:00
Campbell Barton
617557b08e
Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define
2014-04-01 15:22:28 +11:00
Campbell Barton
0319db1063
Correct own recent changes broke release builds
2014-03-30 20:35:59 +11:00
Campbell Barton
2097e621ed
Code cleanup: use r_ prefix for return args
2014-03-16 03:26:23 +11:00
Campbell Barton
20da9353b8
Code cleanup: unused/warnings
2014-02-17 11:34:12 +11:00
Campbell Barton
b3afbcab8f
ListBase API: add utility api funcs for clearing and checking empty
2014-02-08 06:24:05 +11:00
Campbell Barton
621bf47e91
Docs: doxygen file descriptions for BLF, GPU and WM
2014-01-19 23:15:25 +11:00
Campbell Barton
a780e7f3f0
BLF: Fix for changing the DPI storing many fonts (300+)
...
Each dpi value stores its own set of font sizes, so while dragging the
dpi value would collect many sizes and never free.
Also change how BLF_cache_clear works,
it was freeing memory but not the OpenGL textures.
Now just free all the cache and GL textures and let drawing allocate them again as needed.
2014-01-17 03:13:23 +11:00
Campbell Barton
7c6d52eb07
BLF: avoid allocating empty array in blf_glyph_cache_texture
2014-01-17 02:16:22 +11:00
Campbell Barton
6b283f1168
Fix for BLF using realloc() on guarded-alloced memory
2014-01-17 02:13:55 +11:00
Campbell Barton
d791e60687
Error in recent commit
2013-12-18 20:37:14 +11:00
Campbell Barton
d51dd92950
BLF: debug function to print a fonts state
2013-12-18 19:33:05 +11:00
Campbell Barton
d9e42cf43e
Style Cleanup: minor edits in recent changes
2013-12-18 15:35:31 +11:00
Campbell Barton
ce3f42e16a
BLF API: Add BLF_width_to_strlen,rstrlen gives a byte offset from a string width
2013-12-16 22:00:30 +11:00