Commit Graph

374 Commits

Author SHA1 Message Date
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
Campbell Barton 1815225faa Blender Font (BLF): add length argument to string width/height functions
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-12-02 21:10:07 +11:00
Diego Borghetti 4c4aeaa546 Fix: Wrong variable used to check for metrics files on BLF
Looks like this is has been there since the initial commit
of BLF.

The blf_dir_metrics_search was using the pointer to the
extension of the file and not the full path to check for
metrics files (.afm/.pfm).

Never notice before probably because is not common to use a font
with additional metrics files.
2013-11-23 20:20:23 -03:00
Campbell Barton 774987a381 use assert to check for incorrect use of BLF_draw_ascii() 2013-11-08 15:01:43 +00:00
Joshua Leung 7176cbf466 Mingw Compiling Fix - Conversion from int to unsigned char...
Apparently mingw/gcc is too stupid to recognise that the values
in alphatest will only be used if they're within the range of 
unsigned char (i.e. 0 <= x < 255) when this is done using a ternary
operator. Then again, it's quite hard for humans to immediately
parse what is going on here either! Converting this clever code
back to a more obvious form that mere mortals (and compilers it 
seems) can handle with ease ;)
2013-09-01 05:36:29 +00:00
Campbell Barton 2924a02a35 move strict compiler checks into a header so its easier to manage in one place (pragmas were copied around).
also enable more strict warnings for BLF (which had some incorrect casts).
2013-09-01 00:46:04 +00:00
Campbell Barton 8ef934c73f ghash/bli-listbase edits, rename BLI_ghash_pop -> BLI_ghash_popkey (since it takes a key as an arg and isnt popping any element from the hash as you might expect).
add BLI_pophead/tail, since getting the first element from a list and removing it is a common task.
2013-08-26 23:37:08 +00:00
Campbell Barton 98c574e41a use 'greater/less then or equal to' operators rather then adding 1. 2013-08-11 05:40:35 +00:00
Campbell Barton f97a4bd254 code cleanup: more zero as NULL pointers. 2013-08-07 03:36:05 +00:00
Campbell Barton b7396654e1 fix for bad NULL check in bmo_connect_pair, also remove duplicate checks in if statements and redundant initialization vars. 2013-07-13 16:25:47 +00:00
Brecht Van Lommel 07f4465c77 Fix scons/windows build error, missing pthreads include in blenfont for mutex. 2013-06-29 10:52:18 +00:00
Brecht Van Lommel 0d7dbbb6e1 Fix #35884: crash opening .blend with generated color grid image and preview render.
Printing text on the color grid image would initialize font glyphs from a thread at
the same time as the UI, causing conflicts. The freetype glyph renderer needs to be
mutex locked because it uses a shared buffer internally even when rendering for
different fonts. Also needed to change the image generate function to use the render
monospace font to avoid conflicts in blenfont.

What's still weak in the blenfont API is that there is no distinction between a font
and a thread using that font to render with some particular size, style, etc.
2013-06-28 13:05:15 +00:00
Brecht Van Lommel 2df82a2a2b Code cleanup: fix some vs2012 compiler warnings 2013-06-21 12:33:19 +00:00
Campbell Barton 9b5be450d8 text rendering: shadow offset was causing text to clip, now check for clipping without the shadow since not-drawing characters because of subtle effect is rather annoying. 2013-06-06 21:43:52 +00:00
Campbell Barton 225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00