Blender V4.3
blf_thumbs.cc File Reference
#include <algorithm>
#include <cstdlib>
#include <ft2build.h>
#include "BLI_listbase.h"
#include "BLI_math_bits.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "blf_internal.hh"
#include "blf_internal_types.hh"
#include "BLF_api.hh"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Classes

struct  UnicodeSample
 

Macros

#define BLF_SAMPLE_LEN   5
 

Functions

static const char32_t * blf_get_sample_text (FT_Face face)
 
bool BLF_thumb_preview (const char *filepath, uchar *buf, int w, int h, int)
 

Variables

static const UnicodeSample unicode_samples []
 

Detailed Description

Utility function to generate font preview images.

Isolate since this needs to be called by ImBuf code (bad level call).

Definition in file blf_thumbs.cc.

Macro Definition Documentation

◆ BLF_SAMPLE_LEN

#define BLF_SAMPLE_LEN   5

Definition at line 39 of file blf_thumbs.cc.

Referenced by BLF_thumb_preview().

Function Documentation

◆ blf_get_sample_text()

static const char32_t * blf_get_sample_text ( FT_Face face)
static

Definition at line 224 of file blf_thumbs.cc.

References ARRAY_SIZE, BLI_assert, count_bits_i(), sample, and unicode_samples.

Referenced by BLF_thumb_preview().

◆ BLF_thumb_preview()

bool BLF_thumb_preview ( const char * filepath,
unsigned char * buf,
int w,
int h,
int channels )

This function is used for generating thumbnail previews.

Note
called from a thread, so it bypasses the normal BLF_* api (which isn't thread-safe).

Definition at line 308 of file blf_thumbs.cc.

References blf_get_sample_text(), BLF_SAMPLE_LEN, float, ft_lib, ft_pix_to_int(), int, left, top, w(), and x.

Referenced by IMB_thumb_load_font().

Variable Documentation

◆ unicode_samples

const UnicodeSample unicode_samples[]
static

Definition at line 50 of file blf_thumbs.cc.

Referenced by blf_get_sample_text().