Blender V4.3
blf_glyph.cc File Reference
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ft2build.h>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_color.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BLF_api.hh"
#include "DNA_curve_types.h"
#include "GPU_capabilities.hh"
#include "blf_internal.hh"
#include "blf_internal_types.hh"
#include "BLI_math_vector.h"
#include "BLI_string_utf8.h"
#include "nanosvgrast.h"
#include "svg_icons.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Classes

struct  UnicodeBlock
 

Macros

#define BLF_GAMMA_CORRECT_GLYPHS
 

Functions

Internal Utilities
static FT_Fixed to_16dot16 (double val)
 
static float from_16dot16 (FT_Fixed value)
 
Glyph Cache
static GlyphCacheBLFblf_glyph_cache_find (const FontBLF *font)
 
static 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)
 
static GlyphBLFblf_glyph_cache_find_glyph (const GlyphCacheBLF *gc, uint charcode, uint8_t subpixel)
 
static uchar blf_glyph_gamma (uchar c)
 
static GlyphBLFblf_glyph_cache_add_glyph (GlyphCacheBLF *gc, FT_GlyphSlot glyph, uint charcode, FT_UInt glyph_index, uint8_t subpixel)
 
static GlyphBLFblf_glyph_cache_add_blank (GlyphCacheBLF *gc, uint charcode)
 
static GlyphBLFblf_glyph_cache_add_svg (GlyphCacheBLF *gc, uint charcode, bool color, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr)
 
Glyph Load
static FT_GlyphSlot blf_glyph_load (FontBLF *font, FT_UInt glyph_index, bool outline_only)
 
Glyph Render
static bool blf_glyph_render_bitmap (FontBLF *font, FT_GlyphSlot glyph)
 
Variations (Multiple Masters) support
static const FT_Var_Axis * blf_var_axis_by_tag (const FT_MM_Var *variations, const uint32_t tag, int *r_axis_index)
 
static FT_Fixed blf_factor_to_coordinate (const FT_Var_Axis *axis, const float factor)
 
static bool blf_glyph_set_variation_normalized (const FontBLF *font, FT_Fixed coords[], const uint32_t tag, const float factor)
 
static bool blf_glyph_set_variation_float (const FontBLF *font, FT_Fixed coords[], uint32_t tag, float *value)
 
static float blf_glyph_set_variation_weight (const FontBLF *font, FT_Fixed coords[], float current_weight, float target_weight)
 
static float blf_glyph_set_variation_slant (const FontBLF *font, FT_Fixed coords[], float current_degrees, float target_degrees)
 
static float blf_glyph_set_variation_width (const FontBLF *font, FT_Fixed coords[], float current_width, float target_width)
 
static float blf_glyph_set_variation_spacing (const FontBLF *font, FT_Fixed coords[], float current_spacing, float target_spacing)
 
static bool blf_glyph_set_variation_optical_size (const FontBLF *font, FT_Fixed coords[], const float points)
 
Glyph Transformations
static bool blf_glyph_transform_weight (FT_GlyphSlot glyph, float width, bool monospaced)
 
static bool blf_glyph_transform_slant (FT_GlyphSlot glyph, float degrees)
 
static bool blf_glyph_transform_width (FT_GlyphSlot glyph, float factor)
 
static bool blf_glyph_transform_spacing (FT_GlyphSlot glyph, float factor)
 
static bool blf_glyph_transform_monospace (FT_GlyphSlot glyph, int width)
 
Glyph Access (Ensure/Free)
static FT_GlyphSlot blf_glyph_render (FontBLF *settings_font, FontBLF *glyph_font, FT_UInt glyph_index, uint charcode, uint8_t subpixel, int fixed_width, bool outline_only)
 
GlyphBLFblf_glyph_ensure (FontBLF *font, GlyphCacheBLF *gc, const uint charcode, uint8_t subpixel)
 
GlyphBLFblf_glyph_ensure_icon (GlyphCacheBLF *gc, const uint icon_id, bool color, blender::FunctionRef< void(std::string &)> edit_source_cb)
 
GlyphBLFblf_glyph_ensure_subpixel (FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, int32_t pen_x)
 
Glyph Bounds Calculation
static void blf_glyph_calc_rect (const GlyphBLF *g, const int x, const int y, rcti *r_rect)
 
static void blf_glyph_calc_rect_test (const GlyphBLF *g, const int x, const int y, rcti *r_rect)
 
static void blf_glyph_calc_rect_shadow (const GlyphBLF *g, const int x, const int y, const FontBLF *font, rcti *r_rect)
 
Glyph Drawing
static void blf_texture_draw (const GlyphBLF *g, const uchar color[4], const FontShadowType shadow, const int x1, const int y1, const int x2, const int y2)
 
void blf_glyph_draw (FontBLF *font, GlyphCacheBLF *gc, GlyphBLF *g, const int x, const int y)
 
Convert Glyph to Curves
static void blf_glyph_to_curves (const FT_Outline &ftoutline, ListBase *nurbsbase, const float scale)
 
static FT_GlyphSlot blf_glyphslot_ensure_outline (FontBLF *font, const uint charcode)
 
float blf_character_to_curves (FontBLF *font, uint unicode, ListBase *nurbsbase, const float scale)
 

Glyph Unicode Block Lookup

This table can be used to find a coverage bit based on a charcode. Later we can get default language and script from codepoint.

static const UnicodeBlock unicode_blocks []
 
static const UnicodeBlockblf_charcode_to_unicode_block (const uint charcode)
 
static int blf_charcode_to_coverage_bit (uint charcode)
 
static bool blf_font_has_coverage_bit (const FontBLF *font, int coverage_bit)
 
static FT_UInt blf_glyph_index_from_charcode (FontBLF **font, const uint charcode)
 

Detailed Description

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

Definition in file blf_glyph.cc.

Macro Definition Documentation

◆ BLF_GAMMA_CORRECT_GLYPHS

#define BLF_GAMMA_CORRECT_GLYPHS

Convert glyph coverage amounts to lightness values. Uses a LUT that perceptually improves anti-aliasing and results in text that looks a bit fuller and slightly brighter. This should be reconsidered in some - or all - cases when we transform the entire UI.

Definition at line 58 of file blf_glyph.cc.

Function Documentation

◆ blf_character_to_curves()

float blf_character_to_curves ( FontBLF * font,
unsigned int unicode,
ListBase * nurbsbase,
const float scale )

Convert a character's outlines into curves.

Definition at line 1883 of file blf_glyph.cc.

References blf_glyph_to_curves(), blf_glyphslot_ensure_outline(), and float.

Referenced by BLF_character_to_curves().

◆ blf_charcode_to_coverage_bit()

static int blf_charcode_to_coverage_bit ( uint charcode)
static

◆ blf_charcode_to_unicode_block()

static const UnicodeBlock * blf_charcode_to_unicode_block ( const uint charcode)
static

Find a unicode block that a charcode belongs to.

Definition at line 724 of file blf_glyph.cc.

References ARRAY_SIZE, int, max, min, and unicode_blocks.

Referenced by blf_charcode_to_coverage_bit().

◆ blf_factor_to_coordinate()

static FT_Fixed blf_factor_to_coordinate ( const FT_Var_Axis * axis,
const float factor )
static

Convert a float factor to a fixed-point design coordinate. Currently unused because we are only dealing with known axes with specific functions, but this would be needed for unregistered, custom, or private tags. These are all uppercase axis tags.

Parameters
axisPointer to a design space axis structure.
factor-1 to 1 with 0 meaning "default"

Definition at line 999 of file blf_glyph.cc.

Referenced by blf_glyph_set_variation_normalized().

◆ blf_font_has_coverage_bit()

static bool blf_font_has_coverage_bit ( const FontBLF * font,
int coverage_bit )
static

Definition at line 773 of file blf_glyph.cc.

Referenced by blf_glyph_index_from_charcode().

◆ blf_glyph_cache_acquire()

◆ blf_glyph_cache_add_blank()

static GlyphBLF * blf_glyph_cache_add_blank ( GlyphCacheBLF * gc,
uint charcode )
static

◆ blf_glyph_cache_add_glyph()

static GlyphBLF * blf_glyph_cache_add_glyph ( GlyphCacheBLF * gc,
FT_GlyphSlot glyph,
uint charcode,
FT_UInt glyph_index,
uint8_t subpixel )
static

◆ blf_glyph_cache_add_svg()

◆ blf_glyph_cache_clear()

void blf_glyph_cache_clear ( FontBLF * font)

Definition at line 164 of file blf_glyph.cc.

References lock.

Referenced by BLF_cache_clear(), and blf_font_free().

◆ blf_glyph_cache_find()

static GlyphCacheBLF * blf_glyph_cache_find ( const FontBLF * font)
static

Definition at line 86 of file blf_glyph.cc.

References BLF_BOLD, and BLF_ITALIC.

Referenced by blf_glyph_cache_acquire().

◆ blf_glyph_cache_find_glyph()

static GlyphBLF * blf_glyph_cache_find_glyph ( const GlyphCacheBLF * gc,
uint charcode,
uint8_t subpixel )
static

Try to find a glyph in cache.

Returns
nullptr if not found.

Definition at line 175 of file blf_glyph.cc.

References GlyphCacheBLF::glyphs, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr_as(), and ptr.

Referenced by blf_glyph_ensure(), and blf_glyph_ensure_icon().

◆ blf_glyph_cache_new()

static GlyphCacheBLF * blf_glyph_cache_new ( FontBLF * font)
static

Definition at line 100 of file blf_glyph.cc.

References BLF_BOLD, blf_ensure_size(), blf_get_char_index(), BLF_ITALIC, and int.

Referenced by blf_glyph_cache_acquire().

◆ blf_glyph_cache_release()

◆ blf_glyph_calc_rect()

static void blf_glyph_calc_rect ( const GlyphBLF * g,
const int x,
const int y,
rcti * r_rect )
static

◆ blf_glyph_calc_rect_shadow()

static void blf_glyph_calc_rect_shadow ( const GlyphBLF * g,
const int x,
const int y,
const FontBLF * font,
rcti * r_rect )
static

Definition at line 1467 of file blf_glyph.cc.

References blf_glyph_calc_rect().

Referenced by blf_glyph_draw().

◆ blf_glyph_calc_rect_test()

static void blf_glyph_calc_rect_test ( const GlyphBLF * g,
const int x,
const int y,
rcti * r_rect )
static

◆ blf_glyph_draw()

◆ blf_glyph_ensure()

GlyphBLF * blf_glyph_ensure ( FontBLF * font,
GlyphCacheBLF * gc,
uint charcode,
uint8_t subpixel = 0 )

◆ blf_glyph_ensure_icon()

GlyphBLF * blf_glyph_ensure_icon ( GlyphCacheBLF * gc,
const uint icon_id,
bool color,
blender::FunctionRef< void(std::string &)> edit_source_cb )

◆ blf_glyph_ensure_subpixel()

◆ blf_glyph_gamma()

static uchar blf_glyph_gamma ( uchar c)
static

Gamma correction of glyph coverage values with widely-recommended gamma of 1.43. "The reasons are historical. Because so many programmers have neglected gamma blending for so long, people who have created fonts have tried to work around the problem of fonts looking too thin by just making the fonts thicker! Obviously it doesn't help the jaggedness, but it does make them look the proper weight, as originally intended. The obvious problem with this is that if we want to gamma blend correctly many older fonts will look wrong. So we compromise, and use a lower gamma value, so we get a bit better anti-aliasing, but the fonts don't look too heavy." https://www.puredevsoftware.com/blog/2019/01/22/sub-pixel-gamma-correct-font-rendering/

Definition at line 200 of file blf_glyph.cc.

Referenced by blf_glyph_cache_add_glyph().

◆ blf_glyph_index_from_charcode()

static FT_UInt blf_glyph_index_from_charcode ( FontBLF ** font,
const uint charcode )
static

Return a glyph index from charcode. Not found returns zero, which is a valid printable character (.notdef or tofu). Font is allowed to change here.

Definition at line 785 of file blf_glyph.cc.

References BLF_CACHED, blf_charcode_to_coverage_bit(), BLF_DEFAULT, blf_font_has_coverage_bit(), blf_get_char_index(), BLF_LAST_RESORT, BLF_MAX_FONT, BLF_MONOSPACED, FontBLF::face, FontBLF::flags, global_font, and printf.

Referenced by blf_glyph_ensure(), and blf_glyphslot_ensure_outline().

◆ blf_glyph_load()

static FT_GlyphSlot blf_glyph_load ( FontBLF * font,
FT_UInt glyph_index,
bool outline_only )
static

Load a glyph into the glyph slot of a font's face object.

Definition at line 879 of file blf_glyph.cc.

References BLF_HINTING_FULL, BLF_HINTING_NONE, BLF_HINTING_SLIGHT, BLF_MONOCHROME, and FontBLF::face.

Referenced by blf_glyph_render().

◆ blf_glyph_render()

◆ blf_glyph_render_bitmap()

static bool blf_glyph_render_bitmap ( FontBLF * font,
FT_GlyphSlot glyph )
static

Convert a glyph from outlines to a bitmap that we can display.

Definition at line 925 of file blf_glyph.cc.

References BLF_HINTING_SLIGHT, BLF_MONOCHROME, and ELEM.

Referenced by blf_glyph_render().

◆ blf_glyph_set_variation_float()

static bool blf_glyph_set_variation_float ( const FontBLF * font,
FT_Fixed coords[],
uint32_t tag,
float * value )
static

Set a face variation axis to an exact float value

Parameters
coordsArray of design coordinates, per axis.
tagAxis tag, e.g. BLF_VARIATION_AXIS_OPTSIZE.
valueNew float value. Converted to 16.16 and clamped within allowed range.
Returns
success if able to set this value.

Definition at line 1047 of file blf_glyph.cc.

References blf_var_axis_by_tag(), BLF_VARIATIONS_MAX, CLAMP, from_16dot16(), and to_16dot16().

Referenced by blf_glyph_set_variation_optical_size(), blf_glyph_set_variation_slant(), blf_glyph_set_variation_spacing(), blf_glyph_set_variation_weight(), and blf_glyph_set_variation_width().

◆ blf_glyph_set_variation_normalized()

static bool blf_glyph_set_variation_normalized ( const FontBLF * font,
FT_Fixed coords[],
const uint32_t tag,
const float factor )
static

Alter a face variation axis by a factor. Currently unused because we are only dealing with known axes with specific functions, but this would be needed for unregistered, custom, or private tags. These are all uppercase axis tags.

Parameters
coordsarray of design coordinates, per axis.
tagAxis tag, e.g. BLF_VARIATION_AXIS_WEIGHT.
factor-1 to 1 with 0 meaning "default"
Returns
success if able to set this value.

Definition at line 1025 of file blf_glyph.cc.

References blf_factor_to_coordinate(), blf_var_axis_by_tag(), and BLF_VARIATIONS_MAX.

◆ blf_glyph_set_variation_optical_size()

static bool blf_glyph_set_variation_optical_size ( const FontBLF * font,
FT_Fixed coords[],
const float points )
static

Set the BLF_VARIATION_AXIS_OPTSIZE (Optical Size) axis to a specific size value.

Parameters
coordsArray of design coordinates, per axis.
pointsNon-zero size in typographic points.
Returns
success if able to set this value.

Definition at line 1147 of file blf_glyph.cc.

References blf_glyph_set_variation_float(), and BLF_VARIATION_AXIS_OPTSIZE.

Referenced by blf_glyph_render().

◆ blf_glyph_set_variation_slant()

static float blf_glyph_set_variation_slant ( const FontBLF * font,
FT_Fixed coords[],
float current_degrees,
float target_degrees )
static

Set the BLF_VARIATION_AXIS_SLANT (Slant) axis to a specific slant value.

Parameters
coordsArray of design coordinates, per axis.
degreesSlant in clockwise (opposite to spec) degrees.
Returns
value set (could be clamped), or current slant if the axis does not exist.

Definition at line 1090 of file blf_glyph.cc.

References blf_glyph_set_variation_float(), and BLF_VARIATION_AXIS_SLANT.

Referenced by blf_glyph_render().

◆ blf_glyph_set_variation_spacing()

static float blf_glyph_set_variation_spacing ( const FontBLF * font,
FT_Fixed coords[],
float current_spacing,
float target_spacing )
static

Set the proposed BLF_VARIATION_AXIS_SPACING (Spacing) axis to a specific value.

Parameters
coordsArray of design coordinates, per axis.
spacingGlyph spacing value. 0.0 is normal, as per spec.
Returns
value set (could be clamped), or current spacing if the axis does not exist.

Definition at line 1128 of file blf_glyph.cc.

References blf_glyph_set_variation_float(), and BLF_VARIATION_AXIS_SPACING.

Referenced by blf_glyph_render().

◆ blf_glyph_set_variation_weight()

static float blf_glyph_set_variation_weight ( const FontBLF * font,
FT_Fixed coords[],
float current_weight,
float target_weight )
static

Set the BLF_VARIATION_AXIS_WEIGHT (Weight) axis to a specific weight value.

Parameters
coordsArray of design coordinates, per axis.
weightWeight class value (1-1000 allowed, 100-900 typical).
Returns
value set (could be clamped), or current weight if the axis does not exist.

Definition at line 1071 of file blf_glyph.cc.

References blf_glyph_set_variation_float(), and BLF_VARIATION_AXIS_WEIGHT.

Referenced by blf_glyph_render().

◆ blf_glyph_set_variation_width()

static float blf_glyph_set_variation_width ( const FontBLF * font,
FT_Fixed coords[],
float current_width,
float target_width )
static

Set the BLF_VARIATION_AXIS_WIDTH (Width) axis to a specific width value.

Parameters
coordsArray of design coordinates, per axis.
widthGlyph width value. 1.0 is normal, as per spec (which uses percent).
Returns
value set (could be clamped), or current width if the axis does not exist.

Definition at line 1109 of file blf_glyph.cc.

References blf_glyph_set_variation_float(), and BLF_VARIATION_AXIS_WIDTH.

Referenced by blf_glyph_render().

◆ blf_glyph_to_curves()

static void blf_glyph_to_curves ( const FT_Outline & ftoutline,
ListBase * nurbsbase,
const float scale )
static

from: http://www.freetype.org/freetype2/docs/glyphs/glyphs-6.html#section-1

Vectorial representation of Freetype glyphs

The source format of outlines is a collection of closed paths called "contours". Each contour is made of a series of line segments and bezier arcs. Depending on the file format, these can be second-order or third-order polynomials. The former are also called quadratic or conic arcs, and they come from the TrueType format. The latter are called cubic arcs and mostly come from the Type1 format.

Each arc is described through a series of start, end and control points. Each point of the outline has a specific tag which indicates whether it is used to describe a line segment or an arc. The following rules are applied to decompose the contour's points into segments and arcs :

two successive "on" points indicate a line segment joining them.

one conic "off" point midst two "on" points indicates a conic bezier arc,

the "off" point being the control point, and the "on" ones the start and end points.

Two successive cubic "off" points midst two "on" points indicate a cubic bezier arc.

There must be exactly two cubic control points and two on points for each cubic arc (using a single cubic "off" point between two "on" points is forbidden, for example).

finally, two successive conic "off" points forces the rasterizer to create

(during the scan-line conversion process exclusively) a virtual "on" point midst them, at their exact middle. This greatly facilitates the definition of successive conic bezier arcs. Moreover, it's the way outlines are described in the TrueType specification.

Note that it is possible to mix conic and cubic arcs in a single contour, even though no current font driver produces such outlines.

                                  *            # on
                                               * off
                               __---__
  #-__                      _--       -_
      --__                _-            -
          --__           #               \
              --__                        #
                  -#
                           Two "on" points
   Two "on" points       and one "conic" point
                            between them
                *
  #            __      Two "on" points with two "conic"
   \          -  -     points between them. The point
    \        /    \    marked '0' is the middle of the
     -      0      \   "off" points, and is a 'virtual'
      -_  _-       #   "on" point where the curve passes.
        --             It does not appear in the point
                       list.
        *
        *                # on
                   *     * off
         __---__
      _--       -_
    _-            -
   #               \
                    #

     Two "on" points
   and two "cubic" point
      between them

Each glyphs original outline points are located on a grid of indivisible units. The points are stored in the font file as 16-bit integer grid coordinates, with the grid origin's being at (0, 0); they thus range from -16384 to 16383.

Convert conic to bezier arcs: Conic P0 P1 P2 Bezier B0 B1 B2 B3 B0=P0 B1=(P0+2*P1)/3 B2=(P2+2*P1)/3 B3=P2

Definition at line 1676 of file blf_glyph.cc.

References Nurb::bezt, BLI_addtail(), CU_BEZIER, CU_NURB_CYCLIC, dist_squared_to_line_v2(), eps, Nurb::flagu, float, BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_FREE, HD_VECT, l, len_squared_v2v2(), max_ff(), MEM_callocN, MEM_freeN(), Nurb::pntsu, BezTriple::radius, Nurb::resolu, Nurb::type, and BezTriple::vec.

Referenced by blf_character_to_curves().

◆ blf_glyph_transform_monospace()

static bool blf_glyph_transform_monospace ( FT_GlyphSlot glyph,
int width )
static

Transform glyph to fit nicely within a fixed column width. This conversion of a proportional font glyph into a monospaced glyph only occurs when a mono font does not contain a needed character and must get one from the fallback stack.

Definition at line 1251 of file blf_glyph.cc.

References float, and to_16dot16().

Referenced by blf_glyph_render().

◆ blf_glyph_transform_slant()

static bool blf_glyph_transform_slant ( FT_GlyphSlot glyph,
float degrees )
static

Adjust the glyph's slant by a number of degrees. Used for fonts without BLF_VARIATION_AXIS_SLANT variable axis.

Parameters
degreesamount of tilt to add in clockwise degrees.

Definition at line 1194 of file blf_glyph.cc.

References FontBLF::face, and to_16dot16().

Referenced by blf_glyph_render().

◆ blf_glyph_transform_spacing()

static bool blf_glyph_transform_spacing ( FT_GlyphSlot glyph,
float factor )
static

Adjust the glyph spacing by factor. Used for fonts without BLF_VARIATION_AXIS_SPACING variable axis.

Parameters
factor-1 (make tighter) <= 0 (normal) => 1 (add space).

Definition at line 1235 of file blf_glyph.cc.

References FontBLF::face.

Referenced by blf_glyph_render().

◆ blf_glyph_transform_weight()

static bool blf_glyph_transform_weight ( FT_GlyphSlot glyph,
float width,
bool monospaced )
static

Adjust the glyph's weight by a factor. Used for fonts without BLF_VARIATION_AXIS_WEIGHT variable axis.

Parameters
width-500 (make thinner) <= 0 (normal) => 500 (add boldness).

Definition at line 1167 of file blf_glyph.cc.

References FontBLF::face.

Referenced by blf_glyph_render().

◆ blf_glyph_transform_width()

static bool blf_glyph_transform_width ( FT_GlyphSlot glyph,
float factor )
static

Adjust the glyph width by factor. Used for fonts without BLF_VARIATION_AXIS_WIDTH variable axis.

Parameters
factor-1 (subtract width) <= 0 (normal) => 1 (add width).

Definition at line 1217 of file blf_glyph.cc.

References to_16dot16().

Referenced by blf_glyph_render().

◆ blf_glyphslot_ensure_outline()

static FT_GlyphSlot blf_glyphslot_ensure_outline ( FontBLF * font,
const uint charcode )
static

◆ blf_texture_draw()

◆ blf_var_axis_by_tag()

static const FT_Var_Axis * blf_var_axis_by_tag ( const FT_MM_Var * variations,
const uint32_t tag,
int * r_axis_index )
static

Return a design axis that matches an identifying tag.

Parameters
variationsVariation descriptors from FT_Get_MM_Var.
tagAxis tag, e.g. BLF_VARIATION_AXIS_WEIGHT.
r_axis_indexreturns index of axis in variations array.

Definition at line 973 of file blf_glyph.cc.

References int.

Referenced by blf_glyph_set_variation_float(), and blf_glyph_set_variation_normalized().

◆ from_16dot16()

static float from_16dot16 ( FT_Fixed value)
static

Convert a floating point value to a FreeType 16.16 fixed point value.

Definition at line 75 of file blf_glyph.cc.

References float.

Referenced by blf_glyph_set_variation_float().

◆ to_16dot16()

static FT_Fixed to_16dot16 ( double val)
static

Convert a floating point value to a FreeType 16.16 fixed point value.

Definition at line 67 of file blf_glyph.cc.

Referenced by blf_glyph_set_variation_float(), blf_glyph_transform_monospace(), blf_glyph_transform_slant(), blf_glyph_transform_width(), and blf_glyphslot_ensure_outline().

Variable Documentation

◆ unicode_blocks

const UnicodeBlock unicode_blocks[]
static

Definition at line 462 of file blf_glyph.cc.

Referenced by blf_charcode_to_unicode_block().