Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-05-03BLF: use 'int' for internal glyph x,y bearingCampbell Barton
These were stored as float but were originally cast from an int and were often cast back to int. Also use int pairs for dimensions values.
2020-05-03BLF: add new arguments to BLF_GlyphBoundsFnCampbell Barton
- glyph_bounds: to get the character width. - glyph_bearing: lower left character starting point. These values are needed for more precise glyph calculations.
2020-04-28BLF: add utility function to loop over glyph boundsCampbell Barton
2019-09-14BLF: make library glyph cache handling thread-safeRichard Antalik
Functions that utilize glyph cache should lock and unlock cache by calling `blf_glyph_cache_acquire()` and `blf_glyph_cache_release()`. Function `blf_glyph_cache_acquire()` will create glyph cache, if it doesn't exist. Locking mutex is global and shared by all fonts. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5701
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-06-01Merge branch 'master' into blender2.8Campbell Barton
2018-06-01Cleanup: trailing whitespace (comment blocks)Campbell Barton
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-03-31BLF: Perf: Add a kerning cache table for ascii chars.Clément Foucault
This adds less than a megabyte of mem usage. FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly remove this cost. One concern though: I don't know if the kerning data is constant for every sizes but it seems to be the case. I tested different fonts at different dpi scalling and saw no differences.
2018-03-31Cleanup: BLF batch drawing namingCampbell Barton
- batching -> batch_draw. - ct & size -> len. - start/end -> begin/end (follow GL convention).
2018-03-30BLF: Use Batch API instead of IMM.Clément Foucault
This is not a perfect win just yet. It's now calling glBufferSubData for every call (instead of using glMapBufferRange which is almost faster), but with this system we will be able to batch drawcalls together. See next commit.
2016-10-11BLF/OpenGL: draw text with new immediate modeMike Erwin
Part of T49043
2015-10-03Fix Broken Font Preview (reported over IRC by kopias, thanks).Bastien Montagne
Broken by font wrap commit rBf2341f829654c4dc97, there was actually two things here: * Using non-initialized color (which lead to transparent drawing...), we need to use new `blf_draw_buffer__start/end` helpers here too, made them shared internally. * Using `draw_str_i18n_nbr` as `draw_str[i]` length, ugh! That's the number of utf8 glyphs of translated string, not the length of untranslated string! This fix must be backported to final 2.76.
2015-09-18BLF: initial word-wrap supportCampbell Barton
- Adds support for word wrapping to Blender's BLF font library. - Splits lines when width limit is reached or on explicit \n newlines. Details: - Word wrapping is used when `BLF_WORD_WRAP` flag is enabled. - There is a single loop to handle line wrapping, this runs callback, passing in a substring, this way we can avoid code-duplication for all word-wrapped versions of functions... OR... avoid having to add support for word-wrapping directly into each function. - The `ResultBLF` struct was added to be able to get the number of wrapped lines, when calling otherwise unrelated functions such as `BLF_draw/BLF_width/BLF_boundbox`, which can be passed as the last argument to `BLF_*_ex()` functions. - The `ResultBLF` struct is used to store the result of drawing (currently only the number of lines wrapped, and the width).
2015-06-01Font Preview: fallback to default english strings in case translated ones ↵Bastien Montagne
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-01-12Fix T42069: Fonts /w non-ascii paths fail in win32Campbell Barton
Workaround freetype's use of fopen by swapping FT_New_Face for our own version which uses BLI_fopen.
2013-12-16BLF API: Add BLF_width_to_strlen,rstrlen gives a byte offset from a string widthCampbell Barton
2013-12-02Blender Font (BLF): add length argument to string width/height functionsCampbell Barton
This also fixes a crash editing buttons longer then UI_MAX_DRAW_STR
2013-06-07text rendering: shadow offset was causing text to clip, now check for ↵Campbell Barton
clipping without the shadow since not-drawing characters because of subtle effect is rather annoying.
2013-05-12quiet sign conversion warnings and reduce sign conversion for BLI_string, ↵Campbell Barton
and BLF.
2013-03-12Patch [#34373] Use i18n monospace font in Text editor and Python consoleIrie Shinsuke
This patch allows Blender to display i18n monospace font in the text editor and the Python interactive console. Wide characters that occupy multiple columns such as CJK characters can be displayed correctly. Furthermore, wrapping, selection, suggestion, cursor drawing, and syntax highlighting should work. Also fixes a bug [#34543]: In Text Editor false color in comment on cyrillic To estimate how many columns each character occupies, this patch uses wcwidth.c written by Markus Kuhn and distributed under MIT-style license: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c wcwidth.c is stored in extern/wcwidth and used as a static library. This patch adds new API to blenfont, blenlib and blenkernel: BLF_get_unifont_mono() BLF_free_unifont_mono() BLF_draw_mono() BLI_wcwidth() BLI_wcswidth() BLI_str_utf8_char_width() BLI_str_utf8_char_width_safe() txt_utf8_offset_to_column() txt_utf8_column_to_offset()
2012-09-15code cleanup: remove paranoid/invalid NULL checks and also reduce some ↵Campbell Barton
unneeded size_t -> int conversions.
2012-07-09code cleanupCampbell Barton
2012-03-12Style cleanup in blenfont (spaces, C++ comments, etc.).Bastien Montagne
2012-02-17unify include guard defines, __$FILENAME__Campbell Barton
without the underscores these clogged up the namespace for autocompleation which was annoying.
2011-10-23remove $Id: tags after discussion on the mailign list: ↵Campbell Barton
http://markmail.org/message/fp7ozcywxum3ar7n
2011-10-21replace BLF's blf_utf8_next() with BLI_str_utf8_as_unicode_step(),Campbell Barton
also fixed some spelling errors.
2011-10-21- minor edits to font drawing/utf8, was needlessly casting int/unsigned int.Campbell Barton
- also ifdef'd out more smoke function when the modifiers disabled.
2011-09-11speedup font drawing:Campbell Barton
for ascii characters in a utf8 string use glyph_ascii_table lookup rather than call blf_glyph_search(), otherwise fallback to blf_utf8_next() and blf_glyph_search().
2011-05-10minor cleanup: make functions static, use NULL for pointer comparisons,Campbell Barton
also fixed a possible bug assigning incorrect DPX function types to imbuf.
2011-02-27doxygen: blender/blenfont tagged.Nathan Letwory
2011-02-23doxygen: prevent GPL license block from being parsed as doxygen comment.Nathan Letwory
2011-02-13fix for warnings from Sparse static source code checker, mostly BKE/BLI and ↵Campbell Barton
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.
2010-11-27added option to turn off Text anti-aliasing in the UIMichael Fox
(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
2010-11-11fix for building, also use const char in more places.Campbell Barton
2010-11-11BLF_draw functions take an extra length argument, so the console drawing ↵Campbell Barton
doenst need to swap in NULL chars to draw word wrapping.
2010-10-31Minor speedups for 3D view text drawing ~10-15% improved frame-rate with ↵Campbell Barton
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.
2010-02-12correct fsf addressCampbell Barton
2009-08-18Stamp info back only for float buffer. (next commit add unsigned char).Diego Borghetti
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.
2009-07-122.5: Couple of small fun featuresBrecht Van Lommel
* 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.
2009-05-09Add support for attach a file with metrics information to the font.Diego Borghetti
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.
2009-05-08Cleanup blendfont.Diego Borghetti
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.
2009-05-06Big, big commit!!Diego Borghetti
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)
2009-04-24Move texture draw to blf_util.c, now both font used it.Diego Borghetti
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).
2009-03-30Add blender internal font.Diego Borghetti
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.
2009-03-03And another commit to cleanup a little, this is the last,Diego Borghetti
next commit add internal font and we can go ahead and remove ftfont and bmfont.