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
2021-12-08Cleanup: move public doc-strings into headers for 'blenfont'Campbell Barton
Ref T92709
2021-11-19Cleanup: fix typos in comments and docsBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D13264
2021-11-13BLF: Use Floats for Font Point SizesHarley Acheson
Allow the use of floating-point values for font point sizes, which allows greater precision and flexibility for text output. See D8960 for more information, details, and justification. Differential Revision: https://developer.blender.org/D8960 Reviewed by Campbell Barton
2021-11-08Cleanup: use doxygen for BLF glyphCampbell Barton
- Use doxy formatted functions. - Use doxy sections.
2021-11-06BLF: Refactor blf_glyph.cHarley Acheson
Cleanup and Simplification of blf_glyph.c See D13095 for details. Differential Revision: https://developer.blender.org/D13095 Reviewed by Campbell Barton
2021-11-06Cleanup: remove window_manager & editor includes from BLFCampbell Barton
Remove the need to include the window manager & editor functions in low level font rendering code. - The default font size is now set when changed in the preferences. - Flushing cache is set as a callback.
2021-11-05Cleanup (UI): Add/use type for operator context enumJulian Eisel
Adds a `wmOperatorCallContext` typedef for the existing `WM_OP_XXX` operator context enum. This adds type safety, allows the compiler to produce better warnings and helps understanding what a variable is for. Differential Revision: https://developer.blender.org/D13113 Reviewed by: Campbell Barton
2021-11-03BLF: Remove Thread Locking For Font MetricsHarley Acheson
This patch removes the need to lock the thread just to get to some generic (not glyph-specific) font metrics. See D12976 for more details. Differential Revision: https://developer.blender.org/D12976 Reviewed by Campbell Barton
2021-10-29Cleanup: rename blf_utf8_next_fast to blf_glyph_from_utf8_and_stepCampbell Barton
Calling this 'fast' no longer made sense as the slower code-path has been removed.
2021-10-29Cleanup: remove redundant BLI_UTF8_ERR checkCampbell Barton
2021-10-29Cleanup: resolve cast warningsCampbell Barton
2021-10-29BLF Refactor: blf_utf8_next_fastHarley Acheson
Simplification of BLF glyph loading See D13026 for details. Differential Revision: https://developer.blender.org/D13026 Reviewed by Campbell Barton
2021-10-29BLF Refactor: blf_kerning_step_fastHarley Acheson
Simplification of BLF Kerning See D13015 for more details. Differential Revision: https://developer.blender.org/D13015 Reviewed by Campbell Barton
2021-10-06Cleanup: spelling in commentsCampbell Barton
2021-08-28BLF: remove checks for blend file relative pathsCampbell Barton
This was added in b24712a9ca6fa807660a02d6988269748daecdbf but is no longer needed as of efc129bc827558e55cf4619b8e2ca502342338f3. Further, this wasn't reliable as it could fail on linked library data which has a different base directory. Assert when blend file relative paths are passed to BLF (matching imbuf file loading).
2021-08-27Cleanup: utf8 stepping functionsCampbell Barton
Various changes to reduce risk of out of bounds errors in utf8 seeking. - Remove BLI_str_prev_char_utf8 This function could potentially scan past the beginning of a string. Use BLI_str_find_prev_char_utf8 instead which takes a limiting string start argument. - Swap arguments for BLI_str_find_prev_char_utf8 so the stepping argument is first and the limiting argument is last. This matches BLI_str_find_next_char_utf8. - Change behavior of these functions to return it the start or end pointers instead of NULL, which complicated use of these functions to calculate offsets. Callers that need to check if the limits were reached can compare the return value with the start/end pointers. - Return 'const char *' from these functions so they don't remove const from the input arguments.
2021-08-26Cleanup: spelling in commentsCampbell Barton
2021-08-25BLF: Remove ASCII-only Code PathsHarley Acheson
Remove redundant code for drawing text strings that contain only ASCII. See D12293 for much more detail. Differential Revision: https://developer.blender.org/D12293 Reviewed by Campbell Barton
2021-08-25BLI_string_utf8: simplify utf8 stepping logicCampbell Barton
There were multiple utf8 functions which treated errors slightly differently. Split BLI_str_utf8_as_unicode_step into two functions. - BLI_str_utf8_as_unicode_step_or_error returns error value when decoding fails and doesn't step. - BLI_str_utf8_as_unicode_step always steps forward at least one returning the byte value without decoding (needed to display some latin1 file-paths). Font drawing uses BLI_str_utf8_as_unicode_step and no longer check for error values.
2021-08-24Fix BLI_str_utf8_as_unicode_step reading past intended boundsCampbell Barton
Add a string length argument to BLI_str_utf8_as_unicode_step to prevent reading past the buffer bounds or the intended range since some callers of this function take a string length to operate on part of the string. Font drawing for example didn't respect the length argument, potentially causing a buffer over-read with multi-byte characters that could read past the end of the string. The following command would read 5 bytes past the end of the input. `BLF_draw(font_id, (char[]){252}, 1);` In practice strings are typically null terminated so this didn't crash reading past buffer bounds. Nevertheless, this wasn't correct and could cause bugs in the future. Clamping by the length now has the same behavior as a null byte. Add test to ensure this is working as intended.
2021-08-24Cleanup: spellingCampbell Barton
2021-08-23Cleanup: rename len to str_len for BLF functionsCampbell Barton
Make it obvious which variable this is the length of.
2021-08-21Cleanup: minor changes to blf_font.cCampbell Barton
- Use early return when kerning isn't used. - Remove early return that prevented matching acquire/release calls.
2021-08-21Cleanup: organize blf_font.c functions using doxy-sectionsCampbell Barton
Functions in this file were scattered and not well organized.
2021-08-21Correct build error from 0d7aab2375e6bb06e89dad851550b283a1ff805cCampbell Barton
2021-08-21Refactor: BLF Kerning Cache After UseHarley Acheson
Optimization of font kerning by only caching kerning values after a pair is encountered. Also saves unscaled values so they don't have to be rebuilt between font size changes. See D12274 for more details and speed comparison. Differential Revision: https://developer.blender.org/D12274 Reviewed by Campbell Barton
2021-08-19Correct assert from 22ab0159a9754365e2d10a1bc658d4409d084fa6Campbell Barton
2021-08-19Refactor: BLF Without Kerning ModesHarley Acheson
Simplification of BLF code after removal of kerning modes. See D12262 for more details. Differential Revision: https://developer.blender.org/D12262 Reviewed by Campbell Barton
2021-08-19UI: Remove "Unfitted" Kerning Style OptionHarley Acheson
This patch removes the "Kerning Style" option for UI widget font drawing and uses only the current default of "Fitted", since the other option of "Unfitted" is just the result of truncation errors. see D12231 for much more information. Differential Revision: https://developer.blender.org/D12231 Reviewed by Campbell Barton
2021-08-16BLF: avoid unnecessary lookups in blf_kerning_cache_newCampbell Barton
blf_kerning_cache_new was performing many unnecessary hash lookups, calling blf_glyph_search 32768 times. Use a lookup table to reduce this to the number of ASCII characters (128 calls).
2021-08-16Cleanup: rename kerning table to ascii_tableCampbell Barton
It wasn't obvious this was only for ASCII characters.
2021-08-16BLF: use fast ASCII kerning for word-wrap calculationsCampbell Barton
While this wasn't a bottleneck, using the fast version of this function removes some duplicate code that doesn't use the look-up table.
2021-08-16Cleanup: replace macros with inline functions for font drawingCampbell Barton
Also assert blf_font_ensure_ascii_kerning has been called in blf_kerning_step_fast.
2021-08-14BLF: Do Not Preload Glyph CacheHarley Acheson
This patch turns off the preloading of ascii glyphs and instead caches each glyph the first time it is actually used. See D12215 for much more detail. Differential Revision: https://developer.blender.org/D12215 Reviewed by Campbell Barton
2021-08-14BLF Cleanup: Size Defines, Comments, etcHarley Acheson
This patch makes some non-functional changes to BLF code. Some size defines added, comments changed, simplification of macro BLF_KERNING_VARS. See D12200 for more details. Differential Revision: https://developer.blender.org/D12200 Reviewed by Campbell Barton
2021-08-11BLF: Do Not Cache Unused Rendered GlyphsHarley Acheson
The loading of a font size or style renders bitmaps of the characters 0-255 and stores them in a cache. But glyphs 128-255 in this cache are not accessible. What used to be ansi high-bit characters are now multi- byte UTF-8 sequences. Therefore this patch reduces the glyph_ascii_table size to 128 and only caches characters 32-127, the visible portion of ASCII, which greatly reduces the time to load a font. See D12189 for more details. Differential Revision: https://developer.blender.org/D12189 Reviewed by Campbell Barton
2021-08-04VSE: Allow Wingdings and Symbol FontsHarley Acheson
This patch makes us less restrictive on the allowed types of FreeType font character maps we allow, rather than primarily unicode-only. This allows us to use some legacy, symbol, specialty, and proprietary fonts like Wingdings. Note we were a little less restrictive with vfonts, used for 3D Text Objects, so this patch primarily helps VSE. See D12124 for details and examples. Differential Revision: https://developer.blender.org/D12124 Reviewed by Brecht Van Lommel
2021-07-28Fix T75028: Improved Font Names in File ManagerHarley Acheson
When viewing font files in the File Manager, this patch uses the font's family and style names to show the same type of string shown to users in operating system lists. For example "Book Antiqua Regular" instead of "BKANT.ttf" see D12020 for details and examples. Differential Revision: https://developer.blender.org/D12020 Reviewed by Campbell Barton and Julian Eisel
2021-07-27Cleanup: comment spelling & punctuationYimingWu
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-07Fix T77651: Black screen on Blender startup on ChromeOSGermano Cavalcante
Apparently `textureSize` doesn't work with `sampler1DArray` on this OS. Thanks to @dave1853 for finding the source of the problem.
2021-05-31Cleanup: Replace fseek() calls with BLI_fseek()Harley Acheson
The fseek() function on Windows only accepts a 32-bit long offset argument. Because of this we have our own version, BLI_fseek(), which will use 64-bit _fseeki64() on Windows. This patch just replaces some fseek() calls with BLI_fseek(). Differential Revision: https://developer.blender.org/D11430 Reviewed by Brecht Van Lommel
2021-04-22Fix T87337: Text strip draws white outlineRichard Antalik
Math for drawing font over byte buffer was incorrect. Effect can be seen when target buffer is fully black and transparent - this results in font color being effectively premultiplied, which causes problems when image is composited further. Use `blend_color_mix_byte()` and `blend_color_mix_float()` for blending. Reviewed By: sergey Differential Revision: https://developer.blender.org/D11035
2021-02-17Cleanup: Abbreviate enums with 'UNSIGNED_' in the nameGermano Cavalcante
2021-02-17Cleanup: spellingCampbell Barton
2021-02-14Cleanup: spellingCampbell Barton
2020-12-15Fix (studio-reported) broken handling of relative font paths.Bastien Montagne
`blf_dir_search` BLF util would not properly handle relative fonts not found in pre-defined 'system fonts' directoriesi stored in `global_font_dir` global variable. Now it rebases relative paths to current .blend file location as expected. Note: the fact that VSE is setting font ptaths relative by default is probably not actually desired, but this is another issue really. See `BKE_sequencer_text_font_load` code.
2020-10-26Cleanup: spellingCampbell Barton