KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::BUILTIN_FONT Namespace Reference

Classes

struct  FONT_GLYPH_TYPE
 
struct  FONT_IMAGE_TYPE
 
struct  FONT_INFO_TYPE
 
struct  FONT_SPAN_TYPE
 
struct  GLYPH_BOX
 Where a glyph's quad sits and what it samples, in font units, which are also atlas texels. More...
 

Functions

const FONT_GLYPH_TYPE * LookupGlyph (unsigned int aCodepoint)
 
unsigned int GlyphCount ()
 The number of glyphs in the font, starting at LookupGlyph( '!
 
GLYPH_BOX ComputeGlyphBox (const FONT_GLYPH_TYPE &aGlyph)
 
double SpaceAdvance ()
 How far a space moves the pen.
 
std::pair< VECTOR2D, float > ComputeBitmapTextSize (const UTF8 &aText)
 Size of a line of text in atlas units, and how far its glyphs sit above their lowest point.
 

Variables

FONT_INFO_TYPE font_information
 
FONT_SPAN_TYPE font_codepoint_spans []
 
FONT_GLYPH_TYPE font_codepoint_infos []
 
static const int bitmap_chars_count = 65535
 
GAL_API FONT_IMAGE_TYPE font_image
 

Function Documentation

◆ ComputeBitmapTextSize()

GAL_API std::pair< VECTOR2D, float > KIGFX::BUILTIN_FONT::ComputeBitmapTextSize ( const UTF8 & aText)

Size of a line of text in atlas units, and how far its glyphs sit above their lowest point.

Definition at line 96 of file gl_resources.cpp.

References end, font_information, LookupGlyph(), KIGFX::BUILTIN_FONT::FONT_GLYPH_TYPE::miny, UTF8::ubegin(), and UTF8::uend().

Referenced by KIGFX::OPENGL_GAL::computeBitmapTextSize().

◆ ComputeGlyphBox()

◆ GlyphCount()

GAL_API unsigned int KIGFX::BUILTIN_FONT::GlyphCount ( )

The number of glyphs in the font, starting at LookupGlyph( '!

' )

Definition at line 62 of file gl_resources.cpp.

References font_codepoint_infos.

◆ LookupGlyph()

◆ SpaceAdvance()

GAL_API double KIGFX::BUILTIN_FONT::SpaceAdvance ( )

How far a space moves the pen.

The font has no space glyph, so this matches the stroke font.

Definition at line 88 of file gl_resources.cpp.

References KIGFX::BUILTIN_FONT::FONT_GLYPH_TYPE::advance, and LookupGlyph().

Referenced by KIGFX::OPENGL_GAL::drawBitmapChar().

Variable Documentation

◆ bitmap_chars_count

const int KIGFX::BUILTIN_FONT::bitmap_chars_count = 65535
static

Definition at line 1356 of file gl_resources.cpp.

◆ font_codepoint_infos

FONT_GLYPH_TYPE KIGFX::BUILTIN_FONT::font_codepoint_infos[]

Definition at line 119 of file gl_resources.cpp.

Referenced by GlyphCount(), and LookupGlyph().

◆ font_codepoint_spans

FONT_SPAN_TYPE KIGFX::BUILTIN_FONT::font_codepoint_spans[]

Definition at line 9 of file gl_resources.cpp.

Referenced by LookupGlyph().

◆ font_image

◆ font_information

FONT_INFO_TYPE KIGFX::BUILTIN_FONT::font_information
Initial value:
= {
1,
-8.16f,
39.84f
}

Definition at line 3 of file gl_resources.cpp.

Referenced by ComputeBitmapTextSize(), and ComputeGlyphBox().