Project Alice
Loading...
Searching...
No Matches
text::font Class Reference

#include <fonts.hpp>

Public Member Functions

 font ()=default
 
 ~font ()
 
bool can_display (char32_t ch_in) const
 
void make_glyph (char32_t ch_in)
 
float base_glyph_width (char32_t ch_in)
 
float line_height (int32_t size) const
 
float ascender (int32_t size) const
 
float descender (int32_t size) const
 
float top_adjustment (int32_t size) const
 
float text_extent (sys::state &state, stored_glyphs const &txt, uint32_t starting_offset, uint32_t count, int32_t size)
 
void remake_cache (sys::state &state, font_selection type, stored_glyphs &txt, std::string const &source)
 
void remake_cache (stored_glyphs &txt, std::string const &source)
 
void remake_cache (sys::state &state, font_selection type, stored_glyphs &txt, std::span< uint16_t > source)
 
void remake_bidiless_cache (sys::state &state, font_selection type, stored_glyphs &txt, std::span< uint16_t > source)
 
 font (font &&o) noexcept
 
fontoperator= (font &&o) noexcept
 

Public Attributes

std::string file_name
 
FT_Face font_face = nullptr
 
hb_font_t * hb_font_face = nullptr
 
hb_buffer_t * hb_buf = nullptr
 
float internal_line_height = 0.0f
 
float internal_ascender = 0.0f
 
float internal_descender = 0.0f
 
float internal_top_adj = 0.0f
 
ankerl::unordered_dense::map< char32_t, glyph_sub_offsetglyph_positions
 
std::vector< uint32_ttextures
 
std::array< FT_ULong, 256 > win1252_codepoints
 
uint16_t first_free_slot = 0
 
std::unique_ptr< FT_Byte[]> file_data
 
bool only_raw_codepoints = false
 

Friends

class font_manager
 

Detailed Description

Definition at line 101 of file fonts.hpp.

Constructor & Destructor Documentation

◆ font() [1/2]

text::font::font ( )
default

◆ ~font()

text::font::~font ( )

Definition at line 165 of file fonts.cpp.

◆ font() [2/2]

text::font::font ( font &&  o)
inlinenoexcept

Definition at line 141 of file fonts.hpp.

Member Function Documentation

◆ ascender()

float text::font::ascender ( int32_t  size) const

Definition at line 457 of file fonts.cpp.

◆ base_glyph_width()

float text::font::base_glyph_width ( char32_t  ch_in)

Definition at line 471 of file fonts.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ can_display()

bool text::font::can_display ( char32_t  ch_in) const

Definition at line 467 of file fonts.cpp.

◆ descender()

float text::font::descender ( int32_t  size) const

Definition at line 460 of file fonts.cpp.

◆ line_height()

float text::font::line_height ( int32_t  size) const

Definition at line 454 of file fonts.cpp.

◆ make_glyph()

void text::font::make_glyph ( char32_t  ch_in)

Definition at line 478 of file fonts.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

font & text::font::operator= ( font &&  o)
inlinenoexcept

Definition at line 153 of file fonts.hpp.

◆ remake_bidiless_cache()

void text::font::remake_bidiless_cache ( sys::state state,
font_selection  type,
stored_glyphs txt,
std::span< uint16_t >  source 
)

Definition at line 659 of file fonts.cpp.

Here is the call graph for this function:

◆ remake_cache() [1/3]

void text::font::remake_cache ( stored_glyphs txt,
std::string const &  source 
)

Definition at line 712 of file fonts.cpp.

Here is the call graph for this function:

◆ remake_cache() [2/3]

void text::font::remake_cache ( sys::state state,
font_selection  type,
stored_glyphs txt,
std::span< uint16_t >  source 
)

Definition at line 581 of file fonts.cpp.

Here is the call graph for this function:

◆ remake_cache() [3/3]

void text::font::remake_cache ( sys::state state,
font_selection  type,
stored_glyphs txt,
std::string const &  source 
)

Definition at line 747 of file fonts.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ text_extent()

float text::font::text_extent ( sys::state state,
stored_glyphs const &  txt,
uint32_t  starting_offset,
uint32_t  count,
int32_t  size 
)

Definition at line 875 of file fonts.cpp.

Here is the caller graph for this function:

◆ top_adjustment()

float text::font::top_adjustment ( int32_t  size) const

Definition at line 463 of file fonts.cpp.

Friends And Related Function Documentation

◆ font_manager

friend class font_manager
friend

Definition at line 139 of file fonts.hpp.

Member Data Documentation

◆ file_data

std::unique_ptr<FT_Byte[]> text::font::file_data

Definition at line 122 of file fonts.hpp.

◆ file_name

std::string text::font::file_name

Definition at line 108 of file fonts.hpp.

◆ first_free_slot

uint16_t text::font::first_free_slot = 0

Definition at line 121 of file fonts.hpp.

◆ font_face

FT_Face text::font::font_face = nullptr

Definition at line 109 of file fonts.hpp.

◆ glyph_positions

ankerl::unordered_dense::map<char32_t, glyph_sub_offset> text::font::glyph_positions

Definition at line 117 of file fonts.hpp.

◆ hb_buf

hb_buffer_t* text::font::hb_buf = nullptr

Definition at line 111 of file fonts.hpp.

◆ hb_font_face

hb_font_t* text::font::hb_font_face = nullptr

Definition at line 110 of file fonts.hpp.

◆ internal_ascender

float text::font::internal_ascender = 0.0f

Definition at line 114 of file fonts.hpp.

◆ internal_descender

float text::font::internal_descender = 0.0f

Definition at line 115 of file fonts.hpp.

◆ internal_line_height

float text::font::internal_line_height = 0.0f

Definition at line 113 of file fonts.hpp.

◆ internal_top_adj

float text::font::internal_top_adj = 0.0f

Definition at line 116 of file fonts.hpp.

◆ only_raw_codepoints

bool text::font::only_raw_codepoints = false

Definition at line 123 of file fonts.hpp.

◆ textures

std::vector<uint32_t> text::font::textures

Definition at line 118 of file fonts.hpp.

◆ win1252_codepoints

std::array<FT_ULong, 256> text::font::win1252_codepoints

Definition at line 119 of file fonts.hpp.


The documentation for this class was generated from the following files: