Functions | Variables

fontdetection.cpp File Reference

Detection of the right font. More...

#include "stdafx.h"
#include "debug.h"
#include "fontdetection.h"
#include "string_func.h"
#include "strings_func.h"
#include <fontconfig/fontconfig.h>

Go to the source code of this file.

Functions

FT_Error GetFontByFaceName (const char *font_name, FT_Face *face)
 Get the font loaded into a Freetype face by using a font-name.
bool SetFallbackFont (FreeTypeSettings *settings, const char *language_isocode, int winlangid, MissingGlyphSearcher *callback)
 We would like to have a fallback font as the current one doesn't contain all characters we need.

Variables

FT_Library _library

Detailed Description

Detection of the right font.

Definition in file fontdetection.cpp.


Function Documentation

FT_Error GetFontByFaceName ( const char *  font_name,
FT_Face *  face 
)

Get the font loaded into a Freetype face by using a font-name.

Load a freetype font face with the given font name.

If no appropriate font is found, the function returns an error

Definition at line 633 of file fontdetection.cpp.

References free(), and ShowInfoF().

Referenced by LoadFreeTypeFont().

bool SetFallbackFont ( FreeTypeSettings settings,
const char *  language_isocode,
int  winlangid,
class MissingGlyphSearcher callback 
)

We would like to have a fallback font as the current one doesn't contain all characters we need.

This function must set all fonts of settings.

Parameters:
settings the settings to overwrite the fontname of.
language_isocode the language, e.g. en_GB.
winlangid the language ID windows style.
callback The function to call to check for missing glyphs.
Returns:
true if a font has been set, false otherwise.

Definition at line 699 of file fontdetection.cpp.

References DEBUG, MissingGlyphSearcher::FindMissingGlyphs(), InitFreeType(), lastof, MissingGlyphSearcher::Monospace(), seprintf(), and MissingGlyphSearcher::SetFontNames().

Referenced by CheckForMissingGlyphs().