Blender  V2.93
Functions
blf_glyph.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ft2build.h>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "DNA_vec_types.h"
#include "BLI_listbase.h"
#include "BLI_rect.h"
#include "BLI_threads.h"
#include "BLF_api.h"
#include "GPU_capabilities.h"
#include "GPU_immediate.h"
#include "blf_internal.h"
#include "blf_internal_types.h"
#include "BLI_math_vector.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Functions

KerningCacheBLFblf_kerning_cache_find (FontBLF *font)
 
KerningCacheBLFblf_kerning_cache_new (FontBLF *font, GlyphCacheBLF *gc)
 
void blf_kerning_cache_clear (FontBLF *font)
 
GlyphCacheBLFblf_glyph_cache_find (FontBLF *font, unsigned int size, unsigned int dpi)
 
GlyphCacheBLFblf_glyph_cache_new (FontBLF *font)
 
GlyphCacheBLFblf_glyph_cache_acquire (FontBLF *font)
 
void blf_glyph_cache_release (FontBLF *font)
 
void blf_glyph_cache_clear (FontBLF *font)
 
void blf_glyph_cache_free (GlyphCacheBLF *gc)
 
GlyphBLFblf_glyph_search (GlyphCacheBLF *gc, unsigned int c)
 
GlyphBLFblf_glyph_add (FontBLF *font, GlyphCacheBLF *gc, unsigned int index, unsigned int c)
 
void blf_glyph_free (GlyphBLF *g)
 
static void blf_texture_draw (const unsigned char color[4], const int glyph_size[2], const int offset, float x1, float y1, float x2, float y2)
 
static void blf_texture5_draw (const unsigned char color_in[4], const int glyph_size[2], const int offset, float x1, float y1, float x2, float y2)
 
static void blf_texture3_draw (const unsigned char color_in[4], const int glyph_size[2], const int offset, float x1, float y1, float x2, float y2)
 
static void blf_glyph_calc_rect (rctf *rect, GlyphBLF *g, float x, float y)
 
static void blf_glyph_calc_rect_test (rctf *rect, GlyphBLF *g, float x, float y)
 
static void blf_glyph_calc_rect_shadow (rctf *rect, GlyphBLF *g, float x, float y, FontBLF *font)
 
void blf_glyph_render (FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, float x, float y)
 

Detailed Description

Glyph rendering, texturing and caching. Wraps Freetype and OpenGL functions.

Definition in file blf_glyph.c.

Function Documentation

◆ blf_glyph_add()

GlyphBLF* blf_glyph_add ( FontBLF font,
GlyphCacheBLF gc,
unsigned int  index,
unsigned int  c 
)

◆ blf_glyph_cache_acquire()

GlyphCacheBLF* blf_glyph_cache_acquire ( FontBLF font)

◆ blf_glyph_cache_clear()

void blf_glyph_cache_clear ( FontBLF font)

◆ blf_glyph_cache_find()

GlyphCacheBLF* blf_glyph_cache_find ( FontBLF font,
unsigned int  size,
unsigned int  dpi 
)

◆ blf_glyph_cache_free()

void blf_glyph_cache_free ( GlyphCacheBLF gc)

◆ blf_glyph_cache_new()

GlyphCacheBLF* blf_glyph_cache_new ( FontBLF font)

◆ blf_glyph_cache_release()

void blf_glyph_cache_release ( FontBLF font)

◆ blf_glyph_calc_rect()

static void blf_glyph_calc_rect ( rctf rect,
GlyphBLF g,
float  x,
float  y 
)
static

◆ blf_glyph_calc_rect_shadow()

static void blf_glyph_calc_rect_shadow ( rctf rect,
GlyphBLF g,
float  x,
float  y,
FontBLF font 
)
static

Definition at line 477 of file blf_glyph.c.

References blf_glyph_calc_rect(), FontBLF::shadow_x, FontBLF::shadow_y, x, and y.

Referenced by blf_glyph_render().

◆ blf_glyph_calc_rect_test()

static void blf_glyph_calc_rect_test ( rctf rect,
GlyphBLF g,
float  x,
float  y 
)
static

Definition at line 466 of file blf_glyph.c.

References GlyphBLF::advance, GlyphBLF::dims, float(), floorf, MIN2, x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.

Referenced by blf_glyph_render().

◆ blf_glyph_free()

void blf_glyph_free ( GlyphBLF g)

Definition at line 392 of file blf_glyph.c.

References GlyphBLF::bitmap, and MEM_freeN.

Referenced by blf_glyph_cache_free().

◆ blf_glyph_render()

void blf_glyph_render ( FontBLF font,
GlyphCacheBLF gc,
GlyphBLF g,
float  x,
float  y 
)

◆ blf_glyph_search()

GlyphBLF* blf_glyph_search ( GlyphCacheBLF gc,
unsigned int  c 
)

◆ blf_kerning_cache_clear()

void blf_kerning_cache_clear ( FontBLF font)

Definition at line 110 of file blf_glyph.c.

References BLI_freelistN(), FontBLF::kerning_cache, FontBLF::kerning_caches, and NULL.

Referenced by BLF_cache_clear(), and blf_font_free().

◆ blf_kerning_cache_find()

KerningCacheBLF* blf_kerning_cache_find ( FontBLF font)

◆ blf_kerning_cache_new()

KerningCacheBLF* blf_kerning_cache_new ( FontBLF font,
GlyphCacheBLF gc 
)

◆ blf_texture3_draw()

static void blf_texture3_draw ( const unsigned char  color_in[4],
const int  glyph_size[2],
const int  offset,
float  x1,
float  y1,
float  x2,
float  y2 
)
static

Definition at line 442 of file blf_glyph.c.

References blf_texture_draw(), x2, and y1.

Referenced by blf_glyph_render().

◆ blf_texture5_draw()

static void blf_texture5_draw ( const unsigned char  color_in[4],
const int  glyph_size[2],
const int  offset,
float  x1,
float  y1,
float  x2,
float  y2 
)
static

Definition at line 426 of file blf_glyph.c.

References blf_texture_draw(), x2, and y1.

Referenced by blf_glyph_render().

◆ blf_texture_draw()

static void blf_texture_draw ( const unsigned char  color[4],
const int  glyph_size[2],
const int  offset,
float  x1,
float  y1,
float  x2,
float  y2 
)
static