Blender V5.0
blf_thumbs.cc File Reference
#include <algorithm>
#include <cstdlib>
#include <ft2build.h>
#include "BLI_math_bits.h"
#include "BLI_utildefines.h"
#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 (const FT_Face face)
bool BLF_thumb_preview (const char *filepath, uchar *buf, const int w, const int h, const 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 33 of file blf_thumbs.cc.

Referenced by BLF_thumb_preview().

Function Documentation

◆ blf_get_sample_text()

const char32_t * blf_get_sample_text ( const FT_Face face)
static

◆ 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 302 of file blf_thumbs.cc.

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

Referenced by BLF_str_offset_to_glyph_bounds(), and IMB_thumb_load_font().

Variable Documentation

◆ unicode_samples

const UnicodeSample unicode_samples[]
static

Definition at line 44 of file blf_thumbs.cc.

Referenced by blf_get_sample_text().