OsmAnd
Classes | Defines | Functions
jni/skia/FontHostConfiguration_android.cpp File Reference
#include "FontHostConfiguration_android.h"
#include <expat.h>
#include "SkTDArray.h"

Classes

struct  FamilyData

Defines

#define SYSTEM_FONTS_FILE   "/system/etc/system_fonts.xml"
#define FALLBACK_FONTS_FILE   "/system/etc/fallback_fonts.xml"
#define VENDOR_FONTS_FILE   "/vendor/etc/fallback_fonts.xml"
#define NO_TAG   0
#define NAMESET_TAG   1
#define FILESET_TAG   2

Functions

void textHandler (void *data, const char *s, int len)
void startElementHandler (void *data, const char *tag, const char **atts)
void endElementHandler (void *data, const char *tag)
void parseConfigFile (const char *filename, SkTDArray< FontFamily * > &families)
void getFontFamilies (SkTDArray< FontFamily * > &fontFamilies)

Define Documentation

#define FALLBACK_FONTS_FILE   "/system/etc/fallback_fonts.xml"
#define FILESET_TAG   2
#define NAMESET_TAG   1
#define NO_TAG   0
#define SYSTEM_FONTS_FILE   "/system/etc/system_fonts.xml"
#define VENDOR_FONTS_FILE   "/vendor/etc/fallback_fonts.xml"

Function Documentation

void endElementHandler ( void *  data,
const char *  tag 
)

Handler for the end of tags. We only care about family, nameset, fileset, name, and file.

void getFontFamilies ( SkTDArray< FontFamily * > &  fontFamilies)

Loads data on font families from various expected configuration files. The resulting data is returned in the given fontFamilies array.

void parseConfigFile ( const char *  filename,
SkTDArray< FontFamily * > &  families 
)

This function parses the given filename and stores the results in the given families array.

void startElementHandler ( void *  data,
const char *  tag,
const char **  atts 
)

Handler for the start of a tag. The only tags we expect are family, nameset, fileset, name, and file.

void textHandler ( void *  data,
const char *  s,
int  len 
)

Handler for arbitrary text. This is used to parse the text inside each name or file tag. The resulting strings are put into the fNames or fFileNames arrays.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines