Rose
Classes | Namespaces | Typedefs | Functions
Font.h File Reference

True Type Fonts and supporting types and functions. More...

#include <filesystem>
#include <optional>
#include <memory>
#include <SDL2/SDL_ttf.h>
#include <iostream>
#include <map>
#include <vector>
#include "Utilities.h"
Include dependency graph for Font.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  rose::FontDestroy
 A functor to destroy a TTF_Font. More...
 
class  rose::FontCache
 Cache storage for requested fonts. More...
 
struct  rose::FontMetrics
 The size metrics that pertain to a particular font. More...
 

Namespaces

 rose
 ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Widget and not a Container (by user observation).
 

Typedefs

using rose::FontPointer = std::shared_ptr< TTF_Font >
 Type for TTF smart pointer.
 
using rose::FontCacheKey = std::pair< std::string, int >
 Type for TTF cache key.
 
using rose::FontCacheStore = std::map< FontCacheKey, FontPointer >
 Type for TTF cache store.
 

Functions

auto rose::textSizeUTF8 (FontPointer &fontPointer, const std::string &text)
 Get the size of a UTF8 string. More...
 
std::tuple< int, int, int, int, int > rose::getGlyphMetrics (FontPointer &font, char glyph)
 
auto rose::getFontMetrics (FontPointer &font)
 Get the font metrics of the current font. More...
 
auto rose::fetchFont (FontCache &fontCache, const std::string &fontName, int fontSize)
 Fetch a font. More...
 

Detailed Description

True Type Fonts and supporting types and functions.

Author
Richard Buckley richa.nosp@m.rd.b.nosp@m.uckle.nosp@m.y@ie.nosp@m.ee.or.nosp@m.g
Date
2020-10-21
Version
1.0