Simplification of code by removing redundant functions that are
specific to the drawing of fixed-pitch (monospaced) text.
We have some unnecessary duplicated font functions. We have BLF_draw and we also have BLF_draw_mono with the latter used only for fixed-pitched use, while the former works for either fixed or proportional fonts. The same goes for blf_font_draw and blf_font_draw_mono. You might think there is some optimization with monospace text, but there really is not. In order to print any character we need to load a GlyphBLF and it contains an integer advance that works for fixed or monospaced and is no slower to access than reading this from somewhere else.
To illustrate this confusion we currently call BLF_draw_mono four times. Yet we call BLF_draw with the *"blf_mono_font"* 19 times. So we are far more likely to draw mono text using the regular call, probably because the "mono" version was not noticed. But they work the same anyway. It is nice to remove this complication and extra code.
As part of this I also removed text_font_draw_character_utf8 as this was a duplication of text_font_draw_character, but specific to single codepoints specified by a UTF-8 sequence and with slightly different arguments. This patch just makes text_font_draw_character work with any single character or sequence.
Summary showing how much code is removed:
source/blender/blenfont/BLF_api.h | 1 - source/blender/blenfont/intern/blf.c | 18 ----------- source/blender/blenfont/intern/blf_font.c | 37 --------------------- source/blender/blenfont/intern/blf_internal.h | 4 --- source/blender/editors/space_info/textview.c | 4 +-- source/blender/editors/space_text/text_draw.c | 46 +++++++++------------------ 6 files changed, 17 insertions(+), 93 deletions(-)















