w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gr_face.cpp File Reference
#include "graphite2/Font.h"
#include "inc/Face.h"
#include "inc/FileFace.h"
#include "inc/GlyphCache.h"
#include "inc/CmapCache.h"
#include "inc/Silf.h"
#include "inc/json.h"
Include dependency graph for gr_face.cpp:

Go to the source code of this file.

Functions

gr_facegr_make_face_with_ops (const void *appFaceHandle, const gr_face_ops *ops, unsigned int faceOptions)
 
gr_facegr_make_face (const void *appFaceHandle, gr_get_table_fn tablefn, unsigned int faceOptions)
 
gr_facegr_make_face_with_seg_cache_and_ops (const void *appFaceHandle, const gr_face_ops *ops, unsigned int, unsigned int faceOptions)
 
gr_facegr_make_face_with_seg_cache (const void *appFaceHandle, gr_get_table_fn tablefn, unsigned int, unsigned int faceOptions)
 
gr_uint32 gr_str_to_tag (const char *str)
 
void gr_tag_to_str (gr_uint32 tag, char *str)
 
gr_feature_valgr_face_featureval_for_lang (const gr_face *pFace, gr_uint32 langname)
 
const gr_feature_refgr_face_find_fref (const gr_face *pFace, gr_uint32 featId)
 
unsigned short gr_face_n_fref (const gr_face *pFace)
 
const gr_feature_refgr_face_fref (const gr_face *pFace, gr_uint16 i)
 
unsigned short gr_face_n_languages (const gr_face *pFace)
 
gr_uint32 gr_face_lang_by_index (const gr_face *pFace, gr_uint16 i)
 
void gr_face_destroy (gr_face *face)
 
gr_uint16 gr_face_name_lang_for_locale (gr_face *face, const char *locale)
 
unsigned short gr_face_n_glyphs (const gr_face *pFace)
 
const gr_faceinfogr_face_info (const gr_face *pFace, gr_uint32 script)
 
int gr_face_is_char_supported (const gr_face *pFace, gr_uint32 usv, gr_uint32 script)
 
gr_facegr_make_file_face (const char *filename, unsigned int faceOptions)
 
gr_facegr_make_file_face_with_seg_cache (const char *filename, unsigned int, unsigned int faceOptions)
 

Variables

jsonglobal_log
 

Function Documentation

◆ gr_face_destroy()

void gr_face_destroy ( gr_face face)

Destroy the given face and free its memory

Definition at line 200 of file gr_face.cpp.

References face.

◆ gr_face_featureval_for_lang()

gr_feature_val* gr_face_featureval_for_lang ( const gr_face pFace,
gr_uint32  langname 
)

Get feature values for a given language or default

Returns
a copy of the default feature values for a given language. The application must call gr_featureval_destroy() to free this object when done.
Parameters
pFaceThe font face to get feature values from
langnameThe language tag to get feature values for. If there is no such language or langname is 0, the default feature values for the font are returned. langname is right 0 padded and assumes lowercase. Thus the en langauge would be 0x656E0000. Langname may also be space padded, thus 0x656E2020.

Definition at line 147 of file gr_face.cpp.

References assert(), graphite2::SillMap::cloneFeatures(), langname, and graphite2::Face::theSill().

Referenced by getGraphiteFeatureDefaultSetting(), and initGraphiteBreaking().

◆ gr_face_find_fref()

const gr_feature_ref* gr_face_find_fref ( const gr_face pFace,
gr_uint32  featId 
)

Get feature reference for a given feature id from a face

Returns
a feature reference corresponding to the given id. This data is part of the gr_face and will be freed when the face is destroyed.
Parameters
pFaceFont face to get information on.
featIdFeature id tag to get reference to.

Definition at line 155 of file gr_face.cpp.

References assert(), and graphite2::Face::featureById().

Referenced by countGraphiteFeatureSettings(), findGraphiteFeatureSettingNamed(), getGraphiteFeatureDefaultSetting(), getGraphiteFeatureLabel(), getGraphiteFeatureSettingCode(), getGraphiteFeatureSettingLabel(), and initGraphiteBreaking().

◆ gr_face_fref()

const gr_feature_ref* gr_face_fref ( const gr_face pFace,
gr_uint16  i 
)

Returns feature reference at given index in face

Definition at line 173 of file gr_face.cpp.

References assert(), count, graphite2::Face::feature(), graphite2::FeatureRef::getFlags(), i, j, and graphite2::Face::numFeatures().

Referenced by findGraphiteFeatureNamed(), and getGraphiteFeatureCode().

◆ gr_face_info()

const gr_faceinfo* gr_face_info ( const gr_face pFace,
gr_uint32  script 
)

Returns a faceinfo for the face and script

Definition at line 220 of file gr_face.cpp.

References graphite2::Face::chooseSilf(), script, and graphite2::Silf::silfInfo().

◆ gr_face_is_char_supported()

int gr_face_is_char_supported ( const gr_face pFace,
gr_uint32  usv,
gr_uint32  script 
)

Returns whether the font supports a given Unicode character

Returns
true if the character is supported.
Parameters
pFaceface to test within
usvUnicode Scalar Value of character to test
scriptTag of script for selecting which set of pseudo glyphs to test. May be NULL.

Definition at line 228 of file gr_face.cpp.

References graphite2::Face::chooseSilf(), cmap, graphite2::Face::cmap(), graphite2::Silf::findPseudo(), and script.

◆ gr_face_lang_by_index()

gr_uint32 gr_face_lang_by_index ( const gr_face pFace,
gr_uint16  i 
)

Returns a language id corresponding to a language of given index in the face

Definition at line 193 of file gr_face.cpp.

References assert(), graphite2::SillMap::getLangName(), i, and graphite2::Face::theSill().

◆ gr_face_n_fref()

unsigned short gr_face_n_fref ( const gr_face pFace)

Returns number of feature references in a face

Definition at line 163 of file gr_face.cpp.

References assert(), graphite2::Face::feature(), graphite2::FeatureRef::getFlags(), i, graphite2::Face::numFeatures(), and res.

Referenced by countGraphiteFeatures(), and findGraphiteFeatureNamed().

◆ gr_face_n_glyphs()

unsigned short gr_face_n_glyphs ( const gr_face pFace)

Returns the number of glyphs in the face

Definition at line 215 of file gr_face.cpp.

References graphite2::Face::glyphs(), and graphite2::GlyphCache::numGlyphs().

◆ gr_face_n_languages()

unsigned short gr_face_n_languages ( const gr_face pFace)

Return number of languages the face knows about

Definition at line 187 of file gr_face.cpp.

References assert(), graphite2::SillMap::numLanguages(), and graphite2::Face::theSill().

◆ gr_face_name_lang_for_locale()

gr_uint16 gr_face_name_lang_for_locale ( gr_face face,
const char *  locale 
)

Definition at line 206 of file gr_face.cpp.

References face, and locale.

◆ gr_make_face()

gr_face* gr_make_face ( const void appFaceHandle,
gr_get_table_fn  getTable,
unsigned int  faceOptions 
)
Deprecated:
Since v1.2.0 in favour of gr_make_face_with_ops. Create a gr_face object given application information and a getTable function.
Returns
gr_face or NULL if the font fails to load for some reason.
Parameters
appFaceHandleThis is application specific information that is passed to the getTable function. The appFaceHandle must stay alive as long as the gr_face is alive.
getTableCallback function to get table data.
faceOptionsBitfield describing various options. See enum gr_face_options for details.

Definition at line 104 of file gr_face.cpp.

References gr_make_face_with_ops(), and NULL.

◆ gr_make_face_with_ops()

gr_face* gr_make_face_with_ops ( const void appFaceHandle,
const gr_face_ops face_ops,
unsigned int  faceOptions 
)

Create a gr_face object given application information and a table functions.

Returns
gr_face or NULL if the font fails to load for some reason.
Parameters
appFaceHandleThis is application specific information that is passed to the getTable function. The appFaceHandle must stay alive as long as the gr_face is alive.
face_opsPointer to face specific callback structure for table management. Must stay alive for the duration of the call only.
faceOptionsBitfield describing various options. See enum gr_face_options for details.

Definition at line 91 of file gr_face.cpp.

References res.

◆ gr_make_face_with_seg_cache()

gr_face* gr_make_face_with_seg_cache ( const void appFaceHandle,
gr_get_table_fn  getTable,
unsigned int  segCacheMaxSize,
unsigned int  faceOptions 
)
Deprecated:
Since 1.3.7 this function is now an alias for gr_make_face().

Create a gr_face object given application information, with subsegmental caching support. This function is deprecated as of v1.2.0 in favour of gr_make_face_with_seg_cache_and_ops.

Returns
gr_face or NULL if the font fails to load.
Parameters
appFaceHandleis a pointer to application specific information that is passed to getTable. This may not be NULL and must stay alive as long as the gr_face is alive.
getTableThe function graphite calls to access font table data
segCacheMaxSizeHow large the segment cache is.
faceOptionsBitfield of values from enum gr_face_options

Definition at line 116 of file gr_face.cpp.

References gr_make_face_with_ops(), and NULL.

◆ gr_make_face_with_seg_cache_and_ops()

gr_face* gr_make_face_with_seg_cache_and_ops ( const void appFaceHandle,
const gr_face_ops face_ops,
unsigned int  segCacheMaxSize,
unsigned int  faceOptions 
)
Deprecated:
Since 1.3.7 this function is now an alias for gr_make_face_with_ops().

Create a gr_face object given application information, with subsegmental caching support

Returns
gr_face or NULL if the font fails to load.
Parameters
appFaceHandleis a pointer to application specific information that is passed to getTable. This may not be NULL and must stay alive as long as the gr_face is alive.
face_opsPointer to face specific callback structure for table management. Must stay alive for the duration of the call only.
segCacheMaxSizeUnused.
faceOptionsBitfield of values from enum gr_face_options

Definition at line 111 of file gr_face.cpp.

References gr_make_face_with_ops().

◆ gr_make_file_face()

gr_face* gr_make_file_face ( const char *  filename,
unsigned int  faceOptions 
)

Create gr_face from a font file

Returns
gr_face that accesses a font file directly. Returns NULL on failure.
Parameters
filenameFull path and filename to font file
faceOptionsBitfile from enum gr_face_options to control face options.

Definition at line 241 of file gr_face.cpp.

References filename, gr_make_face_with_ops(), NULL, and graphite2::Face::takeFileFace().

◆ gr_make_file_face_with_seg_cache()

gr_face* gr_make_file_face_with_seg_cache ( const char *  filename,
unsigned int  segCacheMaxSize,
unsigned int  faceOptions 
)
Deprecated:
Since 1.3.7. This function is now an alias for gr_make_file_face().

Create gr_face from a font file, with subsegment caching support.

Returns
gr_face that accesses a font file directly. Returns NULL on failure.
Parameters
filenameFull path and filename to font file
segCacheMaxSizeSpecifies how big to make the cache in segments.
faceOptionsBitfield from enum gr_face_options to control face options.

Definition at line 260 of file gr_face.cpp.

References filename, and gr_make_file_face().

◆ gr_str_to_tag()

gr_uint32 gr_str_to_tag ( const char *  str)

Convert a tag in a string into a gr_uint32

Returns
gr_uint32 tag, zero padded
Parameters
stra nul terminated string of which at most the first 4 characters are read

Definition at line 122 of file gr_face.cpp.

References GR_FALLTHROUGH, max, res, str, and strlen().

◆ gr_tag_to_str()

void gr_tag_to_str ( gr_uint32  tag,
char *  str 
)

Convert a gr_uint32 tag into a string

Parameters
tagcontains the tag to convert
stris a pointer to a char array of at least size 4 bytes. The first 4 bytes of this array will be overwritten by this function. No nul is appended.

Definition at line 136 of file gr_face.cpp.

References str.

Variable Documentation

◆ global_log

json* global_log
extern

Definition at line 44 of file gr_logging.cpp.

Referenced by gr_start_logging(), and gr_stop_logging().